home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 April / PCWorld_2008-04_cd.bin / temacd / devc++ / devcpp-4.9.9.2_setup.exe / winioctl.h < prev    next >
C/C++ Source or Header  |  2005-01-29  |  22KB  |  547 lines

  1. #ifndef _WINIOCTL_H
  2. #define _WINIOCTL_H
  3. #if __GNUC__ >=3
  4. #pragma GCC system_header
  5. #endif
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #define HIST_NO_OF_BUCKETS 24
  11. #define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
  12. #define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
  13. #define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
  14. #define DEVICE_TYPE_FROM_CTL_CODE(c) (((DWORD)((c)&0xffff0000))>>16)
  15. #define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
  16. #define IOCTL_STORAGE_CHECK_VERIFY     CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
  17. #define IOCTL_STORAGE_CHECK_VERIFY2    CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
  18. #define IOCTL_STORAGE_MEDIA_REMOVAL    CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
  19. #define IOCTL_STORAGE_EJECT_MEDIA      CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
  20. #define IOCTL_STORAGE_LOAD_MEDIA       CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
  21. #define IOCTL_STORAGE_LOAD_MEDIA2      CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
  22. #define IOCTL_STORAGE_RESERVE          CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
  23. #define IOCTL_STORAGE_RELEASE          CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
  24. #define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
  25. #define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
  26. #define IOCTL_STORAGE_MCN_CONTROL      CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
  27. #define IOCTL_STORAGE_GET_MEDIA_TYPES  CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
  28. #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
  29. #define IOCTL_STORAGE_RESET_BUS        CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
  30. #define IOCTL_STORAGE_RESET_DEVICE     CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
  31. #define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
  32. #define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
  33. #define IOCTL_DISK_BASE FILE_DEVICE_DISK
  34. #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE,0,METHOD_BUFFERED, FILE_ANY_ACCESS)
  35. #define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,1,METHOD_BUFFERED,FILE_READ_ACCESS)
  36. #define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,2,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
  37. #define IOCTL_DISK_GET_DRIVE_LAYOUT    CTL_CODE(IOCTL_DISK_BASE,3,METHOD_BUFFERED,FILE_READ_ACCESS)
  38. #define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,4,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
  39. #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE,5,METHOD_BUFFERED,FILE_ANY_ACCESS)
  40. #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE,6,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
  41. #define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE,7,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
  42. #define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
  43. #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE,9,METHOD_BUFFERED,FILE_ANY_ACCESS)
  44. #define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE,10,METHOD_BUFFERED,FILE_ANY_ACCESS)
  45. #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE,11,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
  46. #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,12,METHOD_BUFFERED,FILE_ANY_ACCESS)
  47. #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
  48. #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE,14,METHOD_BUFFERED,FILE_ANY_ACCESS)
  49. #define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
  50. #define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE,16,METHOD_BUFFERED,FILE_ANY_ACCESS)
  51. #define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x12,METHOD_BUFFERED,FILE_ANY_ACCESS)
  52. #define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x13,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  53. #define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x14,METHOD_BUFFERED,FILE_ANY_ACCESS)
  54. #define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x15,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  55. #define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE,0x16,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  56. #define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE,0x17,METHOD_BUFFERED,FILE_READ_ACCESS)
  57. #define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE,0x18,METHOD_BUFFERED,FILE_ANY_ACCESS)
  58. #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE,0x28,METHOD_BUFFERED,FILE_ANY_ACCESS)
  59. #define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE,0x34,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  60. #define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x35,METHOD_BUFFERED,FILE_READ_ACCESS)
  61. #define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x36,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  62. #define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,0x40,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  63. #define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE,0x50,METHOD_BUFFERED,FILE_ANY_ACCESS)
  64. #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE,0x200,METHOD_BUFFERED,FILE_READ_ACCESS)
  65. #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE,0x201,METHOD_BUFFERED,FILE_READ_ACCESS)
  66. #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x202,METHOD_BUFFERED,FILE_READ_ACCESS)
  67. #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x203,METHOD_BUFFERED,FILE_READ_ACCESS)
  68. #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE,0x204,METHOD_BUFFERED,FILE_READ_ACCESS)
  69. #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE,0x205,METHOD_BUFFERED,FILE_READ_ACCESS)
  70. #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE,0x206,METHOD_BUFFERED,FILE_READ_ACCESS)
  71. #define IOCTL_DISK_REMOVE_DEVICE CTL_CODE(IOCTL_DISK_BASE,0x207,METHOD_BUFFERED,FILE_READ_ACCESS)
  72. #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE,0x300,METHOD_BUFFERED,FILE_ANY_ACCESS)
  73. #define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  74. #define IOCTL_SERIAL_LSRMST_INSERT    CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
  75. #define FSCTL_LOCK_VOLUME    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,6,METHOD_BUFFERED,FILE_ANY_ACCESS)
  76. #define FSCTL_UNLOCK_VOLUME    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,7,METHOD_BUFFERED,FILE_ANY_ACCESS)
  77. #define FSCTL_DISMOUNT_VOLUME    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
  78. #define FSCTL_MOUNT_DBLS_VOLUME    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
  79. #define FSCTL_GET_COMPRESSION    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
  80. #define FSCTL_SET_COMPRESSION    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16,METHOD_BUFFERED,FILE_READ_DATA|FILE_WRITE_DATA)
  81. #define FSCTL_READ_COMPRESSION    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,17,METHOD_NEITHER,FILE_READ_DATA)
  82. #define FSCTL_WRITE_COMPRESSION    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,18,METHOD_NEITHER,FILE_WRITE_DATA)
  83. #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM,25,METHOD_BUFFERED,FILE_ANY_ACCESS)
  84. #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM,27,METHOD_NEITHER,FILE_ANY_ACCESS)
  85. #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM,28,METHOD_NEITHER,FILE_ANY_ACCESS)
  86. #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM,29,METHOD_BUFFERED,FILE_ANY_ACCESS)
  87. #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
  88. #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS)
  89. #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_ANY_ACCESS)
  90. #define FSCTL_SET_SPARSE    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  91. #define DEVICE_TYPE DWORD
  92. #define FILE_DEVICE_BEEP    1
  93. #define FILE_DEVICE_CD_ROM    2
  94. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM    3
  95. #define FILE_DEVICE_CONTROLLER    4
  96. #define FILE_DEVICE_DATALINK    5
  97. #define FILE_DEVICE_DFS    6
  98. #define FILE_DEVICE_DISK    7
  99. #define FILE_DEVICE_DISK_FILE_SYSTEM    8
  100. #define FILE_DEVICE_FILE_SYSTEM    9
  101. #define FILE_DEVICE_INPORT_PORT    10
  102. #define FILE_DEVICE_KEYBOARD    11
  103. #define FILE_DEVICE_MAILSLOT    12
  104. #define FILE_DEVICE_MIDI_IN    13
  105. #define FILE_DEVICE_MIDI_OUT    14
  106. #define FILE_DEVICE_MOUSE    15
  107. #define FILE_DEVICE_MULTI_UNC_PROVIDER 16
  108. #define FILE_DEVICE_NAMED_PIPE    17
  109. #define FILE_DEVICE_NETWORK    18
  110. #define FILE_DEVICE_NETWORK_BROWSER    19
  111. #define FILE_DEVICE_NETWORK_FILE_SYSTEM    20
  112. #define FILE_DEVICE_NULL    21
  113. #define FILE_DEVICE_PARALLEL_PORT    22
  114. #define FILE_DEVICE_PHYSICAL_NETCARD    23
  115. #define FILE_DEVICE_PRINTER    24
  116. #define FILE_DEVICE_SCANNER    25
  117. #define FILE_DEVICE_SERIAL_MOUSE_PORT    26
  118. #define FILE_DEVICE_SERIAL_PORT    27
  119. #define FILE_DEVICE_SCREEN    28
  120. #define FILE_DEVICE_SOUND    29
  121. #define FILE_DEVICE_STREAMS    30
  122. #define FILE_DEVICE_TAPE    31
  123. #define FILE_DEVICE_TAPE_FILE_SYSTEM    32
  124. #define FILE_DEVICE_TRANSPORT    33
  125. #define FILE_DEVICE_UNKNOWN    34
  126. #define FILE_DEVICE_VIDEO    35
  127. #define FILE_DEVICE_VIRTUAL_DISK    36
  128. #define FILE_DEVICE_WAVE_IN    37
  129. #define FILE_DEVICE_WAVE_OUT    38
  130. #define FILE_DEVICE_8042_PORT    39
  131. #define FILE_DEVICE_NETWORK_REDIRECTOR    40
  132. #define FILE_DEVICE_BATTERY    41
  133. #define FILE_DEVICE_BUS_EXTENDER    42
  134. #define FILE_DEVICE_MODEM           43
  135. #define FILE_DEVICE_VDM             44
  136. #define FILE_DEVICE_MASS_STORAGE    45
  137. #define FILE_DEVICE_SMB             46
  138. #define FILE_DEVICE_KS              47
  139. #define FILE_DEVICE_CHANGER         48
  140. #define FILE_DEVICE_SMARTCARD       49
  141. #define FILE_DEVICE_ACPI            50
  142. #define FILE_DEVICE_DVD             51
  143. #define FILE_DEVICE_FULLSCREEN_VIDEO 52
  144. #define FILE_DEVICE_DFS_FILE_SYSTEM  53
  145. #define FILE_DEVICE_DFS_VOLUME       54
  146. #define FILE_DEVICE_SERENUM          55
  147. #define FILE_DEVICE_TERMSRV          56
  148. #define FILE_DEVICE_KSEC             57
  149. #define PARTITION_ENTRY_UNUSED    0
  150. #define PARTITION_FAT_12    1
  151. #define PARTITION_XENIX_1    2
  152. #define PARTITION_XENIX_2    3
  153. #define PARTITION_FAT_16    4
  154. #define PARTITION_EXTENDED    5
  155. #define PARTITION_HUGE    6
  156. #define PARTITION_IFS    7
  157. #define PARTITION_FAT32 0x0B
  158. #define PARTITION_FAT32_XINT13 0x0C
  159. #define PARTITION_XINT13 0x0E
  160. #define PARTITION_XINT13_EXTENDED 0x0F
  161. #define PARTITION_PREP    0x41
  162. #define PARTITION_LDM    0x42
  163. #define PARTITION_UNIX    0x63
  164. #define PARTITION_NTFT    128
  165. #define VALID_NTFT    0xC0
  166. #define METHOD_BUFFERED    0
  167. #define METHOD_IN_DIRECT    1
  168. #define METHOD_OUT_DIRECT    2
  169. #define METHOD_NEITHER        3
  170. #define SERIAL_LSRMST_ESCAPE        0
  171. #define SERIAL_LSRMST_LSR_DATA      1
  172. #define SERIAL_LSRMST_LSR_NODATA    2
  173. #define SERIAL_LSRMST_MST    3
  174.  
  175. /*  Also in ddk/winddk.h */
  176. #define FILE_ANY_ACCESS        0x00000000
  177. #define FILE_SPECIAL_ACCESS    FILE_ANY_ACCESS
  178. #define FILE_READ_ACCESS    0x00000001
  179. #define FILE_WRITE_ACCESS    0x00000002
  180.  
  181. #define DISK_LOGGING_START    0
  182. #define DISK_LOGGING_STOP    1
  183. #define DISK_LOGGING_DUMP    2
  184. #define DISK_BINNING        3
  185. typedef WORD BAD_TRACK_NUMBER,*PBAD_TRACK_NUMBER;
  186. typedef enum _BIN_TYPES {RequestSize,RequestLocation} BIN_TYPES;
  187. typedef struct _BIN_RANGE {
  188.     LARGE_INTEGER StartValue;
  189.     LARGE_INTEGER Length;
  190. } BIN_RANGE,*PBIN_RANGE;
  191. typedef struct _BIN_COUNT {
  192.     BIN_RANGE BinRange;
  193.     DWORD BinCount;
  194. } BIN_COUNT,*PBIN_COUNT;
  195. typedef struct _BIN_RESULTS {
  196.     DWORD NumberOfBins;
  197.     BIN_COUNT BinCounts[1];
  198. } BIN_RESULTS,*PBIN_RESULTS;
  199. typedef enum _PARTITION_STYLE {
  200.   PARTITION_STYLE_MBR, 
  201.   PARTITION_STYLE_GPT, 
  202.   PARTITION_STYLE_RAW
  203. } PARTITION_STYLE;
  204. typedef struct {
  205.   GUID DiskId;
  206.   DWORD MaxPartitionCount;
  207. } CREATE_DISK_GPT,*PCREATE_DISK_GPT;
  208. typedef struct {
  209.   DWORD Signature;
  210. } CREATE_DISK_MBR,*PCREATE_DISK_MBR;
  211. typedef struct {
  212.   PARTITION_STYLE PartitionStyle;
  213.   _ANONYMOUS_UNION union {
  214.     CREATE_DISK_MBR Mbr;
  215.     CREATE_DISK_GPT Gpt;
  216.   };
  217. } CREATE_DISK,*PCREATE_DISK;
  218. typedef enum {
  219.   EqualPriority,
  220.   KeepPrefetchedData,
  221.   KeepReadData
  222. } DISK_CACHE_RETENTION_PRIORITY;
  223. typedef struct _DISK_CACHE_INFORMATION {
  224.   BOOLEAN ParametersSavable;
  225.   BOOLEAN ReadCacheEnabled;
  226.   BOOLEAN WriteCacheEnabled;
  227.   DISK_CACHE_RETENTION_PRIORITY ReadRetentionPriority;
  228.   DISK_CACHE_RETENTION_PRIORITY WriteRetentionPriority;
  229.   WORD DisablePrefetchTransferLength;
  230.   BOOLEAN PrefetchScalar;
  231.   _ANONYMOUS_UNION union {
  232.     struct {
  233.       WORD Minimum;
  234.       WORD Maximum;
  235.       WORD MaximumBlocks;
  236.     } ScalarPrefetch;
  237.     struct {
  238.       WORD Minimum;
  239.       WORD Maximum;
  240.     } BlockPrefetch;
  241.   };
  242. } DISK_CACHE_INFORMATION,*PDISK_CACHE_INFORMATION;
  243. typedef enum _DETECTION_TYPE {
  244.   DetectNone,
  245.   DetectInt13,
  246.   DetectExInt13
  247. } DETECTION_TYPE;
  248. typedef struct _DISK_INT13_INFO {
  249.   WORD DriveSelect;
  250.   DWORD MaxCylinders;
  251.   WORD SectorsPerTrack;
  252.   WORD MaxHeads;
  253.   WORD NumberDrives;
  254. } DISK_INT13_INFO,*PDISK_INT13_INFO;
  255. typedef struct _DISK_EX_INT13_INFO {
  256.   WORD ExBufferSize;
  257.   WORD ExFlags;
  258.   DWORD ExCylinders;
  259.   DWORD ExHeads;
  260.   DWORD ExSectorsPerTrack;
  261.   DWORD64 ExSectorsPerDrive;
  262.   WORD ExSectorSize;
  263.   WORD ExReserved;
  264. } DISK_EX_INT13_INFO,*PDISK_EX_INT13_INFO;
  265. typedef struct _DISK_DETECTION_INFO {
  266.   DWORD SizeOfDetectInfo;
  267.   DETECTION_TYPE DetectionType;
  268.   _ANONYMOUS_UNION union {
  269.     _ANONYMOUS_STRUCT struct {
  270.       DISK_INT13_INFO Int13;
  271.       DISK_EX_INT13_INFO ExInt13;
  272.     };
  273.   };
  274. } DISK_DETECTION_INFO,*PDISK_DETECTION_INFO;
  275. typedef enum _MEDIA_TYPE {
  276.   Unknown,
  277.   F5_1Pt2_512,
  278.   F3_1Pt44_512,
  279.   F3_2Pt88_512,
  280.   F3_20Pt8_512,
  281.   F3_720_512,
  282.   F5_360_512,
  283.   F5_320_512,
  284.   F5_320_1024,
  285.   F5_180_512,
  286.   F5_160_512,
  287.   RemovableMedia,
  288.   FixedMedia,
  289.   F3_120M_512,
  290.   F3_640_512,
  291.   F5_640_512,
  292.   F5_720_512,
  293.   F3_1Pt2_512,
  294.   F3_1Pt23_1024,
  295.   F5_1Pt23_1024,
  296.   F3_128Mb_512,
  297.   F3_230Mb_512,
  298.   F8_256_128,
  299.   F3_200Mb_512,
  300.   F3_240M_512,
  301.   F3_32M_512
  302. } MEDIA_TYPE,*PMEDIA_TYPE;
  303. typedef struct _DISK_GEOMETRY {
  304.   LARGE_INTEGER Cylinders;
  305.   MEDIA_TYPE MediaType;
  306.   DWORD TracksPerCylinder;
  307.   DWORD SectorsPerTrack;
  308.   DWORD BytesPerSector;
  309. } DISK_GEOMETRY,*PDISK_GEOMETRY;
  310. typedef struct _DISK_GEOMETRY_EX {
  311.   DISK_GEOMETRY Geometry;
  312.   LARGE_INTEGER DiskSize;
  313.   BYTE Data[1];
  314. } DISK_GEOMETRY_EX,*PDISK_GEOMETRY_EX;
  315. typedef struct _DISK_GROW_PARTITION {
  316.   DWORD PartitionNumber;
  317.   LARGE_INTEGER BytesToGrow;
  318. } DISK_GROW_PARTITION, *PDISK_GROW_PARTITION;
  319. typedef struct _DISK_PARTITION_INFO {
  320.   DWORD SizeOfPartitionInfo;
  321.   PARTITION_STYLE PartitionStyle;
  322.   _ANONYMOUS_UNION union {
  323.     struct {
  324.       DWORD Signature;
  325.     } Mbr;
  326.     struct {
  327.       GUID DiskId;
  328.     } Gpt;
  329.   };
  330. } DISK_PARTITION_INFO,*PDISK_PARTITION_INFO;
  331. typedef struct _DISK_PERFORMANCE {
  332.     LARGE_INTEGER BytesRead;
  333.     LARGE_INTEGER BytesWritten;
  334.     LARGE_INTEGER ReadTime;
  335.     LARGE_INTEGER WriteTime;
  336.     DWORD ReadCount;
  337.     DWORD WriteCount;
  338.     DWORD QueueDepth;
  339. } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
  340. typedef struct _DISK_RECORD {
  341.   LARGE_INTEGER ByteOffset;
  342.   LARGE_INTEGER StartTime;
  343.   LARGE_INTEGER EndTime;
  344.   PVOID VirtualAddress;
  345.   DWORD NumberOfBytes;
  346.   BYTE DeviceNumber;
  347.   BOOLEAN ReadRequest;
  348. } DISK_RECORD,*PDISK_RECORD;
  349. typedef struct _DISK_LOGGING {
  350.   BYTE Function;
  351.   PVOID BufferAddress;
  352.   DWORD BufferSize;
  353. } DISK_LOGGING,*PDISK_LOGGING;
  354. typedef struct DiskQuotaUserInformation {
  355.   LONGLONG QuotaUsed;
  356.   LONGLONG QuotaThreshold;
  357.   LONGLONG QuotaLimit;
  358. } DISKQUOTA_USER_INFORMATION,*PDISKQUOTA_USER_INFORMATION;
  359. typedef struct _FORMAT_PARAMETERS {
  360.   MEDIA_TYPE MediaType;
  361.   DWORD StartCylinderNumber;
  362.   DWORD EndCylinderNumber;
  363.   DWORD StartHeadNumber;
  364.   DWORD EndHeadNumber;
  365. } FORMAT_PARAMETERS,*PFORMAT_PARAMETERS;
  366. typedef struct _FORMAT_EX_PARAMETERS {
  367.   MEDIA_TYPE MediaType;
  368.   DWORD StartCylinderNumber;
  369.   DWORD EndCylinderNumber;
  370.   DWORD StartHeadNumber;
  371.   DWORD EndHeadNumber;
  372.   WORD FormatGapLength;
  373.   WORD SectorsPerTrack;
  374.   WORD SectorNumber[1];
  375. } FORMAT_EX_PARAMETERS,*PFORMAT_EX_PARAMETERS;
  376. typedef struct {
  377.   LARGE_INTEGER Length;
  378. } GET_LENGTH_INFORMATION;
  379. typedef struct _HISTOGRAM_BUCKET {
  380.   DWORD Reads;
  381.   DWORD Writes;
  382. } HISTOGRAM_BUCKET,*PHISTOGRAM_BUCKET;
  383. typedef struct _DISK_HISTOGRAM {
  384.   LARGE_INTEGER DiskSize;
  385.   LARGE_INTEGER Start;
  386.   LARGE_INTEGER End;
  387.   LARGE_INTEGER Average;
  388.   LARGE_INTEGER AverageRead;
  389.   LARGE_INTEGER AverageWrite;
  390.   DWORD Granularity;
  391.   DWORD Size;
  392.   DWORD ReadCount;
  393.   DWORD WriteCount;
  394.   PHISTOGRAM_BUCKET Histogram;
  395. } DISK_HISTOGRAM,*PDISK_HISTOGRAM;
  396. typedef struct _DISK_EXTENT {
  397.   DWORD DiskNumber;
  398.   LARGE_INTEGER StartingOffset;
  399.   LARGE_INTEGER ExtentLength;
  400. } DISK_EXTENT,*PDISK_EXTENT;
  401. typedef struct _VOLUME_DISK_EXTENTS {
  402.   DWORD NumberOfDiskExtents;
  403.   DISK_EXTENT Extents[1];
  404. } VOLUME_DISK_EXTENTS,*PVOLUME_DISK_EXTENTS;
  405. typedef struct _PARTITION_INFORMATION {
  406.   LARGE_INTEGER StartingOffset;
  407.   LARGE_INTEGER PartitionLength;
  408.   DWORD HiddenSectors;
  409.   DWORD PartitionNumber;
  410.   BYTE PartitionType;
  411.   BOOLEAN BootIndicator;
  412.   BOOLEAN RecognizedPartition;
  413.   BOOLEAN RewritePartition;
  414. } PARTITION_INFORMATION,*PPARTITION_INFORMATION;
  415. typedef struct _DRIVE_LAYOUT_INFORMATION {
  416.   DWORD PartitionCount;
  417.   DWORD Signature;
  418.   PARTITION_INFORMATION PartitionEntry[1];
  419. } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
  420. typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
  421.   GUID DiskId;
  422.   LARGE_INTEGER StartingUsableOffset;
  423.   LARGE_INTEGER UsableLength;
  424.   ULONG MaxPartitionCount;
  425. } DRIVE_LAYOUT_INFORMATION_GPT,*PDRIVE_LAYOUT_INFORMATION_GPT;
  426. typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
  427.   ULONG Signature;
  428. } DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
  429. typedef struct _PARTITION_INFORMATION_MBR {
  430.   BYTE PartitionType;
  431.   BOOLEAN BootIndicator;
  432.   BOOLEAN RecognizedPartition;
  433.   DWORD HiddenSectors;
  434. } PARTITION_INFORMATION_MBR;
  435. typedef struct _PARTITION_INFORMATION_GPT {
  436.   GUID PartitionType;
  437.   GUID PartitionId;
  438.   DWORD64 Attributes;
  439.   WCHAR Name[36];
  440. } PARTITION_INFORMATION_GPT;
  441. typedef struct _PARTITION_INFORMATION_EX {
  442.   PARTITION_STYLE PartitionStyle;
  443.   LARGE_INTEGER StartingOffset;
  444.   LARGE_INTEGER PartitionLength;
  445.   DWORD PartitionNumber;
  446.   BOOLEAN RewritePartition;
  447.   _ANONYMOUS_UNION union {
  448.     PARTITION_INFORMATION_MBR Mbr;
  449.     PARTITION_INFORMATION_GPT Gpt;
  450.   };
  451. } PARTITION_INFORMATION_EX;
  452. typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
  453.   DWORD PartitionStyle;
  454.   DWORD PartitionCount;
  455.   _ANONYMOUS_UNION union {
  456.     DRIVE_LAYOUT_INFORMATION_MBR Mbr;
  457.     DRIVE_LAYOUT_INFORMATION_GPT Gpt;
  458.   };
  459.   PARTITION_INFORMATION_EX PartitionEntry[1];
  460. } DRIVE_LAYOUT_INFORMATION_EX,*PDRIVE_LAYOUT_INFORMATION_EX;
  461. typedef struct {
  462.   HANDLE FileHandle;
  463.   LARGE_INTEGER StartingVcn;
  464.   LARGE_INTEGER StartingLcn;
  465.   DWORD ClusterCount;
  466. } MOVE_FILE_DATA,*PMOVE_FILE_DATA;
  467. typedef struct _PERF_BIN {
  468.   DWORD NumberOfBins;
  469.   DWORD TypeOfBin;
  470.   BIN_RANGE BinsRanges[1];
  471. } PERF_BIN,*PPERF_BIN;
  472. typedef struct _PREVENT_MEDIA_REMOVAL {
  473.   BOOLEAN PreventMediaRemoval;
  474. } PREVENT_MEDIA_REMOVAL,*PPREVENT_MEDIA_REMOVAL;
  475. typedef struct RETRIEVAL_POINTERS_BUFFER {
  476.   DWORD ExtentCount;
  477.   LARGE_INTEGER StartingVcn;
  478.   struct {
  479.     LARGE_INTEGER NextVcn;
  480.     LARGE_INTEGER Lcn;
  481.   } Extents[1];
  482. } RETRIEVAL_POINTERS_BUFFER,*PRETRIEVAL_POINTERS_BUFFER;
  483. typedef struct _REASSIGN_BLOCKS {
  484.   WORD Reserved;
  485.   WORD Count;
  486.   DWORD BlockNumber[1];
  487. } REASSIGN_BLOCKS,*PREASSIGN_BLOCKS;
  488. typedef struct _SET_PARTITION_INFORMATION {
  489.   BYTE PartitionType;
  490. } SET_PARTITION_INFORMATION,*PSET_PARTITION_INFORMATION;
  491. typedef struct {
  492.   LARGE_INTEGER StartingLcn;
  493. } STARTING_LCN_INPUT_BUFFER,*PSTARTING_LCN_INPUT_BUFFER;
  494. typedef struct {
  495.   LARGE_INTEGER StartingVcn;
  496. } STARTING_VCN_INPUT_BUFFER,*PSTARTING_VCN_INPUT_BUFFER;
  497. typedef struct _VERIFY_INFORMATION {
  498.   LARGE_INTEGER StartingOffset;
  499.   DWORD Length;
  500. } VERIFY_INFORMATION,*PVERIFY_INFORMATION;
  501. typedef struct {
  502.   LARGE_INTEGER StartingLcn;
  503.   LARGE_INTEGER BitmapSize;
  504.   BYTE Buffer[1];
  505. } VOLUME_BITMAP_BUFFER,*PVOLUME_BITMAP_BUFFER;
  506. typedef struct {
  507.   LARGE_INTEGER VolumeSerialNumber;
  508.   LARGE_INTEGER NumberSectors;
  509.   LARGE_INTEGER TotalClusters;
  510.   LARGE_INTEGER FreeClusters;
  511.   LARGE_INTEGER TotalReserved;
  512.   DWORD BytesPerSector;
  513.   DWORD BytesPerCluster;
  514.   DWORD BytesPerFileRecordSegment;
  515.   DWORD ClustersPerFileRecordSegment;
  516.   LARGE_INTEGER MftValidDataLength;
  517.   LARGE_INTEGER MftStartLcn;
  518.   LARGE_INTEGER Mft2StartLcn;
  519.   LARGE_INTEGER MftZoneStart;
  520.   LARGE_INTEGER MftZoneEnd;
  521. } NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
  522.  
  523. #define IsRecognizedPartition(t)\
  524.   (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
  525.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\
  526.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\
  527.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\
  528.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
  529.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
  530.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
  531.     ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
  532.     ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
  533.     ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
  534.     ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
  535.     ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
  536.     ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
  537.     ((t&~PARTITION_NTFT)==PARTITION_XINT13))
  538. #define IsContainerPartition(t)\
  539.   (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\
  540.     ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
  541.     ((t&~PARTITION_NTFT)==PARTITION_EXTENDED)||\
  542.     ((t&~PARTITION_NTFT)==PARTITION_XINT13_EXTENDED))
  543. #ifdef __cplusplus
  544. }
  545. #endif
  546. #endif
  547.