Annotation of mstools/h/winioctl.h, revision 1.1.1.2

1.1.1.2 ! root        1: /*++ BUILD Version: 0012    // Increment this if a change has global effects
1.1       root        2: 
                      3: Copyright (c) 1990-1992  Microsoft Corporation
                      4: 
                      5: Module Name:
                      6: 
                      7:     winioctl.h
                      8: 
                      9: Abstract:
                     10: 
                     11:     This module defines the 32-Bit Windows Device I/O control codes.
                     12: 
                     13: Revision History:
                     14: 
                     15: --*/
                     16: 
                     17: #ifndef _WINIOCTL_
                     18: #define _WINIOCTL_
                     19: 
                     20: 
                     21: #ifndef _DEVIOCTL_
                     22: #define _DEVIOCTL_
                     23: 
1.1.1.2 ! root       24: // begin_ntddk begin_nthal
1.1       root       25: //
                     26: // Define the various device type values.  Note that values used by Microsoft
                     27: // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
                     28: // by customers.
                     29: //
                     30: 
                     31: #define DEVICE_TYPE DWORD
                     32: 
                     33: #define FILE_DEVICE_BEEP                0x00000001
                     34: #define FILE_DEVICE_CD_ROM              0x00000002
                     35: #define FILE_DEVICE_CD_ROM_FILE_SYSTEM  0x00000003
                     36: #define FILE_DEVICE_CONTROLLER          0x00000004
                     37: #define FILE_DEVICE_DATALINK            0x00000005
                     38: #define FILE_DEVICE_DFS                 0x00000006
                     39: #define FILE_DEVICE_DISK                0x00000007
                     40: #define FILE_DEVICE_DISK_FILE_SYSTEM    0x00000008
                     41: #define FILE_DEVICE_FILE_SYSTEM         0x00000009
                     42: #define FILE_DEVICE_INPORT_PORT         0x0000000a
                     43: #define FILE_DEVICE_KEYBOARD            0x0000000b
                     44: #define FILE_DEVICE_MAILSLOT            0x0000000c
                     45: #define FILE_DEVICE_MIDI_IN             0x0000000d
                     46: #define FILE_DEVICE_MIDI_OUT            0x0000000e
                     47: #define FILE_DEVICE_MOUSE               0x0000000f
                     48: #define FILE_DEVICE_MULTI_UNC_PROVIDER  0x00000010
                     49: #define FILE_DEVICE_NAMED_PIPE          0x00000011
                     50: #define FILE_DEVICE_NETWORK             0x00000012
                     51: #define FILE_DEVICE_NETWORK_BROWSER     0x00000013
                     52: #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
                     53: #define FILE_DEVICE_NULL                0x00000015
                     54: #define FILE_DEVICE_PARALLEL_PORT       0x00000016
                     55: #define FILE_DEVICE_PHYSICAL_NETCARD    0x00000017
                     56: #define FILE_DEVICE_PRINTER             0x00000018
                     57: #define FILE_DEVICE_SCANNER             0x00000019
                     58: #define FILE_DEVICE_SERIAL_MOUSE_PORT   0x0000001a
                     59: #define FILE_DEVICE_SERIAL_PORT         0x0000001b
                     60: #define FILE_DEVICE_SCREEN              0x0000001c
                     61: #define FILE_DEVICE_SOUND               0x0000001d
                     62: #define FILE_DEVICE_STREAMS             0x0000001e
                     63: #define FILE_DEVICE_TAPE                0x0000001f
                     64: #define FILE_DEVICE_TAPE_FILE_SYSTEM    0x00000020
                     65: #define FILE_DEVICE_TRANSPORT           0x00000021
                     66: #define FILE_DEVICE_UNKNOWN             0x00000022
                     67: #define FILE_DEVICE_VIDEO               0x00000023
                     68: #define FILE_DEVICE_VIRTUAL_DISK        0x00000024
                     69: #define FILE_DEVICE_WAVE_IN             0x00000025
                     70: #define FILE_DEVICE_WAVE_OUT            0x00000026
                     71: #define FILE_DEVICE_8042_PORT           0x00000027
