ReactOS 0.4.15-dev-5667-ged97270
ntddscsi.h
Go to the documentation of this file.
1
6#ifdef DEFINE_GUID
7
8#ifndef FAR
9#define FAR
10#endif
11
12DEFINE_GUID(ScsiRawInterfaceGuid,0x53f56309L,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b);
13DEFINE_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
20extern "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 {
48 UCHAR Lun;
56 UCHAR Cdb[16];
58
59 typedef struct _SCSI_PASS_THROUGH_DIRECT {
64 UCHAR Lun;
72 UCHAR Cdb[16];
74
75#if defined(_WIN64)
76 typedef struct _SCSI_PASS_THROUGH32 {
78 UCHAR ScsiStatus;
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 {
94 UCHAR ScsiStatus;
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
130{
148
149#if defined(_WIN64)
150typedef struct _SCSI_PASS_THROUGH32_EX
151{
154 ULONG CdbLength;
155 ULONG StorAddressLength;
156 UCHAR ScsiStatus;
157 UCHAR SenseInfoLength;
158 UCHAR DataDirection;
160 ULONG TimeOutValue;
161 ULONG StorAddressOffset;
162 ULONG SenseInfoOffset;
163 ULONG DataOutTransferLength;
164 ULONG DataInTransferLength;
165 ULONG32 DataOutBufferOffset;
166 ULONG32 DataInBufferOffset;
168} SCSI_PASS_THROUGH32_EX, *PSCSI_PASS_THROUGH32_EX;
169
170typedef struct _SCSI_PASS_THROUGH_DIRECT32_EX
171{
174 ULONG CdbLength;
175 ULONG StorAddressLength;
176 UCHAR ScsiStatus;
177 UCHAR SenseInfoLength;
178 UCHAR DataDirection;
180 ULONG TimeOutValue;
181 ULONG StorAddressOffset;
182 ULONG SenseInfoOffset;
183 ULONG DataOutTransferLength;
184 ULONG DataInTransferLength;
185 VOID * POINTER_32 DataOutBuffer;
186 VOID * POINTER_32 DataInBuffer;
188} SCSI_PASS_THROUGH_DIRECT32_EX, *PSCSI_PASS_THROUGH_DIRECT32_EX;
189#endif
190
191 typedef struct _ATA_PASS_THROUGH_EX {
205
206 typedef struct _ATA_PASS_THROUGH_DIRECT {
211 UCHAR Lun;
220
221#if defined(_WIN64)
222
223 typedef struct _ATA_PASS_THROUGH_EX32 {
225 USHORT AtaFlags;
228 UCHAR Lun;
229 UCHAR ReservedAsUchar;
230 ULONG DataTransferLength;
231 ULONG TimeOutValue;
232 ULONG ReservedAsUlong;
233 ULONG32 DataBufferOffset;
234 UCHAR PreviousTaskFile[8];
235 UCHAR CurrentTaskFile[8];
236 } ATA_PASS_THROUGH_EX32,*PATA_PASS_THROUGH_EX32;
237
238 typedef struct _ATA_PASS_THROUGH_DIRECT32 {
240 USHORT AtaFlags;
243 UCHAR Lun;
244 UCHAR ReservedAsUchar;
245 ULONG DataTransferLength;
246 ULONG TimeOutValue;
247 ULONG ReservedAsUlong;
248 VOID * POINTER_32 DataBuffer;
249 UCHAR PreviousTaskFile[8];
250 UCHAR CurrentTaskFile[8];
251 } ATA_PASS_THROUGH_DIRECT32,*PATA_PASS_THROUGH_DIRECT32;
252#endif /* _WIN64 */
253
254#define ATA_FLAGS_DRDY_REQUIRED (1 << 0)
255#define ATA_FLAGS_DATA_IN (1 << 1)
256#define ATA_FLAGS_DATA_OUT (1 << 2)
257#define ATA_FLAGS_48BIT_COMMAND (1 << 3)
258#define ATA_FLAGS_USE_DMA (1 << 4)
259
260 typedef struct _SCSI_BUS_DATA {
265
266 typedef struct _SCSI_ADAPTER_BUS_INFO {
270
271 typedef struct _SCSI_INQUIRY_DATA {
274 UCHAR Lun;
280
281 typedef struct _SRB_IO_CONTROL {
283 UCHAR Signature[8];
289
290 typedef struct _IO_SCSI_CAPABILITIES {
300
301 typedef struct _SCSI_ADDRESS {
306 UCHAR Lun;
308
309 struct _ADAPTER_OBJECT;
310
311 typedef struct _DUMP_POINTERS {
323
324#define SCSI_IOCTL_DATA_OUT 0
325#define SCSI_IOCTL_DATA_IN 1
326#define SCSI_IOCTL_DATA_UNSPECIFIED 2
327
328#ifdef __cplusplus
329}
330#endif
331
332#endif /* _NTDDSCSIH_ */
333
unsigned char BOOLEAN
#define POINTER_32
Definition: basetsd.h:38
unsigned int ULONG32
Definition: basetsd.h:125
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1315
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1313
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1314
struct _SCSI_PASS_THROUGH_DIRECT * PSCSI_PASS_THROUGH_DIRECT
struct _SCSI_PASS_THROUGH * PSCSI_PASS_THROUGH
struct _IO_SCSI_CAPABILITIES * PIO_SCSI_CAPABILITIES
struct _SCSI_PASS_THROUGH_DIRECT SCSI_PASS_THROUGH_DIRECT
struct _SCSI_INQUIRY_DATA SCSI_INQUIRY_DATA
struct _SCSI_ADAPTER_BUS_INFO SCSI_ADAPTER_BUS_INFO
struct _SRB_IO_CONTROL * PSRB_IO_CONTROL
struct _SCSI_ADDRESS * PSCSI_ADDRESS
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
struct _SCSI_BUS_DATA SCSI_BUS_DATA
struct _SCSI_ADDRESS SCSI_ADDRESS
struct _SCSI_BUS_DATA * PSCSI_BUS_DATA
struct _DUMP_POINTERS * PDUMP_POINTERS
struct _SRB_IO_CONTROL SRB_IO_CONTROL
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
struct _DUMP_POINTERS DUMP_POINTERS
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
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
_In_opt_ WDFREQUEST _In_ ULONG _In_ BOOLEAN _In_ PCDB Cdb
Definition: scratch.h:159
struct _ATA_PASS_THROUGH_DIRECT ATA_PASS_THROUGH_DIRECT
struct _SCSI_PASS_THROUGH_DIRECT_EX SCSI_PASS_THROUGH_DIRECT_EX
struct _ATA_PASS_THROUGH_EX * PATA_PASS_THROUGH_EX
struct _ATA_PASS_THROUGH_DIRECT * PATA_PASS_THROUGH_DIRECT
struct _SCSI_PASS_THROUGH_DIRECT_EX * PSCSI_PASS_THROUGH_DIRECT_EX
struct _SCSI_PASS_THROUGH_EX SCSI_PASS_THROUGH_EX
struct _SCSI_PASS_THROUGH_EX * PSCSI_PASS_THROUGH_EX
struct _ATA_PASS_THROUGH_EX ATA_PASS_THROUGH_EX
ULONG DataTransferLength
Definition: ntddscsi.h:198
UCHAR CurrentTaskFile[8]
Definition: ntddscsi.h:203
UCHAR PreviousTaskFile[8]
Definition: ntddscsi.h:202
ULONG_PTR DataBufferOffset
Definition: ntddscsi.h:201
PVOID CommonBufferVa
Definition: scsi_port.h:162
PVOID DeviceObject
Definition: ntddscsi.h:321
BOOLEAN AllocateCommonBuffers
Definition: ntddscsi.h:318
BOOLEAN UseDiskDump
Definition: ntddscsi.h:319
LARGE_INTEGER CommonBufferPa
Definition: scsi_port.h:163
PVOID DumpData
Definition: ntddscsi.h:314
UCHAR Spare1[2]
Definition: ntddscsi.h:320
struct _ADAPTER_OBJECT * AdapterObject
Definition: scsi_port.h:159
PVOID MappedRegisterBase
Definition: scsi_port.h:160
ULONG CommonBufferSize
Definition: scsi_port.h:164
BOOLEAN AdapterScansDown
Definition: scsi_port.h:142
ULONG SupportedAsynchronousEvents
Definition: scsi_port.h:139
SCSI_BUS_DATA BusData[1]
Definition: scsi_port.h:106
UCHAR PathId
Definition: scsi_port.h:149
UCHAR TargetId
Definition: scsi_port.h:150
ULONG Length
Definition: scsi_port.h:147
UCHAR PortNumber
Definition: scsi_port.h:148
ULONG InquiryDataOffset
Definition: scsi_port.h:98
UCHAR NumberOfLogicalUnits
Definition: scsi_port.h:96
UCHAR InitiatorBusId
Definition: scsi_port.h:97
UCHAR InquiryData[1]
Definition: scsi_port.h:119
ULONG NextInquiryDataOffset
Definition: scsi_port.h:118
ULONG InquiryDataLength
Definition: scsi_port.h:117
BOOLEAN DeviceClaimed
Definition: scsi_port.h:116
UCHAR Cdb[ANYSIZE_ARRAY]
Definition: ntddscsi.h:146
ULONG_PTR DataInBufferOffset
Definition: ntddscsi.h:125
UCHAR Cdb[ANYSIZE_ARRAY]
Definition: ntddscsi.h:126
ULONG DataInTransferLength
Definition: ntddscsi.h:123
ULONG DataOutTransferLength
Definition: ntddscsi.h:122
ULONG_PTR DataOutBufferOffset
Definition: ntddscsi.h:124
UCHAR SenseInfoLength
Definition: scsi_port.h:65
UCHAR Cdb[16]
Definition: scsi_port.h:71
ULONG DataTransferLength
Definition: scsi_port.h:67
ULONG_PTR DataBufferOffset
Definition: ntddscsi.h:54
ULONG SenseInfoOffset
Definition: scsi_port.h:70
UCHAR Signature[8]
Definition: scsi_port.h:126
ULONG ControlCode
Definition: scsi_port.h:128
ULONG HeaderLength
Definition: scsi_port.h:125
ULONG ReturnCode
Definition: scsi_port.h:129
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181