ReactOS  0.4.14-dev-317-g96040ec
ntddscsi.h
Go to the documentation of this file.
1 
6 #ifdef DEFINE_GUID
7 
8 #ifndef FAR
9 #define FAR
10 #endif
11 
12 DEFINE_GUID(ScsiRawInterfaceGuid,0x53f56309L,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
13 DEFINE_GUID(WmiScsiAddressGuid,0x53f5630fL,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
14 #endif /* DEFINE_GUID */
15 
16 #ifndef _NTDDSCSIH_
17 #define _NTDDSCSIH_
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
24 
25 #define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
26 #define DD_SCSI_DEVICE_NAME_U L"\\Device\\ScsiPort"
27 
28 #define IOCTL_SCSI_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE,0x0401,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
29 #define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE,0x0402,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
30 #define IOCTL_SCSI_GET_INQUIRY_DATA CTL_CODE(IOCTL_SCSI_BASE,0x0403,METHOD_BUFFERED,FILE_ANY_ACCESS)
31 #define IOCTL_SCSI_GET_CAPABILITIES CTL_CODE(IOCTL_SCSI_BASE,0x0404,METHOD_BUFFERED,FILE_ANY_ACCESS)
32 #define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE(IOCTL_SCSI_BASE,0x0405,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
33 #define IOCTL_SCSI_GET_ADDRESS CTL_CODE(IOCTL_SCSI_BASE,0x0406,METHOD_BUFFERED,FILE_ANY_ACCESS)
34 #define IOCTL_SCSI_RESCAN_BUS CTL_CODE(IOCTL_SCSI_BASE,0x0407,METHOD_BUFFERED,FILE_ANY_ACCESS)
35 #define IOCTL_SCSI_GET_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE,0x0408,METHOD_BUFFERED,FILE_ANY_ACCESS)
36 #define IOCTL_SCSI_FREE_DUMP_POINTERS CTL_CODE(IOCTL_SCSI_BASE,0x0409,METHOD_BUFFERED,FILE_ANY_ACCESS)
37 #define IOCTL_SCSI_PASS_THROUGH_EX CTL_CODE(IOCTL_SCSI_BASE, 0x0411, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
38 #define IOCTL_SCSI_PASS_THROUGH_DIRECT_EX CTL_CODE(IOCTL_SCSI_BASE, 0x0412, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
39 #define IOCTL_IDE_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE,0x040a,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
40 #define IOCTL_ATA_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE,0x040b,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
41 #define IOCTL_ATA_PASS_THROUGH_DIRECT CTL_CODE(IOCTL_SCSI_BASE,0x040c,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
42 
43  typedef struct _SCSI_PASS_THROUGH {
44  USHORT Length;
46  UCHAR PathId;
48  UCHAR Lun;
51  UCHAR DataIn;
56  UCHAR Cdb[16];
58 
59  typedef struct _SCSI_PASS_THROUGH_DIRECT {
60  USHORT Length;
62  UCHAR PathId;
64  UCHAR Lun;
67  UCHAR DataIn;
72  UCHAR Cdb[16];
74 
75 #if defined(_WIN64)
76  typedef struct _SCSI_PASS_THROUGH32 {
77  USHORT Length;
78  UCHAR ScsiStatus;
79  UCHAR PathId;
81  UCHAR Lun;
82  UCHAR CdbLength;
83  UCHAR SenseInfoLength;
84  UCHAR DataIn;
85  ULONG DataTransferLength;
86  ULONG TimeOutValue;
87  ULONG32 DataBufferOffset;
88  ULONG SenseInfoOffset;
89  UCHAR Cdb[16];
90  } SCSI_PASS_THROUGH32,*PSCSI_PASS_THROUGH32;
91 
92  typedef struct _SCSI_PASS_THROUGH_DIRECT32 {
93  USHORT Length;
94  UCHAR ScsiStatus;
95  UCHAR PathId;
97  UCHAR Lun;
98  UCHAR CdbLength;
99  UCHAR SenseInfoLength;
100  UCHAR DataIn;
101  ULONG DataTransferLength;
102  ULONG TimeOutValue;
103  VOID * POINTER_32 DataBuffer;
104  ULONG SenseInfoOffset;
105  UCHAR Cdb[16];
106  } SCSI_PASS_THROUGH_DIRECT32,*PSCSI_PASS_THROUGH_DIRECT32;
107 #endif /* _WIN64 */
108 
109 
110  typedef struct _SCSI_PASS_THROUGH_EX {
128 
129  typedef struct _ATA_PASS_THROUGH_EX {
143 
144  typedef struct _ATA_PASS_THROUGH_DIRECT {
145  USHORT Length;
147  UCHAR PathId;
148  UCHAR TargetId;
149  UCHAR Lun;
158 
159 #if defined(_WIN64)
160 
161  typedef struct _ATA_PASS_THROUGH_EX32 {
162  USHORT Length;
163  USHORT AtaFlags;
164  UCHAR PathId;
165  UCHAR TargetId;
166  UCHAR Lun;
167  UCHAR ReservedAsUchar;
168  ULONG DataTransferLength;
169  ULONG TimeOutValue;
170  ULONG ReservedAsUlong;
171  ULONG32 DataBufferOffset;
172  UCHAR PreviousTaskFile[8];
173  UCHAR CurrentTaskFile[8];
174  } ATA_PASS_THROUGH_EX32,*PATA_PASS_THROUGH_EX32;
175 
176  typedef struct _ATA_PASS_THROUGH_DIRECT32 {
177  USHORT Length;
178  USHORT AtaFlags;
179  UCHAR PathId;
180  UCHAR TargetId;
181  UCHAR Lun;
182  UCHAR ReservedAsUchar;
183  ULONG DataTransferLength;
184  ULONG TimeOutValue;
185  ULONG ReservedAsUlong;
186  VOID * POINTER_32 DataBuffer;
187  UCHAR PreviousTaskFile[8];
188  UCHAR CurrentTaskFile[8];
189  } ATA_PASS_THROUGH_DIRECT32,*PATA_PASS_THROUGH_DIRECT32;
190 #endif /* _WIN64 */
191 
192 #define ATA_FLAGS_DRDY_REQUIRED (1 << 0)
193 #define ATA_FLAGS_DATA_IN (1 << 1)
194 #define ATA_FLAGS_DATA_OUT (1 << 2)
195 #define ATA_FLAGS_48BIT_COMMAND (1 << 3)
196 #define ATA_FLAGS_USE_DMA (1 << 4)
197 
198  typedef struct _SCSI_BUS_DATA {
203 
204  typedef struct _SCSI_ADAPTER_BUS_INFO {
208 
209  typedef struct _SCSI_INQUIRY_DATA {
210  UCHAR PathId;
211  UCHAR TargetId;
212  UCHAR Lun;
216  UCHAR InquiryData[1];
218 
219  typedef struct _SRB_IO_CONTROL {
221  UCHAR Signature[8];
222  ULONG Timeout;
225  ULONG Length;
227 
228  typedef struct _IO_SCSI_CAPABILITIES {
229  ULONG Length;
238 
239  typedef struct _SCSI_ADDRESS {
240  ULONG Length;
242  UCHAR PathId;
243  UCHAR TargetId;
244  UCHAR Lun;
246 
247  struct _ADAPTER_OBJECT;
248 
249  typedef struct _DUMP_POINTERS {
261 
262 #define SCSI_IOCTL_DATA_OUT 0
263 #define SCSI_IOCTL_DATA_IN 1
264 #define SCSI_IOCTL_DATA_UNSPECIFIED 2
265 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif /* _NTDDSCSIH_ */
271 
UCHAR PathId
Definition: scsi_port.h:149
ULONG_PTR DataOutBufferOffset
Definition: ntddscsi.h:124
UCHAR PortNumber
Definition: scsi_port.h:148
ULONG SupportedAsynchronousEvents
Definition: scsi_port.h:139
unsigned int ULONG32
Definition: basetsd.h:125
PVOID MappedRegisterBase
Definition: scsi_port.h:160
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1117
#define ANYSIZE_ARRAY
Definition: typedefs.h:45
#define POINTER_32
Definition: basetsd.h:38
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1117
ULONG_PTR DataBufferOffset
Definition: ntddscsi.h:54
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1117
struct _SCSI_PASS_THROUGH_DIRECT * PSCSI_PASS_THROUGH_DIRECT
BOOLEAN AdapterScansDown
Definition: scsi_port.h:142
ULONG Length
Definition: scsi_port.h:147
struct _SCSI_INQUIRY_DATA SCSI_INQUIRY_DATA
struct _IO_SCSI_CAPABILITIES * PIO_SCSI_CAPABILITIES
ULONG_PTR DataBufferOffset
Definition: ntddscsi.h:139
ULONG DataInTransferLength
Definition: ntddscsi.h:123
ULONG ControlCode
Definition: scsi_port.h:128
ULONG SenseInfoOffset
Definition: scsi_port.h:70
PVOID CommonBufferVa
Definition: scsi_port.h:162
ULONG NextInquiryDataOffset
Definition: scsi_port.h:118
struct _SCSI_PASS_THROUGH_EX SCSI_PASS_THROUGH_EX
UCHAR TargetId
Definition: scsi_port.h:150
UCHAR PreviousTaskFile[8]
Definition: ntddscsi.h:140
struct _SCSI_ADDRESS * PSCSI_ADDRESS
uint32_t ULONG_PTR
Definition: typedefs.h:63
SCSI_BUS_DATA BusData[1]
Definition: scsi_port.h:106
struct _SRB_IO_CONTROL SRB_IO_CONTROL
UCHAR Cdb[16]
Definition: scsi_port.h:71
ULONG DataTransferLength
Definition: scsi_port.h:67
ULONG ReturnCode
Definition: scsi_port.h:129
ULONG CommonBufferSize
Definition: scsi_port.h:164
UCHAR SenseInfoLength
Definition: scsi_port.h:65
UCHAR Cdb[ANYSIZE_ARRAY]
Definition: ntddscsi.h:126
struct _ATA_PASS_THROUGH_EX * PATA_PASS_THROUGH_EX
unsigned char BOOLEAN
BOOLEAN UseDiskDump
Definition: ntddscsi.h:257
ULONG InquiryDataOffset
Definition: scsi_port.h:98
struct _SCSI_PASS_THROUGH_DIRECT SCSI_PASS_THROUGH_DIRECT
struct _SCSI_PASS_THROUGH_EX * PSCSI_PASS_THROUGH_EX
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
struct _SCSI_ADDRESS SCSI_ADDRESS
struct _DUMP_POINTERS * PDUMP_POINTERS
ULONG DataTransferLength
Definition: ntddscsi.h:136
BOOLEAN AllocateCommonBuffers
Definition: ntddscsi.h:256
struct _ATA_PASS_THROUGH_DIRECT * PATA_PASS_THROUGH_DIRECT
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct _ADAPTER_OBJECT * AdapterObject
Definition: scsi_port.h:159
struct _SCSI_BUS_DATA * PSCSI_BUS_DATA
LARGE_INTEGER CommonBufferPa
Definition: scsi_port.h:163
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _SCSI_ADAPTER_BUS_INFO SCSI_ADAPTER_BUS_INFO
struct _SRB_IO_CONTROL * PSRB_IO_CONTROL
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
struct _SCSI_PASS_THROUGH * PSCSI_PASS_THROUGH
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
UCHAR InquiryData[1]
Definition: scsi_port.h:119
struct _ATA_PASS_THROUGH_EX ATA_PASS_THROUGH_EX
UCHAR Spare1[2]
Definition: ntddscsi.h:258
struct _DUMP_POINTERS DUMP_POINTERS
unsigned short USHORT
Definition: pedump.c:61
ULONG InquiryDataLength
Definition: scsi_port.h:117
UCHAR CurrentTaskFile[8]
Definition: ntddscsi.h:141
UCHAR InitiatorBusId
Definition: scsi_port.h:97
ULONG_PTR DataInBufferOffset
Definition: ntddscsi.h:125
PVOID DumpData
Definition: ntddscsi.h:252
struct _SCSI_BUS_DATA SCSI_BUS_DATA
BOOLEAN DeviceClaimed
Definition: scsi_port.h:116
UCHAR Signature[8]
Definition: scsi_port.h:126
unsigned int ULONG
Definition: retypes.h:1
UCHAR NumberOfLogicalUnits
Definition: scsi_port.h:96
ULONG HeaderLength
Definition: scsi_port.h:125
struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH
PVOID DeviceObject
Definition: ntddscsi.h:259
ULONG DataOutTransferLength
Definition: ntddscsi.h:122
struct _ATA_PASS_THROUGH_DIRECT ATA_PASS_THROUGH_DIRECT