1.1.1.2 ! root       72: #define FILE_DEVICE_NETWORK_REDIRECTOR  0x00000028
1.1       root       73: 
                     74: //
                     75: // Macro definition for defining IOCTL and FSCTL function control codes.  Note
                     76: // that function codes 0-2047 are reserved for Microsoft Corporation, and
                     77: // 2048-4095 are reserved for customers.
                     78: //
                     79: 
                     80: #define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
                     81:     ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
                     82: )
                     83: 
                     84: //
                     85: // Define the method codes for how buffers are passed for I/O and FS controls
                     86: //
                     87: 
                     88: #define METHOD_BUFFERED                 0
                     89: #define METHOD_IN_DIRECT                1
                     90: #define METHOD_OUT_DIRECT               2
                     91: #define METHOD_NEITHER                  3
                     92: 
                     93: //
                     94: // Define the access check value for any access
                     95: //
                     96: //
                     97: // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
                     98: // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
                     99: // constants *MUST* always be in sync.
                    100: //
                    101: 
                    102: 
                    103: #define FILE_ANY_ACCESS                 0
                    104: #define FILE_READ_ACCESS          ( 0x0001 )    // file & pipe
                    105: #define FILE_WRITE_ACCESS         ( 0x0002 )    // file & pipe
                    106: 
1.1.1.2 ! root      107: // end_ntddk end_nthal
        !           108: 
1.1       root      109: #endif // _DEVIOCTL_
                    110: 
                    111: 
                    112: //
1.1.1.2 ! root      113: // IoControlCode values for disk devices.
1.1       root      114: //
                    115: 
                    116: #define IOCTL_DISK_BASE                 FILE_DEVICE_DISK
                    117: #define IOCTL_DISK_GET_DRIVE_GEOMETRY   CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
                    118: #define IOCTL_DISK_GET_PARTITION_INFO   CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
                    119: #define IOCTL_DISK_SET_PARTITION_INFO   CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
                    120: #define IOCTL_DISK_GET_DRIVE_LAYOUT     CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
                    121: #define IOCTL_DISK_SET_DRIVE_LAYOUT     CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
                    122: #define IOCTL_DISK_VERIFY               CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
                    123: #define IOCTL_DISK_FORMAT_TRACKS        CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
                    124: #define IOCTL_DISK_REASSIGN_BLOCKS      CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
                    125: #define IOCTL_DISK_PERFORMANCE          CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
1.1.1.2 ! root      126: #define IOCTL_DISK_IS_WRITABLE          CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
1.1       root      127: 
                    128: //
                    129: // The following device control codes are common for all class drivers.  The
                    130: // functions codes defined here must match all of the other class drivers.
                    131: //
                    132: 
1.1.1.2 ! root      133: #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
        !           134: #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
        !           135: #define IOCTL_DISK_EJECT_MEDIA  CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
        !           136: #define IOCTL_DISK_LOAD_MEDIA   CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
1.1       root      137: 
                    138: 
