1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Constants and types for accessing SCSI port adapters.
7 use shared::basetsd::{ULONG32, ULONG_PTR};
8 use shared::minwindef::{UCHAR, ULONG, USHORT};
9 use shared::ntdef::{LARGE_INTEGER, LONG, LONGLONG, PVOID, ULONGLONG, VOID, WCHAR};
10 use um::winioctl::{
11     DEVICE_TYPE, FILE_ANY_ACCESS, FILE_DEVICE_CONTROLLER, FILE_READ_ACCESS,
12     FILE_WRITE_ACCESS, METHOD_BUFFERED
13 };
14 use um::winnt::{ANYSIZE_ARRAY, BOOLEAN, PBOOLEAN};
15 DEFINE_GUID!{ScsiRawInterfaceGuid,
16     0x53f56309, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b}
17 DEFINE_GUID!{WmiScsiAddressGuid,
18     0x53f5630f, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b}
19 pub const IOCTL_SCSI_BASE: DEVICE_TYPE = FILE_DEVICE_CONTROLLER;
20 pub const FILE_DEVICE_SCSI: ULONG = 0x0000001;
21 pub const DD_SCSI_DEVICE_NAME: &'static str = "\\Device\\ScsiPort";
22 pub const IOCTL_SCSI_PASS_THROUGH: ULONG =
23     CTL_CODE!(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
24 pub const IOCTL_SCSI_MINIPORT: ULONG =
25     CTL_CODE!(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
26 pub const IOCTL_SCSI_GET_INQUIRY_DATA: ULONG =
27     CTL_CODE!(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS);
28 pub const IOCTL_SCSI_GET_CAPABILITIES: ULONG =
29     CTL_CODE!(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS);
30 pub const IOCTL_SCSI_PASS_THROUGH_DIRECT: ULONG =
31     CTL_CODE!(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
32 pub const IOCTL_SCSI_GET_ADDRESS: ULONG =
33     CTL_CODE!(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS);
34 pub const IOCTL_SCSI_RESCAN_BUS: ULONG =
35     CTL_CODE!(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS);
36 pub const IOCTL_SCSI_GET_DUMP_POINTERS: ULONG =
37     CTL_CODE!(IOCTL_SCSI_BASE, 0x0408, METHOD_BUFFERED, FILE_ANY_ACCESS);
38 pub const IOCTL_SCSI_FREE_DUMP_POINTERS: ULONG =
39     CTL_CODE!(IOCTL_SCSI_BASE, 0x0409, METHOD_BUFFERED, FILE_ANY_ACCESS);
40 pub const IOCTL_IDE_PASS_THROUGH: ULONG =
41     CTL_CODE!(IOCTL_SCSI_BASE, 0x040a, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
42 pub const IOCTL_ATA_PASS_THROUGH: ULONG =
43     CTL_CODE!(IOCTL_SCSI_BASE, 0x040b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
44 pub const IOCTL_ATA_PASS_THROUGH_DIRECT: ULONG =
45     CTL_CODE!(IOCTL_SCSI_BASE, 0x040c, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
46 pub const IOCTL_ATA_MINIPORT: ULONG =
47     CTL_CODE!(IOCTL_SCSI_BASE, 0x040d, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
48 pub const IOCTL_MINIPORT_PROCESS_SERVICE_IRP: ULONG =
49     CTL_CODE!(IOCTL_SCSI_BASE, 0x040e, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
50 pub const IOCTL_MPIO_PASS_THROUGH_PATH: ULONG =
51     CTL_CODE!(IOCTL_SCSI_BASE, 0x040f, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
52 pub const IOCTL_MPIO_PASS_THROUGH_PATH_DIRECT: ULONG =
53     CTL_CODE!(IOCTL_SCSI_BASE, 0x0410, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
54 pub const IOCTL_SCSI_PASS_THROUGH_EX: ULONG =
55     CTL_CODE!(IOCTL_SCSI_BASE, 0x0411, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
56 pub const IOCTL_SCSI_PASS_THROUGH_DIRECT_EX: ULONG =
57     CTL_CODE!(IOCTL_SCSI_BASE, 0x0412, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
58 pub const IOCTL_MPIO_PASS_THROUGH_PATH_EX: ULONG =
59     CTL_CODE!(IOCTL_SCSI_BASE, 0x0413, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
60 pub const IOCTL_MPIO_PASS_THROUGH_PATH_DIRECT_EX: ULONG =
61     CTL_CODE!(IOCTL_SCSI_BASE, 0x0414, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS);
62 pub const IOCTL_SCSI_MINIPORT_NVCACHE: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0600;
63 pub const IOCTL_SCSI_MINIPORT_HYBRID: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0620;
64 pub const IOCTL_SCSI_MINIPORT_FIRMWARE: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0780;
65 STRUCT!{struct SCSI_PASS_THROUGH {
66     Length: USHORT,
67     ScsiStatus: UCHAR,
68     PathId: UCHAR,
69     TargetId: UCHAR,
70     Lun: UCHAR,
71     CdbLength: UCHAR,
72     SenseInfoLength: UCHAR,
73     DataIn: UCHAR,
74     DataTransferLength: ULONG,
75     TimeOutValue: ULONG,
76     DataBufferOffset: ULONG_PTR,
77     SenseInfoOffset: ULONG,
78     Cdb: [UCHAR; 16],
79 }}
80 pub type PSCSI_PASS_THROUGH = *mut SCSI_PASS_THROUGH;
81 STRUCT!{struct SCSI_PASS_THROUGH_DIRECT {
82     Length: USHORT,
83     ScsiStatus: UCHAR,
84     PathId: UCHAR,
85     TargetId: UCHAR,
86     Lun: UCHAR,
87     CdbLength: UCHAR,
88     SenseInfoLength: UCHAR,
89     DataIn: UCHAR,
90     DataTransferLength: ULONG,
91     TimeOutValue: ULONG,
92     DataBuffer: PVOID,
93     SenseInfoOffset: ULONG,
94     Cdb: [UCHAR; 16],
95 }}
96 pub type PSCSI_PASS_THROUGH_DIRECT = *mut SCSI_PASS_THROUGH_DIRECT;
97 STRUCT!{struct SCSI_PASS_THROUGH32 {
98     Length: USHORT,
99     ScsiStatus: UCHAR,
100     PathId: UCHAR,
101     TargetId: UCHAR,
102     Lun: UCHAR,
103     CdbLength: UCHAR,
104     SenseInfoLength: UCHAR,
105     DataIn: UCHAR,
106     DataTransferLength: ULONG,
107     TimeOutValue: ULONG,
108     DataBufferOffset: ULONG32,
109     SenseInfoOffset: ULONG,
110     Cdb: [UCHAR; 16],
111 }}
112 #[cfg(target_arch = "x86_64")]
113 IFDEF!{
114 pub type PSCSI_PASS_THROUGH32 = *mut SCSI_PASS_THROUGH32;
115 STRUCT!{struct SCSI_PASS_THROUGH_DIRECT32 {
116     Length: USHORT,
117     ScsiStatus: UCHAR,
118     PathId: UCHAR,
119     TargetId: UCHAR,
120     Lun: UCHAR,
121     CdbLength: UCHAR,
122     SenseInfoLength: UCHAR,
123     DataIn: UCHAR,
124     DataTransferLength: ULONG,
125     TimeOutValue: ULONG,
126     DataBuffer: ULONG32, // Rust doesn't have anything like __ptr32
127     SenseInfoOffset: ULONG,
128     Cdb: [UCHAR; 16],
129 }}
130 pub type PSCSI_PASS_THROUGH_DIRECT32 = *mut SCSI_PASS_THROUGH_DIRECT32;
131 }
132 STRUCT!{struct SCSI_PASS_THROUGH_EX {
133     Version: ULONG,
134     Length: ULONG,
135     CdbLength: ULONG,
136     StorAddressLength: ULONG,
137     ScsiStatus: UCHAR,
138     SenseInfolength: UCHAR,
139     DataDirection: UCHAR,
140     Reserved: UCHAR,
141     TimeOutValue: ULONG,
142     StorAddressOffset: ULONG,
143     SenseInfoOffset: ULONG,
144     DataOutTransferLength: ULONG,
145     DataInTransferLength: ULONG,
146     DataOutBufferOffset: ULONG_PTR,
147     DataInBufferOffset: ULONG_PTR,
148     Cdb: [UCHAR; ANYSIZE_ARRAY],
149 }}
150 pub type PSCSI_PASS_THROUGH_EX = *mut SCSI_PASS_THROUGH_EX;
151 STRUCT!{struct SCSI_PASS_THROUGH_DIRECT_EX {
152     Version: ULONG,
153     Length: ULONG,
154     CdbLength: ULONG,
155     StorAddressLength: ULONG,
156     ScsiStatus: UCHAR,
157     SenseInfolength: UCHAR,
158     DataDirection: UCHAR,
159     Reserved: UCHAR,
160     TimeOutValue: ULONG,
161     StorAddressOffset: ULONG,
162     SenseInfoOffset: ULONG,
163     DataOutTransferLength: ULONG,
164     DataInTransferLength: ULONG,
165     DataOutBuffer: *mut VOID,
166     DataInBuffer: *mut VOID,
167     Cdb: [UCHAR; ANYSIZE_ARRAY],
168 }}
169 pub type PSCSI_PASS_THROUGH_DIRECT_EX = *mut SCSI_PASS_THROUGH_DIRECT_EX;
170 #[cfg(target_arch = "x86_64")]
171 IFDEF!{
172 STRUCT!{struct SCSI_PASS_THROUGH32_EX {
173     Version: ULONG,
174     Length: ULONG,
175     CdbLength: ULONG,
176     StorAddressLength: ULONG,
177     ScsiStatus: UCHAR,
178     SenseInfolength: UCHAR,
179     DataDirection: UCHAR,
180     Reserved: UCHAR,
181     TimeOutValue: ULONG,
182     StorAddressOffset: ULONG,
183     SenseInfoOffset: ULONG,
184     DataOutTransferLength: ULONG,
185     DataInTransferLength: ULONG,
186     DataOutBufferOffset: ULONG32,
187     DataInBufferOffset: ULONG32,
188     Cdb: [UCHAR; ANYSIZE_ARRAY],
189 }}
190 pub type PSCSI_PASS_THROUGH32_EX = *mut SCSI_PASS_THROUGH32_EX;
191 STRUCT!{struct SCSI_PASS_THROUGH_DIRECT32_EX {
192     Version: ULONG,
193     Length: ULONG,
194     CdbLength: ULONG,
195     StorAddressLength: ULONG,
196     ScsiStatus: UCHAR,
197     SenseInfolength: UCHAR,
198     DataDirection: UCHAR,
199     Reserved: UCHAR,
200     TimeOutValue: ULONG,
201     StorAddressOffset: ULONG,
202     SenseInfoOffset: ULONG,
203     DataOutTransferLength: ULONG,
204     DataInTransferLength: ULONG,
205     DataOutBuffer: ULONG32,
206     DataInBuffer: ULONG32,
207     Cdb: [UCHAR; ANYSIZE_ARRAY],
208 }}
209 pub type PSCSI_PASS_THROUGH_DIRECT32_EX = *mut SCSI_PASS_THROUGH_DIRECT32_EX;
210 }
211 STRUCT!{struct ATA_PASS_THROUGH_EX {
212     Length: USHORT,
213     AtaFlags: USHORT,
214     PathId: UCHAR,
215     TargetId: UCHAR,
216     Lun: UCHAR,
217     ReservedAsUchar: UCHAR,
218     DataTransferLength: ULONG,
219     TimeOutValue: ULONG,
220     ReservedAsUlong: ULONG,
221     DataBufferOffset: ULONG_PTR,
222     PreviousTaskFile: [UCHAR; 8],
223     CurrentTaskFile: [UCHAR; 8],
224 }}
225 pub type PATA_PASS_THROUGH_EX = *mut ATA_PASS_THROUGH_EX;
226 STRUCT!{struct ATA_PASS_THROUGH_DIRECT {
227     Length: USHORT,
228     AtaFlags: USHORT,
229     PathId: UCHAR,
230     TargetId: UCHAR,
231     Lun: UCHAR,
232     ReservedAsUchar: UCHAR,
233     DataTransferLength: ULONG,
234     TimeOutValue: ULONG,
235     ReservedAsUlong: ULONG,
236     DataBuffer: PVOID,
237     PreviousTaskFile: [UCHAR; 8],
238     CurrentTaskFile: [UCHAR; 8],
239 }}
240 pub type PATA_PASS_THROUGH_DIRECT = *mut ATA_PASS_THROUGH_DIRECT;
241 #[cfg(target_arch = "x86_64")]
242 IFDEF!{
243 STRUCT!{struct ATA_PASS_THROUGH_EX32 {
244     Length: USHORT,
245     AtaFlags: USHORT,
246     PathId: UCHAR,
247     TargetId: UCHAR,
248     Lun: UCHAR,
249     ReservedAsUchar: UCHAR,
250     DataTransferLength: ULONG,
251     TimeOutValue: ULONG,
252     ReservedAsUlong: ULONG,
253     DataBufferOffset: ULONG32,
254     PreviousTaskFile: [UCHAR; 8],
255     CurrentTaskFile: [UCHAR; 8],
256 }}
257 pub type PATA_PASS_THROUGH_EX32 = *mut ATA_PASS_THROUGH_EX32;
258 STRUCT!{struct ATA_PASS_THROUGH_DIRECT32 {
259     Length: USHORT,
260     AtaFlags: USHORT,
261     PathId: UCHAR,
262     TargetId: UCHAR,
263     Lun: UCHAR,
264     ReservedAsUchar: UCHAR,
265     DataTransferLength: ULONG,
266     TimeOutValue: ULONG,
267     ReservedAsUlong: ULONG,
268     DataBuffer: ULONG32,
269     PreviousTaskFile: [UCHAR; 8],
270     CurrentTaskFile: [UCHAR; 8],
271 }}
272 pub type PATA_PASS_THROUGH_DIRECT32 = *mut ATA_PASS_THROUGH_DIRECT32;
273 }
274 pub const ATA_FLAGS_DRDY_REQUIRED: USHORT = 1 << 0;
275 pub const ATA_FLAGS_DATA_IN: USHORT = 1 << 1;
276 pub const ATA_FLAGS_DATA_OUT: USHORT = 1 << 2;
277 pub const ATA_FLAGS_48BIT_COMMAND: USHORT = 1 << 3;
278 pub const ATA_FLAGS_USE_DMA: USHORT = 1 << 4;
279 pub const ATA_FLAGS_NO_MULTIPLE: USHORT = 1 << 5;
280 STRUCT!{struct IDE_IO_CONTROL {
281     HeaderLength: ULONG,
282     Signature: [UCHAR; 8],
283     Timeout: ULONG,
284     ControlCode: ULONG,
285     ReturnStatus: ULONG,
286     DataLength: ULONG,
287 }}
288 pub type PIDE_IO_CONTROL = *mut IDE_IO_CONTROL;
289 STRUCT!{struct MPIO_PASS_THROUGH_PATH {
290     PassThrough: SCSI_PASS_THROUGH,
291     Version: ULONG,
292     Length: USHORT,
293     Flags: UCHAR,
294     PortNumber: UCHAR,
295     MpioPathId: ULONGLONG,
296 }}
297 pub type PMPIO_PASS_THROUGH_PATH = *mut MPIO_PASS_THROUGH_PATH;
298 STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT {
299     PassThrough: SCSI_PASS_THROUGH_DIRECT,
300     Version: ULONG,
301     Length: USHORT,
302     Flags: UCHAR,
303     PortNumber: UCHAR,
304     MpioPathId: ULONGLONG,
305 }}
306 pub type PMPIO_PASS_THROUGH_PATH_DIRECT = *mut MPIO_PASS_THROUGH_PATH_DIRECT;
307 STRUCT!{struct MPIO_PASS_THROUGH_PATH_EX {
308     PassThroughOffset: ULONG,
309     Version: ULONG,
310     Length: USHORT,
311     Flags: UCHAR,
312     PortNumber: UCHAR,
313     MpioPathId: ULONGLONG,
314 }}
315 pub type PMPIO_PASS_THROUGH_PATH_EX = *mut MPIO_PASS_THROUGH_PATH_EX;
316 STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT_EX {
317     PassThroughOffset: ULONG,
318     Version: ULONG,
319     Length: USHORT,
320     Flags: UCHAR,
321     PortNumber: UCHAR,
322     MpioPathId: ULONGLONG,
323 }}
324 pub type PMPIO_PASS_THROUGH_PATH_DIRECT_EX = *mut MPIO_PASS_THROUGH_PATH_DIRECT_EX;
325 #[cfg(target_arch = "x86_64")]
326 IFDEF!{
327 STRUCT!{struct MPIO_PASS_THROUGH_PATH32 {
328     PassThrough: SCSI_PASS_THROUGH32,
329     Version: ULONG,
330     Length: USHORT,
331     Flags: UCHAR,
332     PortNumber: UCHAR,
333     MpioPathId: ULONGLONG,
334 }}
335 pub type PMPIO_PASS_THROUGH_PATH32 = *mut MPIO_PASS_THROUGH_PATH32;
336 STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT32 {
337     PassThrough: SCSI_PASS_THROUGH_DIRECT32,
338     Version: ULONG,
339     Length: USHORT,
340     Flags: UCHAR,
341     PortNumber: UCHAR,
342     MpioPathId: ULONGLONG,
343 }}
344 pub type PMPIO_PASS_THROUGH_PATH_DIRECT32 = *mut MPIO_PASS_THROUGH_PATH_DIRECT32;
345 STRUCT!{struct MPIO_PASS_THROUGH_PATH32_EX {
346     PassThroughOffset: ULONG,
347     Version: ULONG,
348     Length: USHORT,
349     Flags: UCHAR,
350     PortNumber: UCHAR,
351     MpioPathId: ULONGLONG,
352 }}
353 pub type PMPIO_PASS_THROUGH_PATH32_EX = *mut MPIO_PASS_THROUGH_PATH32_EX;
354 STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT32_EX {
355     PassThroughOffset: ULONG,
356     Version: ULONG,
357     Length: USHORT,
358     Flags: UCHAR,
359     PortNumber: UCHAR,
360     MpioPathId: ULONGLONG,
361 }}
362 pub type PMPIO_PASS_THROUGH_PATH_DIRECT32_EX = *mut MPIO_PASS_THROUGH_PATH_DIRECT32_EX;
363 }
364 STRUCT!{struct SCSI_BUS_DATA {
365     NumberOfLogicalUnits: UCHAR,
366     InitiatorBusId: UCHAR,
367     InquiryDataOffset: ULONG,
368 }}
369 pub type PSCSI_BUS_DATA = *mut SCSI_BUS_DATA;
370 STRUCT!{struct SCSI_ADAPTER_BUS_INFO {
371     NumberOfBuses: UCHAR,
372     BusData: [SCSI_BUS_DATA; 1],
373 }}
374 pub type PSCSI_ADAPTER_BUS_INFO = *mut SCSI_ADAPTER_BUS_INFO;
375 STRUCT!{struct SCSI_INQUIRY_DATA {
376     PathId: UCHAR,
377     TargetId: UCHAR,
378     Lun: UCHAR,
379     DeviceClaimed: BOOLEAN,
380     InquiryDataLength: ULONG,
381     NextInquiryDataOffset: ULONG,
382     InquiryData: [UCHAR; 1],
383 }}
384 pub type PSCSI_INQUIRY_DATA = *mut SCSI_INQUIRY_DATA;
385 pub const IOCTL_MINIPORT_SIGNATURE_SCSIDISK: &'static str = "SCSIDISK";
386 pub const IOCTL_MINIPORT_SIGNATURE_HYBRDISK: &'static str = "HYBRDISK";
387 pub const IOCTL_MINIPORT_SIGNATURE_DSM_NOTIFICATION: &'static str = "MPDSM   ";
388 pub const IOCTL_MINIPORT_SIGNATURE_DSM_GENERAL: &'static str = "MPDSMGEN";
389 pub const IOCTL_MINIPORT_SIGNATURE_FIRMWARE: &'static str = "FIRMWARE";
390 pub const IOCTL_MINIPORT_SIGNATURE_QUERY_PROTOCOL: &'static str = "PROTOCOL";
391 pub const IOCTL_MINIPORT_SIGNATURE_QUERY_TEMPERATURE: &'static str = "TEMPERAT";
392 pub const IOCTL_MINIPORT_SIGNATURE_SET_TEMPERATURE_THRESHOLD: &'static str = "SETTEMPT";
393 pub const IOCTL_MINIPORT_SIGNATURE_QUERY_PHYSICAL_TOPOLOGY: &'static str = "TOPOLOGY";
394 STRUCT!{struct SRB_IO_CONTROL {
395     HeaderLength: ULONG,
396     Signature: [UCHAR; 8],
397     Timeout: ULONG,
398     ControlCode: ULONG,
399     ReturnCode: ULONG,
400     Length: ULONG,
401 }}
402 pub type PSRB_IO_CONTROL = *mut SRB_IO_CONTROL;
403 STRUCT!{struct NVCACHE_REQUEST_BLOCK {
404     NRBSize: ULONG,
405     Function: USHORT,
406     NRBFlags: ULONG,
407     NRBStatus: ULONG,
408     Count: ULONG,
409     LBA: ULONGLONG,
410     DataBufSize: ULONG,
411     NVCacheStatus: ULONG,
412     NVCacheSubStatus: ULONG,
413 }}
414 pub type PNVCACHE_REQUEST_BLOCK = *mut NVCACHE_REQUEST_BLOCK;
415 pub const NRB_FUNCTION_NVCACHE_INFO: USHORT = 0xEC;
416 pub const NRB_FUNCTION_SPINDLE_STATUS: USHORT = 0xE5;
417 pub const NRB_FUNCTION_NVCACHE_POWER_MODE_SET: USHORT = 0x00;
418 pub const NRB_FUNCTION_NVCACHE_POWER_MODE_RETURN: USHORT = 0x01;
419 pub const NRB_FUNCTION_FLUSH_NVCACHE: USHORT = 0x14;
420 pub const NRB_FUNCTION_QUERY_PINNED_SET: USHORT = 0x12;
421 pub const NRB_FUNCTION_QUERY_CACHE_MISS: USHORT = 0x13;
422 pub const NRB_FUNCTION_ADD_LBAS_PINNED_SET: USHORT = 0x10;
423 pub const NRB_FUNCTION_REMOVE_LBAS_PINNED_SET: USHORT = 0x11;
424 pub const NRB_FUNCTION_QUERY_ASCENDER_STATUS: USHORT = 0xD0;
425 pub const NRB_FUNCTION_QUERY_HYBRID_DISK_STATUS: USHORT = 0xD1;
426 pub const NRB_FUNCTION_PASS_HINT_PAYLOAD: USHORT = 0xE0;
427 pub const NRB_FUNCTION_NVSEPARATED_INFO: USHORT = 0xc0;
428 pub const NRB_FUNCTION_NVSEPARATED_FLUSH: USHORT = 0xc1;
429 pub const NRB_FUNCTION_NVSEPARATED_WB_DISABLE: USHORT = 0xc2;
430 pub const NRB_FUNCTION_NVSEPARATED_WB_REVERT_DEFAULT: USHORT = 0xc3;
431 pub const NRB_SUCCESS: ULONG = 0;
432 pub const NRB_ILLEGAL_REQUEST: ULONG = 1;
433 pub const NRB_INVALID_PARAMETER: ULONG = 2;
434 pub const NRB_INPUT_DATA_OVERRUN: ULONG = 3;
435 pub const NRB_INPUT_DATA_UNDERRUN: ULONG = 4;
436 pub const NRB_OUTPUT_DATA_OVERRUN: ULONG = 5;
437 pub const NRB_OUTPUT_DATA_UNDERRUN: ULONG = 6;
438 STRUCT!{struct NV_FEATURE_PARAMETER {
439     NVPowerModeEnabled: USHORT,
440     NVParameterReserv1: USHORT,
441     NVCmdEnabled: USHORT,
442     NVParameterReserv2: USHORT,
443     NVPowerModeVer: USHORT,
444     NVCmdVer: USHORT,
445     NVSize: ULONG,
446     NVReadSpeed: USHORT,
447     NVWrtSpeed: USHORT,
448     DeviceSpinUpTime: ULONG,
449 }}
450 pub type PNV_FEATURE_PARAMETER = *mut NV_FEATURE_PARAMETER;
451 STRUCT!{struct NVCACHE_HINT_PAYLOAD {
452     Command: UCHAR,
453     Feature7_0: UCHAR,
454     Feature15_8: UCHAR,
455     Count15_8: UCHAR,
456     LBA7_0: UCHAR,
457     LBA15_8: UCHAR,
458     LBA23_16: UCHAR,
459     LBA31_24: UCHAR,
460     LBA39_32: UCHAR,
461     LBA47_40: UCHAR,
462     Auxiliary7_0: UCHAR,
463     Auxiliary23_16: UCHAR,
464     Reserved: [UCHAR; 4],
465 }}
466 pub type PNVCACHE_HINT_PAYLOAD = *mut NVCACHE_HINT_PAYLOAD;
467 STRUCT!{struct NV_SEP_CACHE_PARAMETER {
468     Version: ULONG,
469     Size: ULONG,
470     Flags: NV_SEP_CACHE_PARAMETER_Flags,
471     WriteCacheType: UCHAR,
472     WriteCacheTypeEffective: UCHAR,
473     ParameterReserve1: [UCHAR; 3],
474 }}
475 pub type PNV_SEP_CACHE_PARAMETER = *mut NV_SEP_CACHE_PARAMETER;
476 UNION!{union NV_SEP_CACHE_PARAMETER_Flags {
477     [u8; 1],
478     CacheFlags CacheFlags_mut: NV_SEP_CACHE_PARAMETER_Flags_CacheFlags,
479     CacheFlagsSet CacheFlagsSet_mut: UCHAR,
480 }}
481 STRUCT!{struct NV_SEP_CACHE_PARAMETER_Flags_CacheFlags {
482     Bitfield: UCHAR,
483 }}
484 BITFIELD!{NV_SEP_CACHE_PARAMETER_Flags_CacheFlags Bitfield: UCHAR [
485     WriteCacheEnabled set_WriteCacheEnabled[0..1],
486     WriteCacheChangeable set_WriteCacheChangeable[1..2],
487     WriteThroughIOSupported set_WriteThroughIOSupported[2..3],
488     FlushCacheSupported set_FlushCacheSupported[3..4],
489     ReservedBits set_ReservedBits[4..8],
490 ]}
491 pub const NV_SEP_CACHE_PARAMETER_VERSION_1: ULONG = 1;
492 pub const NV_SEP_CACHE_PARAMETER_VERSION: ULONG = NV_SEP_CACHE_PARAMETER_VERSION_1;
493 ENUM!{enum NV_SEP_WRITE_CACHE_TYPE {
494     NVSEPWriteCacheTypeUnknown = 0,
495     NVSEPWriteCacheTypeNone = 1,
496     NVSEPWriteCacheTypeWriteBack = 2,
497     NVSEPWriteCacheTypeWriteThrough = 3,
498 }}
499 pub type PNV_SEP_WRITE_CACHE_TYPE = *mut NV_SEP_WRITE_CACHE_TYPE;
500 STRUCT!{struct MP_DEVICE_DATA_SET_RANGE {
501     StartingOffset: LONGLONG,
502     LengthInBytes: ULONGLONG,
503 }}
504 pub type PMP_DEVICE_DATA_SET_RANGE = *mut MP_DEVICE_DATA_SET_RANGE;
505 STRUCT!{struct DSM_NOTIFICATION_REQUEST_BLOCK {
506     Size: ULONG,
507     Version: ULONG,
508     NotifyFlags: ULONG,
509     DataSetProfile: ULONG,
510     Reserved: [ULONG; 3],
511     DataSetRangesCount: ULONG,
512     DataSetRanges: [MP_DEVICE_DATA_SET_RANGE; ANYSIZE_ARRAY],
513 }}
514 pub type PDSM_NOTIFICATION_REQUEST_BLOCK = *mut DSM_NOTIFICATION_REQUEST_BLOCK;
515 pub const MINIPORT_DSM_NOTIFICATION_VERSION_1: ULONG = 1;
516 pub const MINIPORT_DSM_NOTIFICATION_VERSION: ULONG = MINIPORT_DSM_NOTIFICATION_VERSION_1;
517 pub const MINIPORT_DSM_PROFILE_UNKNOWN: ULONG = 0;
518 pub const MINIPORT_DSM_PROFILE_PAGE_FILE: ULONG = 1;
519 pub const MINIPORT_DSM_PROFILE_HIBERNATION_FILE: ULONG = 2;
520 pub const MINIPORT_DSM_PROFILE_CRASHDUMP_FILE: ULONG = 3;
521 pub const MINIPORT_DSM_NOTIFY_FLAG_BEGIN: ULONG = 0x00000001;
522 pub const MINIPORT_DSM_NOTIFY_FLAG_END: ULONG = 0x00000002;
523 pub const HYBRID_FUNCTION_GET_INFO: ULONG = 0x01;
524 pub const HYBRID_FUNCTION_DISABLE_CACHING_MEDIUM: ULONG = 0x10;
525 pub const HYBRID_FUNCTION_ENABLE_CACHING_MEDIUM: ULONG = 0x11;
526 pub const HYBRID_FUNCTION_SET_DIRTY_THRESHOLD: ULONG = 0x12;
527 pub const HYBRID_FUNCTION_DEMOTE_BY_SIZE: ULONG = 0x13;
528 pub const HYBRID_STATUS_SUCCESS: ULONG = 0x0;
529 pub const HYBRID_STATUS_ILLEGAL_REQUEST: ULONG = 0x1;
530 pub const HYBRID_STATUS_INVALID_PARAMETER: ULONG = 0x2;
531 pub const HYBRID_STATUS_OUTPUT_BUFFER_TOO_SMALL: ULONG = 0x3;
532 pub const HYBRID_STATUS_ENABLE_REFCOUNT_HOLD: ULONG = 0x10;
533 pub const HYBRID_REQUEST_BLOCK_STRUCTURE_VERSION: ULONG = 0x1;
534 STRUCT!{struct HYBRID_REQUEST_BLOCK {
535     Version: ULONG,
536     Size: ULONG,
537     Function: ULONG,
538     Flags: ULONG,
539     DataBufferOffset: ULONG,
540     DataBufferLength: ULONG,
541 }}
542 pub type PHYBRID_REQUEST_BLOCK = *mut HYBRID_REQUEST_BLOCK;
543 ENUM!{enum NVCACHE_TYPE {
544     NvCacheTypeUnknown = 0,
545     NvCacheTypeNone = 1,
546     NvCacheTypeWriteBack = 2,
547     NvCacheTypeWriteThrough = 3,
548 }}
549 ENUM!{enum NVCACHE_STATUS {
550     NvCacheStatusUnknown = 0,
551     NvCacheStatusDisabling = 1,
552     NvCacheStatusDisabled = 2,
553     NvCacheStatusEnabled = 3,
554 }}
555 STRUCT!{struct NVCACHE_PRIORITY_LEVEL_DESCRIPTOR {
556     PriorityLevel: UCHAR,
557     Reserved0: [UCHAR; 3],
558     ConsumedNVMSizeFraction: ULONG,
559     ConsumedMappingResourcesFraction: ULONG,
560     ConsumedNVMSizeForDirtyDataFraction: ULONG,
561     ConsumedMappingResourcesForDirtyDataFraction: ULONG,
562     Reserved1: ULONG,
563 }}
564 pub type PNVCACHE_PRIORITY_LEVEL_DESCRIPTOR = *mut NVCACHE_PRIORITY_LEVEL_DESCRIPTOR;
565 pub const HYBRID_REQUEST_INFO_STRUCTURE_VERSION: ULONG = 1;
566 STRUCT!{struct HYBRID_INFORMATION {
567     Version: ULONG,
568     Size: ULONG,
569     HybridSupported: BOOLEAN,
570     Status: NVCACHE_STATUS,
571     CacheTypeEffective: NVCACHE_TYPE,
572     CacheTypeDefault: NVCACHE_TYPE,
573     FractionBase: ULONG,
574     CacheSize: ULONGLONG,
575     Attributes: HYBRID_INFORMATION_Attributes,
576     Priorities: HYBRID_INFORMATION_Priorities,
577 }}
578 pub type PHYBRID_INFORMATION = *mut HYBRID_INFORMATION;
579 STRUCT!{struct HYBRID_INFORMATION_Attributes {
580     Bitfield: ULONG,
581 }}
582 BITFIELD!{HYBRID_INFORMATION_Attributes Bitfield: ULONG [
583     WriteCacheChangeable set_WriteCacheChangeable[0..1],
584     WriteThroughIoSupported set_WriteThroughIoSupported[1..2],
585     FlushCacheSupported set_FlushCacheSupported[2..3],
586     Removable set_Removable[3..4],
587     ReservedBits set_ReservedBits[4..32],
588 ]}
589 STRUCT!{struct HYBRID_INFORMATION_Priorities {
590     PriorityLevelCount: UCHAR,
591     MaxPriorityBehavior: BOOLEAN,
592     OptimalWriteGranularity: UCHAR,
593     Reserved: UCHAR,
594     DirtyThresholdLow: ULONG,
595     DirtyThresholdHigh: ULONG,
596     SupportedCommands: HYBRID_INFORMATION_Priorities_SupportedCommands,
597     Priority: [NVCACHE_PRIORITY_LEVEL_DESCRIPTOR; 0],
598 }}
599 STRUCT!{struct HYBRID_INFORMATION_Priorities_SupportedCommands {
600     Bitfield: ULONG,
601     MaxEvictCommands: ULONG,
602     MaxLbaRangeCountForEvict: ULONG,
603     MaxLbaRangeCountForChangeLba: ULONG,
604 }}
605 BITFIELD!{HYBRID_INFORMATION_Priorities_SupportedCommands Bitfield: ULONG [
606     CacheDisable set_CacheDisable[0..1],
607     SetDirtyThreshold set_SetDirtyThreshold[1..2],
608     PriorityDemoteBySize set_PriorityDemoteBySize[2..3],
609     PriorityChangeByLbaRange set_PriorityChangeByLbaRange[3..4],
610     Evict set_Evict[4..5],
611     ReservedBits set_ReservedBits[5..32],
612 ]}
613 STRUCT!{struct HYBRID_DIRTY_THRESHOLDS {
614     Version: ULONG,
615     Size: ULONG,
616     DirtyLowThreshold: ULONG,
617     DirtyHighThreshold: ULONG,
618 }}
619 pub type PHYBRID_DIRTY_THRESHOLDS = *mut HYBRID_DIRTY_THRESHOLDS;
620 STRUCT!{struct HYBRID_DEMOTE_BY_SIZE {
621     Version: ULONG,
622     Size: ULONG,
623     SourcePriority: UCHAR,
624     TargetPriority: UCHAR,
625     Reserved0: USHORT,
626     Reserved1: ULONG,
627     LbaCount: ULONGLONG,
628 }}
629 pub type PHYBRID_DEMOTE_BY_SIZE = *mut HYBRID_DEMOTE_BY_SIZE;
630 pub const FIRMWARE_FUNCTION_GET_INFO: ULONG = 0x01;
631 pub const FIRMWARE_FUNCTION_DOWNLOAD: ULONG = 0x02;
632 pub const FIRMWARE_FUNCTION_ACTIVATE: ULONG = 0x03;
633 pub const FIRMWARE_STATUS_SUCCESS: ULONG = 0x0;
634 pub const FIRMWARE_STATUS_ERROR: ULONG = 0x1;
635 pub const FIRMWARE_STATUS_ILLEGAL_REQUEST: ULONG = 0x2;
636 pub const FIRMWARE_STATUS_INVALID_PARAMETER: ULONG = 0x3;
637 pub const FIRMWARE_STATUS_INPUT_BUFFER_TOO_BIG: ULONG = 0x4;
638 pub const FIRMWARE_STATUS_OUTPUT_BUFFER_TOO_SMALL: ULONG = 0x5;
639 pub const FIRMWARE_STATUS_INVALID_SLOT: ULONG = 0x6;
640 pub const FIRMWARE_STATUS_INVALID_IMAGE: ULONG = 0x7;
641 pub const FIRMWARE_STATUS_CONTROLLER_ERROR: ULONG = 0x10;
642 pub const FIRMWARE_STATUS_POWER_CYCLE_REQUIRED: ULONG = 0x20;
643 pub const FIRMWARE_STATUS_DEVICE_ERROR: ULONG = 0x40;
644 pub const FIRMWARE_STATUS_INTERFACE_CRC_ERROR: ULONG = 0x80;
645 pub const FIRMWARE_STATUS_UNCORRECTABLE_DATA_ERROR: ULONG = 0x81;
646 pub const FIRMWARE_STATUS_MEDIA_CHANGE: ULONG = 0x82;
647 pub const FIRMWARE_STATUS_ID_NOT_FOUND: ULONG = 0x83;
648 pub const FIRMWARE_STATUS_MEDIA_CHANGE_REQUEST: ULONG = 0x84;
649 pub const FIRMWARE_STATUS_COMMAND_ABORT: ULONG = 0x85;
650 pub const FIRMWARE_STATUS_END_OF_MEDIA: ULONG = 0x86;
651 pub const FIRMWARE_STATUS_ILLEGAL_LENGTH: ULONG = 0x87;
652 pub const FIRMWARE_REQUEST_BLOCK_STRUCTURE_VERSION: ULONG = 0x1;
653 STRUCT!{struct FIRMWARE_REQUEST_BLOCK {
654     Version: ULONG,
655     Size: ULONG,
656     Function: ULONG,
657     Flags: ULONG,
658     DataBufferOffset: ULONG,
659     DataBufferLength: ULONG,
660 }}
661 pub type PFIRMWARE_REQUEST_BLOCK = *mut FIRMWARE_REQUEST_BLOCK;
662 pub const FIRMWARE_REQUEST_FLAG_CONTROLLER: ULONG = 0x00000001;
663 pub const FIRMWARE_REQUEST_FLAG_LAST_SEGMENT: ULONG = 0x00000002;
664 pub const FIRMWARE_REQUEST_FLAG_SWITCH_TO_EXISTING_FIRMWARE: ULONG = 0x80000000;
665 pub const STORAGE_FIRMWARE_INFO_STRUCTURE_VERSION: ULONG = 0x1;
666 pub const STORAGE_FIRMWARE_INFO_STRUCTURE_VERSION_V2: ULONG = 0x2;
667 pub const STORAGE_FIRMWARE_INFO_INVALID_SLOT: UCHAR = 0xFF;
668 STRUCT!{struct STORAGE_FIRMWARE_SLOT_INFO {
669     SlotNumber: UCHAR,
670     ReadOnly: BOOLEAN,
671     Reserved: [UCHAR; 6],
672     Revision: STORAGE_FIRMWARE_SLOT_INFO_Revision,
673 }}
674 pub type PSTORAGE_FIRMWARE_SLOT_INFO = *mut STORAGE_FIRMWARE_SLOT_INFO;
675 UNION!{union STORAGE_FIRMWARE_SLOT_INFO_Revision {
676     [u64; 1],
677     Info Info_mut: [UCHAR; 8],
678     AsUlonglong AsUlonglong_mut: ULONGLONG,
679 }}
680 pub const STORAGE_FIRMWARE_SLOT_INFO_V2_REVISION_LENGTH: usize = 16;
681 STRUCT!{struct STORAGE_FIRMWARE_SLOT_INFO_V2 {
682     SlotNumber: UCHAR,
683     ReadOnly: BOOLEAN,
684     Reserved: [UCHAR; 6],
685     Revision: [UCHAR; STORAGE_FIRMWARE_SLOT_INFO_V2_REVISION_LENGTH],
686 }}
687 pub type PSTORAGE_FIRMWARE_SLOT_INFO_V2 = *mut STORAGE_FIRMWARE_SLOT_INFO_V2;
688 STRUCT!{struct STORAGE_FIRMWARE_INFO {
689     Version: ULONG,
690     Size: ULONG,
691     UpgradeSupport: BOOLEAN,
692     SlotCount: UCHAR,
693     ActiveSlot: UCHAR,
694     PendingActivateSlot: UCHAR,
695     Reserved: ULONG,
696     Slot: [STORAGE_FIRMWARE_SLOT_INFO; 0],
697 }}
698 pub type PSTORAGE_FIRMWARE_INFO = *mut STORAGE_FIRMWARE_INFO;
699 STRUCT!{struct STORAGE_FIRMWARE_INFO_V2 {
700     Version: ULONG,
701     Size: ULONG,
702     UpgradeSupport: BOOLEAN,
703     SlotCount: UCHAR,
704     ActiveSlot: UCHAR,
705     PendingActivateSlot: UCHAR,
706     FirmwareShared: BOOLEAN,
707     Reserved: [UCHAR; 3],
708     ImagePayloadAlignment: ULONG,
709     ImagePayloadMaxSize: ULONG,
710     Slot: [STORAGE_FIRMWARE_SLOT_INFO_V2; 0],
711 }}
712 pub type PSTORAGE_FIRMWARE_INFO_V2 = *mut STORAGE_FIRMWARE_INFO_V2;
713 pub const STORAGE_FIRMWARE_DOWNLOAD_STRUCTURE_VERSION: ULONG = 0x1;
714 pub const STORAGE_FIRMWARE_DOWNLOAD_STRUCTURE_VERSION_V2: ULONG = 0x2;
715 STRUCT!{struct STORAGE_FIRMWARE_DOWNLOAD {
716     Version: ULONG,
717     Size: ULONG,
718     Offset: ULONGLONG,
719     BufferSize: ULONGLONG,
720     ImageBuffer: [UCHAR; 0],
721 }}
722 pub type PSTORAGE_FIRMWARE_DOWNLOAD = *mut STORAGE_FIRMWARE_DOWNLOAD;
723 STRUCT!{struct STORAGE_FIRMWARE_DOWNLOAD_V2 {
724     Version: ULONG,
725     Size: ULONG,
726     Offset: ULONGLONG,
727     BufferSize: ULONGLONG,
728     Slot: UCHAR,
729     Reserved: [UCHAR; 7],
730     ImageBuffer: [UCHAR; 0],
731 }}
732 pub type PSTORAGE_FIRMWARE_DOWNLOAD_V2 = *mut STORAGE_FIRMWARE_DOWNLOAD_V2;
733 pub const STORAGE_FIRMWARE_ACTIVATE_STRUCTURE_VERSION: ULONG = 0x1;
734 STRUCT!{struct STORAGE_FIRMWARE_ACTIVATE {
735     Version: ULONG,
736     Size: ULONG,
737     SlotToActivate: UCHAR,
738     Reserved0: [UCHAR; 3],
739 }}
740 pub type PSTORAGE_FIRMWARE_ACTIVATE = *mut STORAGE_FIRMWARE_ACTIVATE;
741 STRUCT!{struct IO_SCSI_CAPABILITIES {
742     Length: ULONG,
743     MaximumTransferLength: ULONG,
744     MaximumPhysicalPages: ULONG,
745     SupportedAsynchronousEvents: ULONG,
746     AlignmentMask: ULONG,
747     TaggedQueuing: BOOLEAN,
748     AdapterScansDown: BOOLEAN,
749     AdapterUsesPio: BOOLEAN,
750 }}
751 pub type PIO_SCSI_CAPABILITIES = *mut IO_SCSI_CAPABILITIES;
752 STRUCT!{struct SCSI_ADDRESS {
753     Length: ULONG,
754     PortNumber: UCHAR,
755     PathId: UCHAR,
756     TargetId: UCHAR,
757     Lun: UCHAR,
758 }}
759 pub type PSCSI_ADDRESS = *mut SCSI_ADDRESS;
760 pub const DUMP_POINTERS_VERSION_1: ULONG = 1;
761 pub const DUMP_POINTERS_VERSION_2: ULONG = 2;
762 pub const DUMP_POINTERS_VERSION_3: ULONG = 3;
763 pub const DUMP_POINTERS_VERSION_4: ULONG = 4;
764 pub const DUMP_DRIVER_NAME_LENGTH: usize = 15;
765 FN!{cdecl DUMP_DEVICE_POWERON_ROUTINE(
766     Context: PVOID,
767 ) -> LONG}
768 pub type PDUMP_DEVICE_POWERON_ROUTINE = *mut DUMP_DEVICE_POWERON_ROUTINE;
769 STRUCT!{struct DUMP_POINTERS_VERSION {
770     Version: ULONG,
771     Size: ULONG,
772 }}
773 pub type PDUMP_POINTERS_VERSION = *mut DUMP_POINTERS_VERSION;
774 STRUCT!{struct DUMP_POINTERS {
775     AdapterObject: PVOID, // struct _ADAPTER_OBJECT *
776     MappedRegisterBase: PVOID,
777     DumpData: PVOID,
778     CommonBufferVa: PVOID,
779     CommonBufferPa: LARGE_INTEGER,
780     CommonBufferSize: ULONG,
781     AllocateCommonBuffers: BOOLEAN,
782     UseDiskDump: BOOLEAN,
783     Spare1: [UCHAR; 2],
784     DeviceObject: PVOID,
785 }}
786 pub type PDUMP_POINTERS = *mut DUMP_POINTERS;
787 STRUCT!{struct DUMP_POINTERS_EX {
788     Header: DUMP_POINTERS_VERSION,
789     DumpData: PVOID,
790     CommonBufferVa: PVOID,
791     CommonBufferSize: ULONG,
792     AllocateCommonBuffers: BOOLEAN,
793     DeviceObject: PVOID,
794     DriverList: PVOID,
795     dwPortFlags: ULONG,
796     MaxDeviceDumpSectionSize: ULONG,
797     MaxDeviceDumpLevel: ULONG,
798     MaxTransferSize: ULONG,
799     AdapterObject: PVOID,
800     MappedRegisterBase: PVOID,
801     DeviceReady: PBOOLEAN,
802     DumpDevicePowerOn: PDUMP_DEVICE_POWERON_ROUTINE,
803     DumpDevicePowerOnContext: PVOID,
804 }}
805 pub type PDUMP_POINTERS_EX = *mut DUMP_POINTERS_EX;
806 // TODO: Revisit these definitions when const size_of and offset_of! arrive.
807 #[cfg(target_pointer_width = "32")]
808 IFDEF!{
809 pub const DUMP_POINTERS_EX_V2_SIZE: ULONG = 32;
810 pub const DUMP_POINTERS_EX_V3_SIZE: ULONG = 60;
811 pub const DUMP_POINTERS_EX_V4_SIZE: ULONG = 68;
812 }
813 #[cfg(target_pointer_width = "64")]
814 IFDEF!{
815 pub const DUMP_POINTERS_EX_V2_SIZE: ULONG = 48;
816 pub const DUMP_POINTERS_EX_V3_SIZE: ULONG = 88;
817 pub const DUMP_POINTERS_EX_V4_SIZE: ULONG = 104;
818 }
819 pub const DUMP_EX_FLAG_SUPPORT_64BITMEMORY: ULONG = 0x00000001;
820 pub const DUMP_EX_FLAG_SUPPORT_DD_TELEMETRY: ULONG = 0x00000002;
821 pub const DUMP_EX_FLAG_RESUME_SUPPORT: ULONG = 0x00000004;
822 STRUCT!{struct DUMP_DRIVER {
823     DumpDriverList: PVOID,
824     DriverName: [WCHAR; DUMP_DRIVER_NAME_LENGTH],
825     BaseName: [WCHAR; DUMP_DRIVER_NAME_LENGTH],
826 }}
827 pub type PDUMP_DRIVER = *mut DUMP_DRIVER;
828 pub const SCSI_IOCTL_DATA_OUT: UCHAR = 0;
829 pub const SCSI_IOCTL_DATA_IN: UCHAR = 1;
830 pub const SCSI_IOCTL_DATA_UNSPECIFIED: UCHAR = 2;
831 pub const SCSI_IOCTL_DATA_BIDIRECTIONAL: UCHAR = 3;
832 pub const MPIO_IOCTL_FLAG_USE_PATHID: UCHAR = 1;
833 pub const MPIO_IOCTL_FLAG_USE_SCSIADDRESS: UCHAR = 2;
834 pub const MPIO_IOCTL_FLAG_INVOLVE_DSM: UCHAR = 4;
835