Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

576 lines
20 KiB

  1. /*++ BUILD Version: 0012 // Increment this if a change has global effects
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. winioctl.h
  5. Abstract:
  6. This module defines the 32-Bit Windows Device I/O control codes.
  7. Revision History:
  8. --*/
  9. #ifndef _WINIOCTL_
  10. #define _WINIOCTL_
  11. #ifndef _DEVIOCTL_
  12. #define _DEVIOCTL_
  13. // begin_ntddk begin_nthal begin_ntifs
  14. //
  15. // Define the various device type values. Note that values used by Microsoft
  16. // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
  17. // by customers.
  18. //
  19. #define DEVICE_TYPE DWORD
  20. #define FILE_DEVICE_BEEP 0x00000001
  21. #define FILE_DEVICE_CD_ROM 0x00000002
  22. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
  23. #define FILE_DEVICE_CONTROLLER 0x00000004
  24. #define FILE_DEVICE_DATALINK 0x00000005
  25. #define FILE_DEVICE_DFS 0x00000006
  26. #define FILE_DEVICE_DISK 0x00000007
  27. #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
  28. #define FILE_DEVICE_FILE_SYSTEM 0x00000009
  29. #define FILE_DEVICE_INPORT_PORT 0x0000000a
  30. #define FILE_DEVICE_KEYBOARD 0x0000000b
  31. #define FILE_DEVICE_MAILSLOT 0x0000000c
  32. #define FILE_DEVICE_MIDI_IN 0x0000000d
  33. #define FILE_DEVICE_MIDI_OUT 0x0000000e
  34. #define FILE_DEVICE_MOUSE 0x0000000f
  35. #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
  36. #define FILE_DEVICE_NAMED_PIPE 0x00000011
  37. #define FILE_DEVICE_NETWORK 0x00000012
  38. #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
  39. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  40. #define FILE_DEVICE_NULL 0x00000015
  41. #define FILE_DEVICE_PARALLEL_PORT 0x00000016
  42. #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
  43. #define FILE_DEVICE_PRINTER 0x00000018
  44. #define FILE_DEVICE_SCANNER 0x00000019
  45. #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
  46. #define FILE_DEVICE_SERIAL_PORT 0x0000001b
  47. #define FILE_DEVICE_SCREEN 0x0000001c
  48. #define FILE_DEVICE_SOUND 0x0000001d
  49. #define FILE_DEVICE_STREAMS 0x0000001e
  50. #define FILE_DEVICE_TAPE 0x0000001f
  51. #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
  52. #define FILE_DEVICE_TRANSPORT 0x00000021
  53. #define FILE_DEVICE_UNKNOWN 0x00000022
  54. #define FILE_DEVICE_VIDEO 0x00000023
  55. #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
  56. #define FILE_DEVICE_WAVE_IN 0x00000025
  57. #define FILE_DEVICE_WAVE_OUT 0x00000026
  58. #define FILE_DEVICE_8042_PORT 0x00000027
  59. #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
  60. #define FILE_DEVICE_BATTERY 0x00000029
  61. #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
  62. //
  63. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  64. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  65. // 2048-4095 are reserved for customers.
  66. //
  67. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  68. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  69. )
  70. //
  71. // Define the method codes for how buffers are passed for I/O and FS controls
  72. //
  73. #define METHOD_BUFFERED 0
  74. #define METHOD_IN_DIRECT 1
  75. #define METHOD_OUT_DIRECT 2
  76. #define METHOD_NEITHER 3
  77. //
  78. // Define the access check value for any access
  79. //
  80. //
  81. // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
  82. // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
  83. // constants *MUST* always be in sync.
  84. //
  85. #define FILE_ANY_ACCESS 0
  86. #define FILE_READ_ACCESS ( 0x0001 ) // file & pipe
  87. #define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe
  88. // end_ntddk end_nthal end_ntifs
  89. #endif // _DEVIOCTL_
  90. //
  91. // IoControlCode values for disk devices.
  92. //
  93. #define IOCTL_DISK_BASE FILE_DEVICE_DISK
  94. #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
  95. #define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  96. #define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  97. #define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
  98. #define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  99. #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
  100. #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  101. #define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  102. #define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
  103. #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
  104. #define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  105. #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  106. #define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  107. #define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  108. #define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  109. #define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
  110. #define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
  111. //
  112. // The following device control codes are common for all class drivers. The
  113. // functions codes defined here must match all of the other class drivers.
  114. //
  115. #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
  116. #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
  117. #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
  118. #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
  119. #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
  120. #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
  121. #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
  122. #define IOCTL_DISK_REMOVE_DEVICE CTL_CODE(IOCTL_DISK_BASE, 0x0207, METHOD_BUFFERED, FILE_READ_ACCESS)
  123. #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
  124. //
  125. // Define the partition types returnable by known disk drivers.
  126. //
  127. #define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
  128. #define PARTITION_FAT_12 0x01 // 12-bit FAT entries
  129. #define PARTITION_XENIX_1 0x02 // Xenix
  130. #define PARTITION_XENIX_2 0x03 // Xenix
  131. #define PARTITION_FAT_16 0x04 // 16-bit FAT entries
  132. #define PARTITION_EXTENDED 0x05 // Extended partition entry
  133. #define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
  134. #define PARTITION_IFS 0x07 // IFS Partition
  135. #define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
  136. #define PARTITION_UNIX 0x63 // Unix
  137. #define VALID_NTFT 0xC0 // NTFT uses high order bits
  138. //
  139. // The high bit of the partition type code indicates that a partition
  140. // is part of an NTFT mirror or striped array.
  141. //
  142. #define PARTITION_NTFT 0x80 // NTFT partition
  143. //
  144. // The following macro is used to determine which partitions should be
  145. // assigned drive letters.
  146. //
  147. //++
  148. //
  149. // BOOLEAN
  150. // IsRecognizedPartition(
  151. // IN DWORD PartitionType
  152. // )
  153. //
  154. // Routine Description:
  155. //
  156. // This macro is used to determine to which partitions drive letters
  157. // should be assigned.
  158. //
  159. // Arguments:
  160. //
  161. // PartitionType - Supplies the type of the partition being examined.
  162. //
  163. // Return Value:
  164. //
  165. // The return value is TRUE if the partition type is recognized,
  166. // otherwise FALSE is returned.
  167. //
  168. //--
  169. #define IsRecognizedPartition( PartitionType ) ( \
  170. ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT_12)) || \
  171. ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT_16)) || \
  172. ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_IFS)) || \
  173. ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_HUGE)) || \
  174. ((PartitionType & ~PARTITION_NTFT) == PARTITION_FAT_12) || \
  175. ((PartitionType & ~PARTITION_NTFT) == PARTITION_FAT_16) || \
  176. ((PartitionType & ~PARTITION_NTFT) == PARTITION_IFS) || \
  177. ((PartitionType & ~PARTITION_NTFT) == PARTITION_HUGE) )
  178. //
  179. // Define the media types supported by the driver.
  180. //
  181. typedef enum _MEDIA_TYPE {
  182. Unknown, // Format is unknown
  183. F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
  184. F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
  185. F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
  186. F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
  187. F3_720_512, // 3.5", 720KB, 512 bytes/sector
  188. F5_360_512, // 5.25", 360KB, 512 bytes/sector
  189. F5_320_512, // 5.25", 320KB, 512 bytes/sector
  190. F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
  191. F5_180_512, // 5.25", 180KB, 512 bytes/sector
  192. F5_160_512, // 5.25", 160KB, 512 bytes/sector
  193. RemovableMedia, // Removable media other than floppy
  194. FixedMedia // Fixed hard disk media
  195. } MEDIA_TYPE, *PMEDIA_TYPE;
  196. //
  197. // Define the input buffer structure for the driver, when
  198. // it is called with IOCTL_DISK_FORMAT_TRACKS.
  199. //
  200. typedef struct _FORMAT_PARAMETERS {
  201. MEDIA_TYPE MediaType;
  202. DWORD StartCylinderNumber;
  203. DWORD EndCylinderNumber;
  204. DWORD StartHeadNumber;
  205. DWORD EndHeadNumber;
  206. } FORMAT_PARAMETERS, *PFORMAT_PARAMETERS;
  207. //
  208. // Define the BAD_TRACK_NUMBER type. An array of elements of this type is
  209. // returned by the driver on IOCTL_DISK_FORMAT_TRACKS requests, to indicate
  210. // what tracks were bad during formatting. The length of that array is
  211. // reported in the `Information' field of the I/O Status Block.
  212. //
  213. typedef WORD BAD_TRACK_NUMBER;
  214. typedef WORD *PBAD_TRACK_NUMBER;
  215. //
  216. // Define the input buffer structure for the driver, when
  217. // it is called with IOCTL_DISK_FORMAT_TRACKS_EX.
  218. //
  219. typedef struct _FORMAT_EX_PARAMETERS {
  220. MEDIA_TYPE MediaType;
  221. DWORD StartCylinderNumber;
  222. DWORD EndCylinderNumber;
  223. DWORD StartHeadNumber;
  224. DWORD EndHeadNumber;
  225. WORD FormatGapLength;
  226. WORD SectorsPerTrack;
  227. WORD SectorNumber[1];
  228. } FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS;
  229. //
  230. // The following structure is returned on an IOCTL_DISK_GET_DRIVE_GEOMETRY
  231. // request and an array of them is returned on an IOCTL_DISK_GET_MEDIA_TYPES
  232. // request.
  233. //
  234. typedef struct _DISK_GEOMETRY {
  235. LARGE_INTEGER Cylinders;
  236. MEDIA_TYPE MediaType;
  237. DWORD TracksPerCylinder;
  238. DWORD SectorsPerTrack;
  239. DWORD BytesPerSector;
  240. } DISK_GEOMETRY, *PDISK_GEOMETRY;
  241. //
  242. // The following structure is returned on an IOCTL_DISK_GET_PARTITION_INFO
  243. // and an IOCTL_DISK_GET_DRIVE_LAYOUT request. It is also used in a request
  244. // to change the drive layout, IOCTL_DISK_SET_DRIVE_LAYOUT.
  245. //
  246. typedef struct _PARTITION_INFORMATION {
  247. LARGE_INTEGER StartingOffset;
  248. LARGE_INTEGER PartitionLength;
  249. DWORD HiddenSectors;
  250. DWORD PartitionNumber;
  251. BYTE PartitionType;
  252. BOOLEAN BootIndicator;
  253. BOOLEAN RecognizedPartition;
  254. BOOLEAN RewritePartition;
  255. } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
  256. //
  257. // The following structure is used to change the partition type of a
  258. // specified disk partition using an IOCTL_DISK_SET_PARTITION_INFO
  259. // request.
  260. //
  261. typedef struct _SET_PARTITION_INFORMATION {
  262. BYTE PartitionType;
  263. } SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION;
  264. //
  265. // The following structures is returned on an IOCTL_DISK_GET_DRIVE_LAYOUT
  266. // request and given as input to an IOCTL_DISK_SET_DRIVE_LAYOUT request.
  267. //
  268. typedef struct _DRIVE_LAYOUT_INFORMATION {
  269. DWORD PartitionCount;
  270. DWORD Signature;
  271. PARTITION_INFORMATION PartitionEntry[1];
  272. } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
  273. //
  274. // The following structure is passed in on an IOCTL_DISK_VERIFY request.
  275. // The offset and length parameters are both given in bytes.
  276. //
  277. typedef struct _VERIFY_INFORMATION {
  278. LARGE_INTEGER StartingOffset;
  279. DWORD Length;
  280. } VERIFY_INFORMATION, *PVERIFY_INFORMATION;
  281. //
  282. // The following structure is passed in on an IOCTL_DISK_REASSIGN_BLOCKS
  283. // request.
  284. //
  285. typedef struct _REASSIGN_BLOCKS {
  286. WORD Reserved;
  287. WORD Count;
  288. DWORD BlockNumber[1];
  289. } REASSIGN_BLOCKS, *PREASSIGN_BLOCKS;
  290. //
  291. // IOCTL_DISK_MEDIA_REMOVAL disables the mechanism
  292. // on a SCSI device that ejects media. This function
  293. // may or may not be supported on SCSI devices that
  294. // support removable media.
  295. //
  296. // TRUE means prevent media from being removed.
  297. // FALSE means allow media removal.
  298. //
  299. typedef struct _PREVENT_MEDIA_REMOVAL {
  300. BOOLEAN PreventMediaRemoval;
  301. } PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
  302. ///////////////////////////////////////////////////////
  303. // //
  304. // The following structures define disk performance //
  305. // statistics: specifically the locations of all the //
  306. // reads and writes which have occured on the disk. //
  307. // //
  308. // To use these structures, you must issue an IOCTL_ //
  309. // DISK_HIST_STRUCTURE (with a DISK_HISTOGRAM) to //
  310. // obtain the basic histogram information. The //
  311. // number of buckets which must allocated is part of //
  312. // this structure. Allocate the required number of //
  313. // buckets and call an IOCTL_DISK_HIST_DATA to fill //
  314. // in the data //
  315. // //
  316. ///////////////////////////////////////////////////////
  317. #define HIST_NO_OF_BUCKETS 24
  318. typedef struct _HISTOGRAM_BUCKET {
  319. DWORD Reads;
  320. DWORD Writes;
  321. } HISTOGRAM_BUCKET, *PHISTOGRAM_BUCKET;
  322. #define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
  323. typedef struct _DISK_HISTOGRAM {
  324. LARGE_INTEGER DiskSize;
  325. LARGE_INTEGER Start;
  326. LARGE_INTEGER End;
  327. LARGE_INTEGER Average;
  328. LARGE_INTEGER AverageRead;
  329. LARGE_INTEGER AverageWrite;
  330. DWORD Granularity;
  331. DWORD Size;
  332. DWORD ReadCount;
  333. DWORD WriteCount;
  334. PHISTOGRAM_BUCKET Histogram;
  335. } DISK_HISTOGRAM, *PDISK_HISTOGRAM;
  336. #define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
  337. ///////////////////////////////////////////////////////
  338. // //
  339. // The following structures define disk debugging //
  340. // capabilities. The IOCTLs are directed to one of //
  341. // the two disk filter drivers. //
  342. // //
  343. // DISKPERF is a utilty for collecting disk request //
  344. // statistics. //
  345. // //
  346. // SIMBAD is a utility for injecting faults in //
  347. // IO requests to disks. //
  348. // //
  349. ///////////////////////////////////////////////////////
  350. //
  351. // The following structure is exchanged on an IOCTL_DISK_GET_PERFORMANCE
  352. // request. This ioctl collects summary disk request statistics used
  353. // in measuring performance.
  354. //
  355. typedef struct _DISK_PERFORMANCE {
  356. LARGE_INTEGER BytesRead;
  357. LARGE_INTEGER BytesWritten;
  358. LARGE_INTEGER ReadTime;
  359. LARGE_INTEGER WriteTime;
  360. DWORD ReadCount;
  361. DWORD WriteCount;
  362. DWORD QueueDepth;
  363. } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
  364. //
  365. // This structure defines the disk logging record. When disk logging
  366. // is enabled, one of these is written to an internal buffer for each
  367. // disk request.
  368. //
  369. typedef struct _DISK_RECORD {
  370. LARGE_INTEGER ByteOffset;
  371. LARGE_INTEGER StartTime;
  372. LARGE_INTEGER EndTime;
  373. PVOID VirtualAddress;
  374. DWORD NumberOfBytes;
  375. BYTE DeviceNumber;
  376. BOOLEAN ReadRequest;
  377. } DISK_RECORD, *PDISK_RECORD;
  378. //
  379. // The following structure is exchanged on an IOCTL_DISK_LOG request.
  380. // Not all fields are valid with each function type.
  381. //
  382. typedef struct _DISK_LOGGING {
  383. BYTE Function;
  384. PVOID BufferAddress;
  385. DWORD BufferSize;
  386. } DISK_LOGGING, *PDISK_LOGGING;
  387. //
  388. // Disk logging functions
  389. //
  390. // Start disk logging. Only the Function and BufferSize fields are valid.
  391. //
  392. #define DISK_LOGGING_START 0
  393. //
  394. // Stop disk logging. Only the Function field is valid.
  395. //
  396. #define DISK_LOGGING_STOP 1
  397. //
  398. // Return disk log. All fields are valid. Data will be copied from internal
  399. // buffer to buffer specified for the number of bytes requested.
  400. //
  401. #define DISK_LOGGING_DUMP 2
  402. //
  403. // DISK BINNING
  404. //
  405. // DISKPERF will keep counters for IO that falls in each of these ranges.
  406. // The application determines the number and size of the ranges.
  407. // Joe Lin wanted me to keep it flexible as possible, for instance, IO
  408. // sizes are interesting in ranges like 0-4096, 4097-16384, 16385-65536, 65537+.
  409. //
  410. #define DISK_BINNING 3
  411. //
  412. // Bin types
  413. //
  414. typedef enum _BIN_TYPES {
  415. RequestSize,
  416. RequestLocation
  417. } BIN_TYPES;
  418. //
  419. // Bin ranges
  420. //
  421. typedef struct _BIN_RANGE {
  422. LARGE_INTEGER StartValue;
  423. LARGE_INTEGER Length;
  424. } BIN_RANGE, *PBIN_RANGE;
  425. //
  426. // Bin definition
  427. //
  428. typedef struct _PERF_BIN {
  429. DWORD NumberOfBins;
  430. DWORD TypeOfBin;
  431. BIN_RANGE BinsRanges[1];
  432. } PERF_BIN, *PPERF_BIN ;
  433. //
  434. // Bin count
  435. //
  436. typedef struct _BIN_COUNT {
  437. BIN_RANGE BinRange;
  438. DWORD BinCount;
  439. } BIN_COUNT, *PBIN_COUNT;
  440. //
  441. // Bin results
  442. //
  443. typedef struct _BIN_RESULTS {
  444. DWORD NumberOfBins;
  445. BIN_COUNT BinCounts[1];
  446. } BIN_RESULTS, *PBIN_RESULTS;
  447. #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
  448. //
  449. // The following values follow the escape designator in the
  450. // data stream if the LSRMST_INSERT mode has been turned on.
  451. //
  452. #define SERIAL_LSRMST_ESCAPE ((BYTE )0x00)
  453. //
  454. // Following this value is the contents of the line status
  455. // register, and then the character in the RX hardware when
  456. // the line status register was encountered.
  457. //
  458. #define SERIAL_LSRMST_LSR_DATA ((BYTE )0x01)
  459. //
  460. // Following this value is the contents of the line status
  461. // register. No error character follows
  462. //
  463. #define SERIAL_LSRMST_LSR_NODATA ((BYTE )0x02)
  464. //
  465. // Following this value is the contents of the modem status
  466. // register.
  467. //
  468. #define SERIAL_LSRMST_MST ((BYTE )0x03)
  469. #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
  470. #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
  471. #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
  472. #define FSCTL_MOUNT_DBLS_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13, METHOD_BUFFERED, FILE_ANY_ACCESS)
  473. #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15, METHOD_BUFFERED, FILE_ANY_ACCESS)
  474. #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
  475. #define FSCTL_READ_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,17, METHOD_NEITHER, FILE_READ_DATA)
  476. #define FSCTL_WRITE_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,18, METHOD_NEITHER, FILE_WRITE_DATA)
  477. #endif // _WINIOCTL_