1.1.1.2 ! root      139: #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
1.1       root      140: 
                    141: //
                    142: // Define the partition types returnable by known disk drivers.
                    143: //
                    144: 
                    145: #define PARTITION_ENTRY_UNUSED          0x00      // Entry unused
                    146: #define PARTITION_FAT_12                0x01      // 12-bit FAT entries
                    147: #define PARTITION_XENIX_1               0x02      // Xenix
                    148: #define PARTITION_XENIX_2               0x03      // Xenix
                    149: #define PARTITION_FAT_16                0x04      // 16-bit FAT entries
                    150: #define PARTITION_EXTENDED              0x05      // Extended partition entry
                    151: #define PARTITION_HUGE                  0x06      // Huge partition MS-DOS V4
                    152: #define PARTITION_IFS                   0x07      // IFS Partition
                    153: #define PARTITION_UNIX                  0x63      // Unix
                    154: 
                    155: #define VALID_NTFT                      0xC0      // NTFT uses high order bits
                    156: 
                    157: //
                    158: // The following macro is used to determine which partitions should be
                    159: // assigned drive letters.
                    160: //
                    161: 
                    162: //++
                    163: //
                    164: // BOOLEAN
                    165: // IsRecognizedPartition(
                    166: //     IN DWORD PartitionType
                    167: //     )
                    168: //
                    169: // Routine Description:
                    170: //
                    171: //     This macro is used to determine to which partitions drive letters
                    172: //     should be assigned.
                    173: //
                    174: // Arguments:
                    175: //
                    176: //     PartitionType - Supplies the type of the partition being examined.
                    177: //
                    178: // Return Value:
                    179: //
                    180: //     The return value is TRUE if the partition type is recognized,
                    181: //     otherwise FALSE is returned.
                    182: //
                    183: //--
                    184: 
                    185: #define IsRecognizedPartition( PartitionType ) (       \
                    186:     (((PartitionType & ~0xC0) == PARTITION_FAT_12) ||  \
                    187:      ((PartitionType & ~0xC0) == PARTITION_FAT_16) ||  \
                    188:      ((PartitionType & ~0xC0) == PARTITION_IFS)    ||  \
                    189:      ((PartitionType & ~0xC0) == PARTITION_HUGE)) )
                    190: 
                    191: //
                    192: // The high bit of the partition type code indicates that a partition
                    193: // is part of an NTFT mirror or striped array.
                    194: //
                    195: 
                    196: #define PARTITION_NTFT                  0x80     // NTFT partition
                    197: 
                    198: //
                    199: // Define the media types supported by the driver.
                    200: //
                    201: 
                    202: typedef enum _MEDIA_TYPE {
                    203:     Unknown,                // Format is unknown
                    204:     F5_1Pt2_512,            // 5.25", 1.2MB,  512 bytes/sector
                    205:     F3_1Pt44_512,           // 3.5",  1.44MB, 512 bytes/sector
                    206:     F3_2Pt88_512,           // 3.5",  2.88MB, 512 bytes/sector
                    207:     F3_20Pt8_512,           // 3.5",  20.8MB, 512 bytes/sector
                    208:     F3_720_512,             // 3.5",  720KB,  512 bytes/sector
                    209:     F5_360_512,             // 5.25", 360KB,  512 bytes/sector
                    210:     F5_320_512,             // 5.25", 320KB,  512 bytes/sector
                    211:     F5_320_1024,            // 5.25", 320KB,  1024 bytes/sector
                    212:     F5_180_512,             // 5.25", 180KB,  512 bytes/sector
                    213:     F5_160_512,             // 5.25", 160KB,  512 bytes/sector
                    214:     RemovableMedia,         // Removable media other than floppy
                    215:     FixedMedia              // Fixed hard disk media
                    216: } MEDIA_TYPE, *PMEDIA_TYPE;
                    217: 
                    218: //
                    219: // Define the input buffer structure for the driver, when
                    220: // it is called with IOCTL_DISK_FORMAT_TRACKS.
                    221: //
                    222: 
                    223: typedef struct _FORMAT_PARAMETERS {
                    224:    MEDIA_TYPE MediaType;
                    225:    DWORD StartCylinderNumber;
                    226:    DWORD EndCylinderNumber;
                    227:    DWORD StartHeadNumber;
                    228:    DWORD EndHeadNumber;
                    229: } FORMAT_PARAMETERS, *PFORMAT_PARAMETERS;
                    230: 
                    231: //
                    232: // Define the BAD_TRACK_NUMBER type. An array of elements of this type is
                    233: // returned by the driver on IOCTL_DISK_FORMAT_TRACKS requests, to indicate
                    234: // what tracks were bad during formatting. The length of that array is
                    235: // reported in the `Information' field of the I/O Status Block.
                    236: //
                    237: 
                    238: typedef WORD   BAD_TRACK_NUMBER;
                    239: typedef WORD   *PBAD_TRACK_NUMBER;
                    240: 
                    241: //
                    242: // The following structure is returned on an IOCTL_DISK_GET_DRIVE_GEOMETRY
                    243: // request and an array of them is returned on an IOCTL_DISK_GET_MEDIA_TYPES
                    244: // request.
                    245: //
                    246: 
                    247: typedef struct _DISK_GEOMETRY {
                    248:     LARGE_INTEGER Cylinders;
1.1.1.2 ! root      249:     MEDIA_TYPE MediaType;
1.1       root      250:     DWORD TracksPerCylinder;
                    251:     DWORD SectorsPerTrack;
                    252:     DWORD BytesPerSector;
                    253: } DISK_GEOMETRY, *PDISK_GEOMETRY;
                    254: 
                    255: //
                    256: // The following structure is returned on an IOCTL_DISK_GET_PARTITION_INFO
                    257: // and an IOCTL_DISK_GET_DRIVE_LAYOUT request.  It is also used in a request
                    258: // to change the drive layout, IOCTL_DISK_SET_DRIVE_LAYOUT.
                    259: //
                    260: 
                    261: typedef struct _PARTITION_INFORMATION {
1.1.1.2 ! root      262:     LARGE_INTEGER StartingOffset;
        !           263:     LARGE_INTEGER PartitionLength;
        !           264:     LARGE_INTEGER HiddenSectors;
1.1       root      265:     BYTE  PartitionType;
                    266:     BOOLEAN BootIndicator;
                    267:     BOOLEAN RecognizedPartition;
                    268:     BOOLEAN RewritePartition;
                    269: } PARTITION_INFORMATION, *PPARTITION_INFORMATION;
                    270: 
                    271: //
                    272: // The following structure is used to change the partition type of a
                    273: // specified disk partition using an IOCTL_DISK_SET_PARTITION_INFO
                    274: // request.
                    275: //
                    276: 
                    277: typedef struct _SET_PARTITION_INFORMATION {
                    278:     BYTE  PartitionType;
                    279: } SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION;
                    280: 
                    281: //
                    282: // The following structures is returned on an IOCTL_DISK_GET_DRIVE_LAYOUT
                    283: // request and given as input to an IOCTL_DISK_SET_DRIVE_LAYOUT request.
                    284: //
                    285: 
                    286: typedef struct _DRIVE_LAYOUT_INFORMATION {
                    287:     DWORD PartitionCount;
                    288:     DWORD Signature;
                    289:     PARTITION_INFORMATION PartitionEntry[1];
                    290: } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION;
                    291: 
                    292: //
                    293: // The following structure is passed in on an IOCTL_DISK_VERIFY request.
                    294: // The offset and length parameters are both given in bytes.
                    295: //
                    296: 
                    297: typedef struct _VERIFY_INFORMATION {
                    298:     LARGE_INTEGER StartingOffset;
                    299:     DWORD Length;
                    300: } VERIFY_INFORMATION, *PVERIFY_INFORMATION;
                    301: 
                    302: //
                    303: // The following structure is passed in on an IOCTL_DISK_REASSIGN_BLOCKS
                    304: // request.
                    305: //
                    306: 
                    307: typedef struct _REASSIGN_BLOCKS {
                    308:     WORD   Reserved;
                    309:     WORD   Count;
                    310:     DWORD BlockNumber[1];
                    311: } REASSIGN_BLOCKS, *PREASSIGN_BLOCKS;
                    312: 
                    313: //
                    314: // The following structure is exchanged on an IOCTL_DISK_GET_PERFORMANCE
                    315: // request.
                    316: //
                    317: 
                    318: typedef struct _DISK_PERFORMANCE {
                    319:         LARGE_INTEGER BytesRead;
                    320:         LARGE_INTEGER BytesWritten;
                    321:         LARGE_INTEGER ReadTime;
                    322:         LARGE_INTEGER WriteTime;
                    323:         DWORD ReadCount;
                    324:         DWORD WriteCount;
                    325:         DWORD QueueDepth;
                    326: } DISK_PERFORMANCE, *PDISK_PERFORMANCE;
                    327: 
