36#pragma warning(disable:4201)
37#pragma warning(disable:4820)
44#define DEVICE_TYPE DWORD
46#define FILE_DEVICE_BEEP 1
47#define FILE_DEVICE_CD_ROM 2
48#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 3
49#define FILE_DEVICE_CONTROLLER 4
50#define FILE_DEVICE_DATALINK 5
51#define FILE_DEVICE_DFS 6
52#define FILE_DEVICE_DISK 7
53#define FILE_DEVICE_DISK_FILE_SYSTEM 8
54#define FILE_DEVICE_FILE_SYSTEM 9
55#define FILE_DEVICE_INPORT_PORT 10
56#define FILE_DEVICE_KEYBOARD 11
57#define FILE_DEVICE_MAILSLOT 12
58#define FILE_DEVICE_MIDI_IN 13
59#define FILE_DEVICE_MIDI_OUT 14
60#define FILE_DEVICE_MOUSE 15
61#define FILE_DEVICE_MULTI_UNC_PROVIDER 16
62#define FILE_DEVICE_NAMED_PIPE 17
63#define FILE_DEVICE_NETWORK 18
64#define FILE_DEVICE_NETWORK_BROWSER 19
65#define FILE_DEVICE_NETWORK_FILE_SYSTEM 20
66#define FILE_DEVICE_NULL 21
67#define FILE_DEVICE_PARALLEL_PORT 22
68#define FILE_DEVICE_PHYSICAL_NETCARD 23
69#define FILE_DEVICE_PRINTER 24
70#define FILE_DEVICE_SCANNER 25
71#define FILE_DEVICE_SERIAL_MOUSE_PORT 26
72#define FILE_DEVICE_SERIAL_PORT 27
73#define FILE_DEVICE_SCREEN 28
74#define FILE_DEVICE_SOUND 29
75#define FILE_DEVICE_STREAMS 30
76#define FILE_DEVICE_TAPE 31
77#define FILE_DEVICE_TAPE_FILE_SYSTEM 32
78#define FILE_DEVICE_TRANSPORT 33
79#define FILE_DEVICE_UNKNOWN 34
80#define FILE_DEVICE_VIDEO 35
81#define FILE_DEVICE_VIRTUAL_DISK 36
82#define FILE_DEVICE_WAVE_IN 37
83#define FILE_DEVICE_WAVE_OUT 38
84#define FILE_DEVICE_8042_PORT 39
85#define FILE_DEVICE_NETWORK_REDIRECTOR 40
86#define FILE_DEVICE_BATTERY 41
87#define FILE_DEVICE_BUS_EXTENDER 42
88#define FILE_DEVICE_MODEM 43
89#define FILE_DEVICE_VDM 44
90#define FILE_DEVICE_MASS_STORAGE 45
91#define FILE_DEVICE_SMB 46
92#define FILE_DEVICE_KS 47
93#define FILE_DEVICE_CHANGER 48
94#define FILE_DEVICE_SMARTCARD 49
95#define FILE_DEVICE_ACPI 50
96#define FILE_DEVICE_DVD 51
97#define FILE_DEVICE_FULLSCREEN_VIDEO 52
98#define FILE_DEVICE_DFS_FILE_SYSTEM 53
99#define FILE_DEVICE_DFS_VOLUME 54
100#define FILE_DEVICE_SERENUM 55
101#define FILE_DEVICE_TERMSRV 56
102#define FILE_DEVICE_KSEC 57
103#define FILE_DEVICE_FIPS 58
104#define FILE_DEVICE_INFINIBAND 59
105#define FILE_DEVICE_VMBUS 62
106#define FILE_DEVICE_CRYPT_PROVIDER 63
107#define FILE_DEVICE_WPD 64
108#define FILE_DEVICE_BLUETOOTH 65
109#define FILE_DEVICE_MT_COMPOSITE 66
110#define FILE_DEVICE_MT_TRANSPORT 67
111#define FILE_DEVICE_BIOMETRIC 68
112#define FILE_DEVICE_PMI 69
113#define FILE_DEVICE_EHSTOR 70
114#define FILE_DEVICE_DEVAPI 71
115#define FILE_DEVICE_GPIO 72
116#define FILE_DEVICE_USBEX 73
117#define FILE_DEVICE_CONSOLE 80
118#define FILE_DEVICE_NFP 81
119#define FILE_DEVICE_SYSENV 82
120#define FILE_DEVICE_VIRTUAL_BLOCK 83
121#define FILE_DEVICE_POINT_OF_SERVICE 84
122#define FILE_DEVICE_STORAGE_REPLICATION 85
123#define FILE_DEVICE_TRUST_ENV 86
124#define FILE_DEVICE_UCM 87
125#define FILE_DEVICE_UCMTCPCI 88
126#define FILE_DEVICE_PERSISTENT_MEMORY 89
127#define FILE_DEVICE_NVDIMM 90
128#define FILE_DEVICE_HOLOGRAPHIC 91
129#define FILE_DEVICE_SDFXHCI 92
130#define FILE_DEVICE_UCMUCSI 93
133#define FILE_ANY_ACCESS 0x00000000
134#define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS
135#define FILE_READ_ACCESS 0x00000001
136#define FILE_WRITE_ACCESS 0x00000002
138#define METHOD_BUFFERED 0
139#define METHOD_IN_DIRECT 1
140#define METHOD_OUT_DIRECT 2
141#define METHOD_NEITHER 3
143#define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
144#define DEVICE_TYPE_FROM_CTL_CODE(c) (((DWORD)((c)&0xffff0000))>>16)
151#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
152#define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
153#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
154#define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
155#define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
156#define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
157#define IOCTL_STORAGE_LOAD_MEDIA2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
158#define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
159#define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
160#define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
161#define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
162#define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
163#define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
164#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
165#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
166#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
167#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
168#define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
179#define IOCTL_DISK_BASE FILE_DEVICE_DISK
180#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE,0,METHOD_BUFFERED, FILE_ANY_ACCESS)
181#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,1,METHOD_BUFFERED,FILE_READ_ACCESS)
182#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,2,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
183#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,3,METHOD_BUFFERED,FILE_READ_ACCESS)
184#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,4,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
185#define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE,5,METHOD_BUFFERED,FILE_ANY_ACCESS)
186#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE,6,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
187#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE,7,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
188#define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
189#define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE,9,METHOD_BUFFERED,FILE_ANY_ACCESS)
190#define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE,10,METHOD_BUFFERED,FILE_ANY_ACCESS)
191#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE,11,METHOD_BUFFERED,FILE_READ_ACCESS|FILE_WRITE_ACCESS)
192#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,12,METHOD_BUFFERED,FILE_ANY_ACCESS)
193#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
194#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE,14,METHOD_BUFFERED,FILE_ANY_ACCESS)
195#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
196#define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE,16,METHOD_BUFFERED,FILE_ANY_ACCESS)
197#define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x12,METHOD_BUFFERED,FILE_ANY_ACCESS)
198#define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE,0x13,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
199#define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x14,METHOD_BUFFERED,FILE_ANY_ACCESS)
200#define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE,0x15,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
201#define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE,0x16,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
202#define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE,0x17,METHOD_BUFFERED,FILE_READ_ACCESS)
203#define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE,0x18,METHOD_BUFFERED,FILE_ANY_ACCESS)
204#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE,0x28,METHOD_BUFFERED,FILE_ANY_ACCESS)
205#define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE,0x34,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
206#define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x35,METHOD_BUFFERED,FILE_READ_ACCESS)
207#define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE,0x36,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
208#define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE,0x40,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
209#define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE,0x50,METHOD_BUFFERED,FILE_ANY_ACCESS)
210#define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE,0x200,METHOD_BUFFERED,FILE_READ_ACCESS)
211#define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE,0x201,METHOD_BUFFERED,FILE_READ_ACCESS)
212#define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x202,METHOD_BUFFERED,FILE_READ_ACCESS)
213#define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE,0x203,METHOD_BUFFERED,FILE_READ_ACCESS)
214#define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE,0x204,METHOD_BUFFERED,FILE_READ_ACCESS)
215#define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE,0x205,METHOD_BUFFERED,FILE_READ_ACCESS)
216#define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE,0x206,METHOD_BUFFERED,FILE_READ_ACCESS)
217#define IOCTL_DISK_REMOVE_DEVICE CTL_CODE(IOCTL_DISK_BASE,0x207,METHOD_BUFFERED,FILE_READ_ACCESS)
218#define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE,0x300,METHOD_BUFFERED,FILE_ANY_ACCESS)
219#define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
222#define PARTITION_ENTRY_UNUSED 0x00
223#define PARTITION_FAT_12 0x01
224#define PARTITION_XENIX_1 0x02
225#define PARTITION_XENIX_2 0x03
226#define PARTITION_FAT_16 0x04
227#define PARTITION_EXTENDED 0x05
228#define PARTITION_HUGE 0x06
229#define PARTITION_IFS 0x07
230#define PARTITION_OS2BOOTMGR 0x0A
231#define PARTITION_FAT32 0x0B
232#define PARTITION_FAT32_XINT13 0x0C
233#define PARTITION_XINT13 0x0E
234#define PARTITION_XINT13_EXTENDED 0x0F
235#define PARTITION_MSFT_RECOVERY 0x27
236#define PARTITION_MAIN_OS 0x28
237#define PARTIITON_OS_DATA 0x29
238#define PARTITION_PRE_INSTALLED 0x2a
239#define PARTITION_BSP 0x2b
240#define PARTITION_DPP 0x2c
241#define PARTITION_WINDOWS_SYSTEM 0x2d
242#define PARTITION_PREP 0x41
243#define PARTITION_LDM 0x42
244#define PARTITION_DM 0x54
245#define PARTITION_EZDRIVE 0x55
246#define PARTITION_UNIX 0x63
247#define PARTITION_SPACES_DATA 0xD7
248#define PARTITION_SPACES 0xE7
249#define PARTITION_GPT 0xEE
250#define PARTITION_SYSTEM 0xEF
252#define VALID_NTFT 0xC0
253#define PARTITION_NTFT 0x80
256#define PARTITION_OLD_LINUX 0x43
257#define PARTITION_LINUX 0x83
258#define PARTITION_ISO9660 0x96
259#define PARTITION_FREEBSD 0xA5
260#define PARTITION_OPENBSD 0xA6
261#define PARTITION_NETBSD 0xA9
271#define IsFTPartition(PartitionType) \
272 ( ((PartitionType) & PARTITION_NTFT) && ((((PartitionType) & ~VALID_NTFT) == PARTITION_HUGE) || \
273 (((PartitionType) & ~VALID_NTFT) == PARTITION_IFS) || \
274 (((PartitionType) & ~VALID_NTFT) == PARTITION_FAT32) || \
275 (((PartitionType) & ~VALID_NTFT) == PARTITION_FAT32_XINT13)) )
277#define IsContainerPartition(PartitionType) \
278 ( ((PartitionType) == PARTITION_EXTENDED) || \
279 ((PartitionType) == PARTITION_XINT13_EXTENDED) )
282#define IsRecognizedPartition(PartitionType) \
283 ( IsFTPartition(PartitionType) || \
284 ((PartitionType) == PARTITION_FAT_12) || \
285 ((PartitionType) == PARTITION_FAT_16) || \
286 ((PartitionType) == PARTITION_HUGE) || \
287 ((PartitionType) == PARTITION_IFS) || \
288 ((PartitionType) == PARTITION_FAT32) || \
289 ((PartitionType) == PARTITION_FAT32_XINT13) || \
290 ((PartitionType) == PARTITION_XINT13) || \
291 ((PartitionType) == PARTITION_LINUX) || \
292 ((PartitionType) == PARTITION_OLD_LINUX) || \
293 ((PartitionType) == PARTITION_ISO9660) || \
294 ((PartitionType) == PARTITION_FREEBSD) || \
295 ((PartitionType) == PARTITION_OPENBSD) || \
296 ((PartitionType) == PARTITION_NETBSD) )
298#define IsRecognizedPartition(PartitionType) \
299 ( IsFTPartition(PartitionType) || \
300 ((PartitionType) == PARTITION_FAT_12) || \
301 ((PartitionType) == PARTITION_FAT_16) || \
302 ((PartitionType) == PARTITION_HUGE) || \
303 ((PartitionType) == PARTITION_IFS) || \
304 ((PartitionType) == PARTITION_FAT32) || \
305 ((PartitionType) == PARTITION_FAT32_XINT13) || \
306 ((PartitionType) == PARTITION_XINT13) )
310#define DISK_LOGGING_START 0
311#define DISK_LOGGING_STOP 1
312#define DISK_LOGGING_DUMP 2
313#define DISK_BINNING 3
387#if (_WIN32_WINNT >= 0x0500)
397typedef struct _CREATE_DISK_GPT {
399 DWORD MaxPartitionCount;
400} CREATE_DISK_GPT, *PCREATE_DISK_GPT;
401typedef struct _CREATE_DISK_MBR {
403} CREATE_DISK_MBR, *PCREATE_DISK_MBR;
404typedef struct _CREATE_DISK {
410} CREATE_DISK, *PCREATE_DISK;
412typedef enum _DETECTION_TYPE {
417typedef struct _DISK_INT13_INFO {
423} DISK_INT13_INFO, *PDISK_INT13_INFO;
424typedef struct _DISK_EX_INT13_INFO {
429 DWORD ExSectorsPerTrack;
433} DISK_EX_INT13_INFO, *PDISK_EX_INT13_INFO;
434typedef struct _DISK_DETECTION_INFO {
435 DWORD SizeOfDetectInfo;
436 DETECTION_TYPE DetectionType;
439 DISK_INT13_INFO Int13;
440 DISK_EX_INT13_INFO ExInt13;
443} DISK_DETECTION_INFO, *PDISK_DETECTION_INFO;
444typedef struct _DISK_PARTITION_INFO {
445 DWORD SizeOfPartitionInfo;
456} DISK_PARTITION_INFO, *PDISK_PARTITION_INFO;
463#if (NTDDI_VERSION < NTDDI_WS03)
464#define DiskGeometryGetPartition(Geometry) \
465 ((PDISK_PARTITION_INFO)((Geometry) + 1))
467#define DiskGeometryGetDetect(Geometry)\
468 ((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry) + \
469 DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
471#define DiskGeometryGetPartition(Geometry) \
472 ((PDISK_PARTITION_INFO)((Geometry)->Data))
474#define DiskGeometryGetDetect(Geometry)\
475 ((PDISK_DETECTION_INFO)(((ULONG_PTR)DiskGeometryGetPartition(Geometry) + \
476 DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
497#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
506typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
510 DWORD MaxPartitionCount;
511} DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT;
512typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
514#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
517} DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
518typedef struct _DRIVE_LAYOUT_INFORMATION_EX {
519 DWORD PartitionStyle;
520 DWORD PartitionCount;
522 DRIVE_LAYOUT_INFORMATION_MBR Mbr;
523 DRIVE_LAYOUT_INFORMATION_GPT Gpt;
526} DRIVE_LAYOUT_INFORMATION_EX, *PDRIVE_LAYOUT_INFORMATION_EX;
531typedef struct _SET_PARTITION_INFORMATION_EX {
534 SET_PARTITION_INFORMATION_MBR Mbr;
535 SET_PARTITION_INFORMATION_GPT Gpt;
537} SET_PARTITION_INFORMATION_EX, *PSET_PARTITION_INFORMATION_EX;
627#define HIST_NO_OF_BUCKETS 24
628#define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
629#define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
674DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0x86E0D1E0L, 0x8089,
675 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73);
676DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325,
677 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
680#define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT
681#define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
685#define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
687#define SERIAL_LSRMST_ESCAPE 0
688#define SERIAL_LSRMST_LSR_DATA 1
689#define SERIAL_LSRMST_LSR_NODATA 2
690#define SERIAL_LSRMST_MST 3
697#define IOCTL_VOLUME_BASE ((DWORD)'V')
699#if (NTDDI_VERSION >= NTDDI_WIN2K)
700#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
712#define IOCTL_VOLUME_ONLINE CTL_CODE(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
713#define IOCTL_VOLUME_OFFLINE CTL_CODE(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
716#if (NTDDI_VERSION >= NTDDI_WINXP)
717#define IOCTL_VOLUME_IS_CLUSTERED \
718 CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
719#define IOCTL_VOLUME_GET_GPT_ATTRIBUTES \
720 CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
729#ifndef _FILESYSTEMFSCTL_
730#define _FILESYSTEMFSCTL_
732#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,6,METHOD_BUFFERED,FILE_ANY_ACCESS)
733#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,7,METHOD_BUFFERED,FILE_ANY_ACCESS)
734#define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
735#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS)
736#define FSCTL_MOUNT_DBLS_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13,METHOD_BUFFERED,FILE_ANY_ACCESS)
737#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15,METHOD_BUFFERED,FILE_ANY_ACCESS)
738#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16,METHOD_BUFFERED,FILE_READ_DATA|FILE_WRITE_DATA)
739#define FSCTL_READ_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,17,METHOD_NEITHER,FILE_READ_DATA)
740#define FSCTL_WRITE_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,18,METHOD_NEITHER,FILE_WRITE_DATA)
741#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM,25,METHOD_BUFFERED,FILE_ANY_ACCESS)
742#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM,26,METHOD_BUFFERED,FILE_ANY_ACCESS)
743#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM,27,METHOD_NEITHER,FILE_ANY_ACCESS)
744#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM,28,METHOD_NEITHER,FILE_ANY_ACCESS)
745#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM,29,METHOD_BUFFERED,FILE_ANY_ACCESS)
746#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
747#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS)
748#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_ANY_ACCESS)
749#define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
751#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
752#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
754#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
755#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
758#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
759#define FSCTL_GET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS)
760#define FSCTL_SET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
763#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
764#define FSCTL_DUPLICATE_EXTENTS_TO_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_DATA)
767#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
768#define VOLUME_IS_DIRTY (0x00000001)
769#define VOLUME_UPGRADE_SCHEDULED (0x00000002)
770#define VOLUME_SESSION_OPEN (0x00000004)
848#define FILESYSTEM_STATISTICS_TYPE_NTFS 1
849#define FILESYSTEM_STATISTICS_TYPE_FAT 2
850#define FILESYSTEM_STATISTICS_TYPE_EXFAT 3
954#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
970#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
static const WCHAR Signature[]
unsigned long long DWORDLONG
struct _PARTITION_INFORMATION_MBR * PPARTITION_INFORMATION_MBR
struct _PARTITION_INFORMATION_EX PARTITION_INFORMATION_EX
enum _PARTITION_STYLE PARTITION_STYLE
struct _PARTITION_INFORMATION_EX * PPARTITION_INFORMATION_EX
struct _PARTITION_INFORMATION_MBR PARTITION_INFORMATION_MBR
struct _PARTITION_INFORMATION_GPT * PPARTITION_INFORMATION_GPT
struct _PARTITION_INFORMATION_GPT PARTITION_INFORMATION_GPT
#define _ANONYMOUS_STRUCT
enum _MEDIA_TYPE MEDIA_TYPE
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
struct _DRIVE_LAYOUT_INFORMATION * PDRIVE_LAYOUT_INFORMATION
struct _FORMAT_EX_PARAMETERS FORMAT_EX_PARAMETERS
struct RETRIEVAL_POINTERS_BUFFER RETRIEVAL_POINTERS_BUFFER
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER
struct _GET_LENGTH_INFORMATION * PGET_LENGTH_INFORMATION
struct NTFS_VOLUME_DATA_BUFFER * PNTFS_VOLUME_DATA_BUFFER
struct _FAT_STATISTICS * PFAT_STATISTICS
struct _FORMAT_EX_PARAMETERS * PFORMAT_EX_PARAMETERS
struct STARTING_LCN_INPUT_BUFFER * PSTARTING_LCN_INPUT_BUFFER
struct _DISK_LOGGING * PDISK_LOGGING
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER
struct _BIN_RESULTS BIN_RESULTS
struct _GET_LENGTH_INFORMATION GET_LENGTH_INFORMATION
struct _BIN_RESULTS * PBIN_RESULTS
struct VOLUME_BITMAP_BUFFER * PVOLUME_BITMAP_BUFFER
struct DiskQuotaUserInformation DISKQUOTA_USER_INFORMATION
struct _DISK_RECORD * PDISK_RECORD
struct _VOLUME_DISK_EXTENTS * PVOLUME_DISK_EXTENTS
struct STARTING_VCN_INPUT_BUFFER * PSTARTING_VCN_INPUT_BUFFER
struct NTFS_EXTENDED_VOLUME_DATA * PNTFS_EXTENDED_VOLUME_DATA
DISK_CACHE_RETENTION_PRIORITY
struct MOVE_FILE_DATA * PMOVE_FILE_DATA
struct _BIN_COUNT * PBIN_COUNT
struct _FORMAT_PARAMETERS FORMAT_PARAMETERS
struct DiskQuotaUserInformation * PDISKQUOTA_USER_INFORMATION
struct RETRIEVAL_POINTERS_BUFFER * PRETRIEVAL_POINTERS_BUFFER
struct _FILESYSTEM_STATISTICS * PFILESYSTEM_STATISTICS
struct _EXFAT_STATISTICS EXFAT_STATISTICS
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER FSCTL_GET_INTEGRITY_INFORMATION_BUFFER
struct _EXFAT_STATISTICS * PEXFAT_STATISTICS
struct _PREVENT_MEDIA_REMOVAL * PPREVENT_MEDIA_REMOVAL
struct _HISTOGRAM_BUCKET * PHISTOGRAM_BUCKET
struct _FORMAT_PARAMETERS * PFORMAT_PARAMETERS
struct _DISK_CACHE_INFORMATION DISK_CACHE_INFORMATION
struct _BIN_RANGE * PBIN_RANGE
struct _FILESYSTEM_STATISTICS FILESYSTEM_STATISTICS
struct _VOLUME_DISK_EXTENTS VOLUME_DISK_EXTENTS
struct NTFS_FILE_RECORD_OUTPUT_BUFFER * PNTFS_FILE_RECORD_OUTPUT_BUFFER
struct _DISK_EXTENT DISK_EXTENT
struct _DISK_PERFORMANCE * PDISK_PERFORMANCE
struct _HISTOGRAM_BUCKET HISTOGRAM_BUCKET
struct _DISK_LOGGING DISK_LOGGING
enum _BIN_TYPES BIN_TYPES
struct _DISK_GEOMETRY DISK_GEOMETRY
struct _PREVENT_MEDIA_REMOVAL PREVENT_MEDIA_REMOVAL
struct _DISK_GROW_PARTITION * PDISK_GROW_PARTITION
struct _REASSIGN_BLOCKS * PREASSIGN_BLOCKS
struct _DISK_RECORD DISK_RECORD
struct _DISK_GROW_PARTITION DISK_GROW_PARTITION
struct _PARTITION_INFORMATION PARTITION_INFORMATION
enum _MEDIA_TYPE MEDIA_TYPE
struct _BIN_RANGE BIN_RANGE
enum _MEDIA_TYPE * PMEDIA_TYPE
struct _SET_PARTITION_INFORMATION * PSET_PARTITION_INFORMATION
struct _BIN_COUNT BIN_COUNT
struct _VERIFY_INFORMATION * PVERIFY_INFORMATION
struct _PARTITION_INFORMATION * PPARTITION_INFORMATION
struct _DISK_HISTOGRAM * PDISK_HISTOGRAM
struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION * PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION
struct _NTFS_STATISTICS NTFS_STATISTICS
struct _REASSIGN_BLOCKS REASSIGN_BLOCKS
struct _DISK_CACHE_INFORMATION * PDISK_CACHE_INFORMATION
struct _FAT_STATISTICS FAT_STATISTICS
struct _DISK_PERFORMANCE DISK_PERFORMANCE
struct _DRIVE_LAYOUT_INFORMATION DRIVE_LAYOUT_INFORMATION
struct _PERF_BIN * PPERF_BIN
struct _DUPLICATE_EXTENTS_DATA DUPLICATE_EXTENTS_DATA
struct _DISK_EXTENT * PDISK_EXTENT
struct _DUPLICATE_EXTENTS_DATA * PDUPLICATE_EXTENTS_DATA
struct NTFS_FILE_RECORD_INPUT_BUFFER * PNTFS_FILE_RECORD_INPUT_BUFFER
struct _SET_PARTITION_INFORMATION SET_PARTITION_INFORMATION
struct _NTFS_STATISTICS * PNTFS_STATISTICS
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER FSCTL_SET_INTEGRITY_INFORMATION_BUFFER
struct _PERF_BIN PERF_BIN
struct _DISK_HISTOGRAM DISK_HISTOGRAM
struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
struct _DISK_GEOMETRY * PDISK_GEOMETRY
struct _VERIFY_INFORMATION VERIFY_INFORMATION
struct _DISK_GEOMETRY_EX * PDISK_GEOMETRY_EX
struct _DISK_GEOMETRY_EX DISK_GEOMETRY_EX
LARGE_INTEGER StartingLcn
LARGE_INTEGER StartingVcn
LARGE_INTEGER FileReferenceNumber
LARGE_INTEGER NumberSectors
LARGE_INTEGER MftValidDataLength
LARGE_INTEGER TotalReserved
LARGE_INTEGER Mft2StartLcn
LARGE_INTEGER FreeClusters
DWORD BytesPerFileRecordSegment
LARGE_INTEGER MftZoneStart
DWORD ClustersPerFileRecordSegment
LARGE_INTEGER TotalClusters
LARGE_INTEGER VolumeSerialNumber
LARGE_INTEGER MftStartLcn
struct RETRIEVAL_POINTERS_BUFFER::@3323 Extents[1]
LARGE_INTEGER StartingVcn
LARGE_INTEGER StartingLcn
LARGE_INTEGER StartingOffset
LARGE_INTEGER ExtentLength
LARGE_INTEGER BytesToGrow
LARGE_INTEGER AverageWrite
PHISTOGRAM_BUCKET Histogram
LARGE_INTEGER AverageRead
LARGE_INTEGER SourceFileOffset
LARGE_INTEGER TargetFileOffset
ULONG NonCachedWriteBytes
ULONG NonCachedDiskWrites
ULONG NonCachedDiskWrites
ULONG NonCachedWriteBytes
ULONG SizeOfCompleteStructure
struct _NTFS_STATISTICS::@3324 MftWritesUserLevel
USHORT MftWritesLazyWriter
USHORT Mft2WritesFlushForLogFileFull
USHORT Mft2WritesUserRequest
USHORT BitmapWritesUserRequest
ULONG RootIndexWriteBytes
USHORT BitmapWritesFlushForLogFileFull
USHORT MftWritesUserRequest
struct _NTFS_STATISTICS::@3327 MftBitmapWritesUserLevel
struct _NTFS_STATISTICS::@3328 Allocate
ULONG UserIndexWriteBytes
ULONG LogFileFullExceptions
struct _NTFS_STATISTICS::@3326 BitmapWritesUserLevel
USHORT MftBitmapWritesFlushForLogFileFull
struct _NTFS_STATISTICS::@3325 Mft2WritesUserLevel
ULONG MftBitmapWriteBytes
USHORT MftBitmapWritesUserRequest
USHORT BitmapWritesLazyWriter
USHORT MftBitmapWritesLazyWriter
USHORT MftWritesFlushForLogFileFull
USHORT Mft2WritesLazyWriter
DWORD NumberOfDiskExtents
_In_ ULONG _In_ ULONG SectorsPerTrack