ÿþ<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=unicode" /> <meta http-equiv="Content-Language" content="en-us" /> <title>The Win32 Windows disk programming using C/C++ and Visual Studio</title> <meta name="keywords" content="disk, storage, partition, hardware, boot record, management, devices, tape drive, backup, online, administrations" /> <meta name="description" content="This is a complete Win32 Windows disk programming tutorials coming with notes and working C/C++ program examples and code samples" /> <style> <!-- h3 {margin-right:0mm; margin-left:0mm; font-size:13.5pt; font-family:"Times New Roman","serif"; font-weight:bold} --> </style> </head> <body topmargin="20" leftmargin="20" rightmargin="20" bottommargin="20"> <table border="0" width="100%"> <tr> <td colspan="2"> <p align="center"><font size="6" face="Times New Roman"> <span style="line-height:115%;font-family:&quot;Batang&quot;">Win32 Windows Disk Programming</span></font></p> </td> </tr> <tr> <td colspan="2"> <p align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; google_ad_slot = "2156170134"; google_ad_width = 728; google_ad_height = 15; //--> </script> &nbsp;<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> </td> </tr> <tr> <td width="7%" align="center"><div align="center"> </div> <div align="left"> <p style="margin-top: 0; margin-bottom: 0">&nbsp;</div> <div align="center"> <p style="margin-top: 0; margin-bottom: 0"> <script src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=160X600&cwpid=527221&cwwidth=160&cwheight=600&cwpnet=1&cwtagid=82739"></script> </div> <div align="left"> <p style="margin-top: 0; margin-bottom: 0">&nbsp;</div> <p align="left" style="margin-top: 0; margin-bottom: 0">&nbsp;</p> <p style="margin-top: 0; margin-bottom: 0"> <script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; google_ad_slot = "3614899554"; google_ad_width = 160; google_ad_height = 600; //--> </script> &nbsp;<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <p style="margin-top: 0; margin-bottom: 0"> &nbsp;</p> <p style="margin-top: 0; margin-bottom: 0"> &nbsp;</p> <h3 style="margin-top: 0; margin-bottom: 0"> <font face="Byington"><span style="font-weight: 400"> <a title="The Win32 programming tutorial using Visual Studio, C and C++ languages" target="_top" href="index.html"> HOME</a></span></font></h3> </td> <td width="92%"> <h1 style="margin-bottom:0mm;margin-bottom:.0001pt"> <span style="line-height:115%; font-family:&quot;Arial&quot;; font-weight:400"> <font size="5" face="Times New Roman">What do we have in this session?</font></span></h1> <p style="margin-bottom:0mm;margin-bottom:.0001pt"> <font face="Arial">This tutorial provide information and program examples on how to manipulate disk/drive in Windows system using Win32 APIs. The information may be repeated for files and directories that are available in the next tutorials.</font></p> <ol> <li> <h1 style="margin-bottom:0mm;margin-bottom:0; margin-top:0"> <span style="font-weight: 400"><font size="4" face="Byington"> <a href="windowsdiskapis2.html">Introduction</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0; margin-top:0"> <span style="font-weight: 400"><font size="4" face="Byington">Disk Devices and Partitions</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_1.html">Basic and Dynamic Disks</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Basic Disks</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Dynamic Disks</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_2.html">Partition Styles</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Master Boot Record</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">GUID Partition Table</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_3.html">Detecting the Type of Disk</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Defining an MS-DOS Device Name</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_4.html">Managing Disk Quotas</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">User-level Administration of Disk Quotas</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">System-level Administration of Disk Quotas</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Quota Limits</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Quota Interfaces</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_5.html">Disk Management Control Codes</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Management Enumeration Types</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">MEDIA_TYPE Enumeration Definition</font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Constants</font></span></h1> </li> </ul> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">PARTITION_STYLE Enumeration Definition</font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Constants</font></span></h1> </li> </ul> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Management Functions</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0; margin-top:0"> <span style="font-weight: 400"><font size="4" face="Byington"> <a href="windowsdiskapis2_6.html">CreateFile() Function</a></font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-right:0mm;margin-bottom:0mm;margin-bottom:0"> <span style="font-weight: 400"><font size="4" face="Byington">Parameters</font></span></h1> </li> <li> <h1 style="margin-top:0;margin-right:0mm;margin-bottom:0mm;margin-bottom:0"> <span style="font-weight: 400"><font size="4" face="Byington">Return Value</font></span></h1> </li> </ul> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_7.html">Symbolic Link Behavior</a></font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Caching Behavior</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_8.html">Files</a></font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Synchronous and Asynchronous I/O Handles</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">File Streams</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Directories</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Physical Disks and Volumes</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Changer Device</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Tape Drives</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Communications Resources</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Consoles</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Mailslots</font></span></h1> </li> <li> <h1 style="margin:0 0mm;"><span style="font-weight: 400"> <font size="4" face="Byington">Pipes</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_9.html">Opening a File for Reading or Writing</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Example: Open a File for Writing</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_10.html">Example: Open a File for Reading</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0; margin-top:0"> <span style="font-weight: 400"><font size="4" face="Byington"> <a href="windowsdiskapis2_11.html">How Do I Get the Security tab in Folder Properties?</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_12.html">Calling DeviceIoControl() Program Example</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_13.html">DeleteFile() Function</a></font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Parameters</font></span></h1> </li> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Return Value</font></span></h1> </li> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Remarks</font></span></h1> </li> </ul> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Symbolic link behavior</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Deleting a File Program Example</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0; margin-top:0"> <span style="font-weight: 400"><font size="4" face="Byington"> <a href="windowsdiskapis2_14.html">Another Deleting File Program Example</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_15.html">GetDiskFreeSpace() Function</a></font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Parameters</font></span></h1> </li> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Return Value</font></span></h1> </li> </ul> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">GetDiskFreeSpaceEx() Function Example</font></span></h1> <ul type="square"> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Parameters</font></span></h1> </li> <li> <h1 style="margin-top:0;margin-bottom:0mm; margin-bottom:0;line-height:normal"><span style="font-weight: 400"> <font size="4" face="Byington">Return Value</font></span></h1> </li> </ul> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Notes on 64-bit Integer Math</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington"><a href="windowsdiskapis2_16.html">Disk Management Interfaces</a></font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Management Structures</font></span></h1> </li> <li> <h1 style="margin-bottom:0mm;margin-bottom:0;line-height: normal; margin-top:0"><span style="font-weight: 400"> <font size="4" face="Byington">Disk Partition Types</font></span></h1> </li> </ol> </td> </tr> <tr> <td colspan="2"> <p align="left">&nbsp;</p> <div align="center"> <script src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=527221&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=82740"></script> </div> </td> </tr> <tr> <td colspan="2"> <h3 align="center" style="margin-top: 0; margin-bottom: 0"> <font face="Byington"><span style="font-weight: 400">&lt; <a title="The Windows system volume programming course" href="windowsvolumeapis1index.html"> Windows Volume Programming Index</a> | <a title="The Win32 programming tutorial using Visual Studio, C and C++ languages" href="index.html"> Win32 Programming</a> | <a title="The Win32 Windows disk programming hands-on tutorials" href="windowsdiskapis2.html"> Windows Disk 1</a> &gt;</span></font></h3> </td> </tr> </table> </body> </html>