ReactOS 0.4.16-dev-1946-g52006dd
ntddstor.h
Go to the documentation of this file.
1/*
2 * DDK definitions for storage media access
3 *
4 * Copyright (C) 2002 Eric Pouech
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef _NTDDSTOR_H_
22#define _NTDDSTOR_H_
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
29
30#define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
31#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
32#define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
33#define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
34#define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
35#define IOCTL_STORAGE_LOAD_MEDIA2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
36#define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
37#define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
38#define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
39#define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
40#define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
41#define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
42#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
43#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
44#define IOCTL_STORAGE_GET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
45#define IOCTL_STORAGE_SET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
46#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
47#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
48#define IOCTL_STORAGE_BREAK_RESERVATION CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
49#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
50#define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
51#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
52
53DEFINE_GUID(DiskClassGuid,
54 0x53f56307, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
55DEFINE_GUID(CdRomClassGuid,
56 0x53f56308, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
57DEFINE_GUID(PartitionClassGuid,
58 0x53f5630a, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
59DEFINE_GUID(TapeClassGuid,
60 0x53f5630b, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
61DEFINE_GUID(WriteOnceDiskClassGuid,
62 0x53f5630c, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
63DEFINE_GUID(VolumeClassGuid,
64 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
65DEFINE_GUID(MediumChangerClassGuid,
66 0x53f56310, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
67DEFINE_GUID(FloppyClassGuid,
68 0x53f56311, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
69DEFINE_GUID(CdChangerClassGuid,
70 0x53f56312, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
71DEFINE_GUID(StoragePortClassGuid,
72 0x2accfe60, 0xc130, 0x11d2, 0xb0, 0x82, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
73
74typedef struct _STORAGE_DEVICE_NUMBER {
79
80typedef struct _STORAGE_BUS_RESET_REQUEST {
83
84typedef struct _PREVENT_MEDIA_REMOVAL {
87
88typedef struct _TAPE_STATISTICS {
98
99#define RECOVERED_WRITES_VALID 0x00000001
100#define UNRECOVERED_WRITES_VALID 0x00000002
101#define RECOVERED_READS_VALID 0x00000004
102#define UNRECOVERED_READS_VALID 0x00000008
103#define WRITE_COMPRESSION_INFO_VALID 0x00000010
104#define READ_COMPRESSION_INFO_VALID 0x00000020
105
106typedef struct _TAPE_GET_STATISTICS {
109
110#define TAPE_RETURN_STATISTICS __MSABI_LONG(0)
111#define TAPE_RETURN_ENV_INFO __MSABI_LONG(1)
112#define TAPE_RESET_STATISTICS __MSABI_LONG(2)
113
115 /* see also defines in ntdddisk.h */
116
117 DDS_4mm = 0x20,
164 MP2_8mm
166
167#define MEDIA_ERASEABLE 0x00000001
168#define MEDIA_WRITE_ONCE 0x00000002
169#define MEDIA_READ_ONLY 0x00000004
170#define MEDIA_READ_WRITE 0x00000008
171#define MEDIA_WRITE_PROTECTED 0x00000100
172#define MEDIA_CURRENTLY_MOUNTED 0x80000000
173
174typedef struct _DEVICE_MEDIA_INFO {
175 union {
176 struct {
185 struct {
194 struct {
201
202typedef struct _GET_MEDIA_TYPES {
207
214
256
257typedef struct _STORAGE_PROPERTY_QUERY {
262
263typedef struct _DEVICE_SEEK_PENALTY_DESCRIPTOR {
268
273
274typedef enum _STORAGE_BUS_TYPE {
284 BusTypeMaxReserved = 0x7F
286
302
317
318typedef struct _STORAGE_HOTPLUG_INFO {
319 ULONG Size;
325
326#ifdef __cplusplus
327}
328#endif
329
330#endif /* _NTDDSTOR_H_ */
unsigned char BOOLEAN
enum _STORAGE_MEDIA_TYPE STORAGE_MEDIA_TYPE
_STORAGE_MEDIA_TYPE
Definition: cdrw_usr.h:192
#define DEVICE_TYPE
Definition: guid.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short USHORT
Definition: pedump.c:61
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
struct _STORAGE_PROPERTY_QUERY STORAGE_PROPERTY_QUERY
struct _TAPE_STATISTICS * PTAPE_STATISTICS
* PSTORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:560
enum _STORAGE_PROPERTY_ID STORAGE_PROPERTY_ID
STORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:560
struct _STORAGE_HOTPLUG_INFO STORAGE_HOTPLUG_INFO
STORAGE_ADAPTER_DESCRIPTOR
Definition: ntddstor.h:599
struct _STORAGE_DEVICE_NUMBER STORAGE_DEVICE_NUMBER
enum _STORAGE_QUERY_TYPE * PSTORAGE_QUERY_TYPE
struct _DEVICE_SEEK_PENALTY_DESCRIPTOR DEVICE_SEEK_PENALTY_DESCRIPTOR
struct _PREVENT_MEDIA_REMOVAL * PPREVENT_MEDIA_REMOVAL
struct _DEVICE_SEEK_PENALTY_DESCRIPTOR * PDEVICE_SEEK_PENALTY_DESCRIPTOR
struct _STORAGE_BUS_RESET_REQUEST * PSTORAGE_BUS_RESET_REQUEST
enum _STORAGE_MEDIA_TYPE STORAGE_MEDIA_TYPE
_STORAGE_BUS_TYPE
Definition: ntddstor.h:437
@ BusTypeScsi
Definition: ntddstor.h:439
@ BusTypeMaxReserved
Definition: ntddstor.h:455
@ BusTypeUsb
Definition: ntddstor.h:445
@ BusTypeSsa
Definition: ntddstor.h:443
@ BusTypeRAID
Definition: ntddstor.h:446
@ BusTypeFibre
Definition: ntddstor.h:444
@ BusTypeAtapi
Definition: ntddstor.h:440
@ BusTypeUnknown
Definition: ntddstor.h:438
@ BusType1394
Definition: ntddstor.h:442
@ BusTypeAta
Definition: ntddstor.h:441
struct _STORAGE_BUS_RESET_REQUEST STORAGE_BUS_RESET_REQUEST
enum _STORAGE_MEDIA_TYPE * PSTORAGE_MEDIA_TYPE
struct _GET_MEDIA_TYPES * PGET_MEDIA_TYPES
struct _PREVENT_MEDIA_REMOVAL PREVENT_MEDIA_REMOVAL
* PSTORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:576
_STORAGE_PROPERTY_ID
Definition: ntddstor.h:511
@ StorageMiniportProperty
Definition: ntddstor.h:517
@ StorageDeviceUniqueIdProperty
Definition: ntddstor.h:515
@ StorageDevicePhysicalTopologyProperty
Definition: ntddstor.h:540
@ StorageDeviceZonedDeviceProperty
Definition: ntddstor.h:546
@ StorageDeviceMediumProductType
Definition: ntddstor.h:527
@ StorageDeviceUnsafeShutdownCount
Definition: ntddstor.h:547
@ StorageAdapterRpmbProperty
Definition: ntddstor.h:528
@ StorageAdapterProtocolSpecificProperty
Definition: ntddstor.h:535
@ StorageDeviceIoCapabilityProperty
Definition: ntddstor.h:534
@ StorageDeviceSeekPenaltyProperty
Definition: ntddstor.h:519
@ StorageAdapterPhysicalTopologyProperty
Definition: ntddstor.h:539
@ StorageDeviceIdProperty
Definition: ntddstor.h:514
@ StorageDeviceProtocolSpecificProperty
Definition: ntddstor.h:536
@ StorageDeviceLBProvisioningProperty
Definition: ntddstor.h:523
@ StorageDeviceDeviceTelemetryProperty
Definition: ntddstor.h:522
@ StorageAdapterCryptoProperty
Definition: ntddstor.h:529
@ StorageDeviceWriteAggregationProperty
Definition: ntddstor.h:521
@ StorageDeviceWriteCacheProperty
Definition: ntddstor.h:516
@ StorageDeviceManagementStatus
Definition: ntddstor.h:542
@ StorageAdapterProperty
Definition: ntddstor.h:513
@ StorageDeviceTemperatureProperty
Definition: ntddstor.h:538
@ StorageDeviceNumaProperty
Definition: ntddstor.h:545
@ StorageDeviceAttributesProperty
Definition: ntddstor.h:541
@ StorageDeviceLocationProperty
Definition: ntddstor.h:544
@ StorageDeviceEnduranceProperty
Definition: ntddstor.h:548
@ StorageDeviceTrimProperty
Definition: ntddstor.h:520
@ StorageDevicePowerProperty
Definition: ntddstor.h:524
@ StorageAdapterSerialNumberProperty
Definition: ntddstor.h:543
@ StorageAdapterTemperatureProperty
Definition: ntddstor.h:537
@ StorageDeviceCopyOffloadProperty
Definition: ntddstor.h:525
@ StorageAccessAlignmentProperty
Definition: ntddstor.h:518
@ StorageDeviceResiliencyProperty
Definition: ntddstor.h:526
@ StorageDeviceProperty
Definition: ntddstor.h:512
enum _STORAGE_BUS_TYPE * PSTORAGE_BUS_TYPE
struct _TAPE_STATISTICS TAPE_STATISTICS
struct _STORAGE_PROPERTY_QUERY * PSTORAGE_PROPERTY_QUERY
enum _STORAGE_QUERY_TYPE STORAGE_QUERY_TYPE
enum _STORAGE_BUS_TYPE STORAGE_BUS_TYPE
STORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:576
_STORAGE_QUERY_TYPE
Definition: ntddstor.h:504
@ PropertyMaskQuery
Definition: ntddstor.h:507
@ PropertyQueryMaxDefined
Definition: ntddstor.h:508
@ PropertyExistsQuery
Definition: ntddstor.h:506
@ PropertyStandardQuery
Definition: ntddstor.h:505
struct _TAPE_GET_STATISTICS TAPE_GET_STATISTICS
struct _TAPE_GET_STATISTICS * PTAPE_GET_STATISTICS
@ SYQUEST_EZ135
Definition: ntddstor.h:411
@ NCTP
Definition: ntddstor.h:376
@ SONY_DTF
Definition: ntddstor.h:382
@ AIT1_8mm
Definition: ntddstor.h:374
@ IOMEGA_JAZ
Definition: ntddstor.h:410
@ CD_R
Definition: ntddstor.h:388
@ KODAK_14_WO
Definition: ntddstor.h:406
@ SYQUEST_EZFLYER
Definition: ntddstor.h:412
@ SYQUEST_SYJET
Definition: ntddstor.h:413
@ CD_ROM
Definition: ntddstor.h:387
@ PC_5_WO
Definition: ntddstor.h:397
@ DVD_RW
Definition: ntddstor.h:392
@ DV_6mm
Definition: ntddstor.h:383
@ PHILIPS_12_WO
Definition: ntddstor.h:403
@ DMI
Definition: ntddstor.h:384
@ AME_8mm
Definition: ntddstor.h:373
@ IBM_3480
Definition: ntddstor.h:377
@ CLEANER_CARTRIDGE
Definition: ntddstor.h:386
@ QIC
Definition: ntddstor.h:371
@ HITACHI_12_WO
Definition: ntddstor.h:404
@ MP_8mm
Definition: ntddstor.h:372
@ STK_DATA_D3
Definition: ntddstor.h:381
@ PC_5_RW
Definition: ntddstor.h:398
@ IOMEGA_ZIP
Definition: ntddstor.h:409
@ PINNACLE_APEX_5_RW
Definition: ntddstor.h:401
@ DVD_R
Definition: ntddstor.h:391
@ ABL_5_WO
Definition: ntddstor.h:400
@ DLT
Definition: ntddstor.h:375
@ SONY_D2
Definition: ntddstor.h:385
@ CYGNET_12_WO
Definition: ntddstor.h:405
@ MO_3_RW
Definition: ntddstor.h:393
@ DVD_ROM
Definition: ntddstor.h:390
@ DDS_4mm
Definition: ntddstor.h:368
@ MP2_8mm
Definition: ntddstor.h:415
@ IBM_Magstar_3590
Definition: ntddstor.h:379
@ IBM_Magstar_MP
Definition: ntddstor.h:380
@ IBM_3490E
Definition: ntddstor.h:378
@ CD_RW
Definition: ntddstor.h:389
@ NIKON_12_RW
Definition: ntddstor.h:408
@ MO_5_RW
Definition: ntddstor.h:395
@ SONY_12_WO
Definition: ntddstor.h:402
@ MiniQic
Definition: ntddstor.h:369
@ Travan
Definition: ntddstor.h:370
@ PD_5_RW
Definition: ntddstor.h:399
@ MO_NFR_525
Definition: ntddstor.h:407
@ AVATAR_F2
Definition: ntddstor.h:414
@ MO_5_WO
Definition: ntddstor.h:394
@ MO_5_LIMDOW
Definition: ntddstor.h:396
struct _STORAGE_HOTPLUG_INFO * PSTORAGE_HOTPLUG_INFO
enum _STORAGE_PROPERTY_ID * PSTORAGE_PROPERTY_ID
struct _DEVICE_MEDIA_INFO DEVICE_MEDIA_INFO
struct _STORAGE_DEVICE_NUMBER * PSTORAGE_DEVICE_NUMBER
struct _DEVICE_MEDIA_INFO * PDEVICE_MEDIA_INFO
* PSTORAGE_ADAPTER_DESCRIPTOR
Definition: ntddstor.h:599
struct _GET_MEDIA_TYPES GET_MEDIA_TYPES
struct _DEVICE_MEDIA_INFO::@3362::@3365 TapeInfo
struct _DEVICE_MEDIA_INFO::@3362::@3363 DiskInfo
ULONG TracksPerCylinder
Definition: ntddstor.h:463
ULONG BytesPerSector
Definition: ntddstor.h:465
union _DEVICE_MEDIA_INFO::@3362 DeviceSpecific
ULONG MediaCharacteristics
Definition: ntddstor.h:467
ULONG SectorsPerTrack
Definition: ntddstor.h:464
STORAGE_MEDIA_TYPE MediaType
Definition: ntddstor.h:462
ULONG NumberMediaSides
Definition: ntddstor.h:466
LARGE_INTEGER Cylinders
Definition: ntddstor.h:461
struct _DEVICE_MEDIA_INFO::@3362::@3364 RemovableDiskInfo
ULONG CurrentBlockSize
Definition: ntddstor.h:481
DEVICE_MEDIA_INFO MediaInfo[1]
Definition: ntddstor.h:496
ULONG DeviceType
Definition: ntddstor.h:494
ULONG MediaInfoCount
Definition: ntddstor.h:495
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
STORAGE_BUS_TYPE BusType
Definition: ntddstor.h:298
DEVICE_TYPE DeviceType
Definition: ntddstor.h:324
BOOLEAN WriteCacheEnableOverride
Definition: imports.h:249
BOOLEAN MediaRemovable
Definition: imports.h:246
BOOLEAN DeviceHotplug
Definition: imports.h:248
BOOLEAN MediaHotplug
Definition: imports.h:247
STORAGE_QUERY_TYPE QueryType
Definition: ntddstor.h:553
UCHAR AdditionalParameters[1]
Definition: ntddstor.h:554
STORAGE_PROPERTY_ID PropertyId
Definition: ntddstor.h:552
LARGE_INTEGER UnrecoveredReads
Definition: ntddstor.h:358
LARGE_INTEGER RecoveredWrites
Definition: ntddstor.h:355
LARGE_INTEGER RecoveredReads
Definition: ntddstor.h:357
UCHAR CompressionRatioWrites
Definition: ntddstor.h:360
UCHAR CompressionRatioReads
Definition: ntddstor.h:359
LARGE_INTEGER UnrecoveredWrites
Definition: ntddstor.h:356
uint32_t ULONG
Definition: typedefs.h:59
@ StorageDeviceProtocolSpecificPropertyEx
Definition: ntddstor.h:254
@ StorageAdapterProtocolSpecificPropertyEx
Definition: ntddstor.h:253
@ StorageDeviceSelfEncryptionProperty
Definition: ntddstor.h:250
@ StorageStackProperty
Definition: ntddstor.h:252
@ StorageFruIdProperty
Definition: ntddstor.h:251
@ StorageDeviceLedStateProperty
Definition: ntddstor.h:249
enum _STORAGE_BUS_TYPE STORAGE_BUS_TYPE
unsigned char UCHAR
Definition: xmlstorage.h:181