1.1.1.2 ! root      328: //
        !           329: // IOCTL_DISK_MEDIA_REMOVAL disables the mechanism
        !           330: // on a SCSI device that ejects media. This function
        !           331: // may or may not be supported on SCSI devices that
        !           332: // support removable media.
        !           333: //
        !           334: // TRUE means prevent media from being removed.
        !           335: // FALSE means allow media removal.
        !           336: //
        !           337: 
        !           338: typedef struct _PREVENT_MEDIA_REMOVAL {
        !           339:     BOOLEAN PreventMediaRemoval;
        !           340: } PREVENT_MEDIA_REMOVAL, *PPREVENT_MEDIA_REMOVAL;
        !           341: 
        !           342: 
        !           343: #define IOCTL_SERIAL_LSRMST_INSERT      CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
        !           344: 
        !           345: 
        !           346: //
        !           347: // The following values follow the escape designator in the
        !           348: // data stream if the LSRMST_INSERT mode has been turned on.
        !           349: //
        !           350: #define SERIAL_LSRMST_ESCAPE     ((BYTE )0x00)
        !           351: 
        !           352: //
        !           353: // Following this value is the contents of the line status
        !           354: // register, and then the character in the RX hardware when
        !           355: // the line status register was encountered.
        !           356: //
        !           357: #define SERIAL_LSRMST_LSR_DATA   ((BYTE )0x01)
        !           358: 
        !           359: //
        !           360: // Following this value is the contents of the line status
        !           361: // register.  No error character follows
        !           362: //
        !           363: #define SERIAL_LSRMST_LSR_NODATA ((BYTE )0x02)
        !           364: 
        !           365: //
        !           366: // Following this value is the contents of the modem status
        !           367: // register.
        !           368: //
        !           369: #define SERIAL_LSRMST_MST        ((BYTE )0x03)
        !           370: 
1.1       root      371: 
                    372: #define FSCTL_LOCK_VOLUME               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
                    373: #define FSCTL_UNLOCK_VOLUME             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
                    374: #define FSCTL_DISMOUNT_VOLUME           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
                    375: 
                    376: 
                    377: #endif // _WINIOCTL_
                    378: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.