ReactOS  0.4.14-dev-323-g6fe6a88
usbstor.h
Go to the documentation of this file.
1 #ifndef _USBSTOR_H_
2 #define _USBSTOR_H_
3 
4 #include <wdm.h>
5 #include <usbdi.h>
6 #include <usbbusif.h>
7 #include <usbdlib.h>
8 #include <classpnp.h>
9 
10 #define USB_STOR_TAG 'sbsu'
11 #define USB_MAXCHILDREN (16)
12 
13 #define HTONS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8))
14 #define NTOHS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8))
15 
16 #define HTONL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \
17  ((((unsigned long)(n) & 0xFF00)) << 8) | \
18  ((((unsigned long)(n) & 0xFF0000)) >> 8) | \
19  ((((unsigned long)(n) & 0xFF000000)) >> 24))
20 
21 
22 #define NTOHL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \
23  ((((unsigned long)(n) & 0xFF00)) << 8) | \
24  ((((unsigned long)(n) & 0xFF0000)) >> 8) | \
25  ((((unsigned long)(n) & 0xFF000000)) >> 24))
26 
27 #define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \
28  | USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH)
29 
30 typedef struct __COMMON_DEVICE_EXTENSION__
31 {
32  BOOLEAN IsFDO;
33 
35 
36 typedef struct
37 {
38  USBSTOR_COMMON_DEVICE_EXTENSION Common; // common device extension
39 
40  PDEVICE_OBJECT FunctionalDeviceObject; // functional device object
41  PDEVICE_OBJECT PhysicalDeviceObject; // physical device object
42  PDEVICE_OBJECT LowerDeviceObject; // lower device object
43  USB_BUS_INTERFACE_USBDI_V2 BusInterface; // bus interface of device
44  PUSB_DEVICE_DESCRIPTOR DeviceDescriptor; // usb device descriptor
45  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; // usb configuration descriptor
46  PUSB_STRING_DESCRIPTOR SerialNumber; // usb serial number
47  PUSBD_INTERFACE_INFORMATION InterfaceInformation; // usb interface information
48  USBD_CONFIGURATION_HANDLE ConfigurationHandle; // usb configuration handle
49  UCHAR BulkInPipeIndex; // bulk in pipe index
50  UCHAR BulkOutPipeIndex; // bulk out pipe index
51  UCHAR MaxLUN; // max lun for device
52  PDEVICE_OBJECT ChildPDO[16]; // max 16 child pdo devices
53  KSPIN_LOCK IrpListLock; // irp list lock
54  LIST_ENTRY IrpListHead; // irp list head
55  BOOLEAN IrpListFreeze; // if true the irp list is freezed
56  BOOLEAN ResetInProgress; // if hard reset is in progress
57  ULONG IrpPendingCount; // count of irp pending
58  PSCSI_REQUEST_BLOCK ActiveSrb; // stores the current active SRB
59  KEVENT NoPendingRequests; // set if no pending or in progress requests
60  PSCSI_REQUEST_BLOCK LastTimerActiveSrb; // last timer tick active srb
61  ULONG SrbErrorHandlingActive; // error handling of srb is activated
62  ULONG TimerWorkQueueEnabled; // timer work queue enabled
63  ULONG InstanceCount; // pdo instance count
65 
66 typedef struct
67 {
69  PDEVICE_OBJECT LowerDeviceObject; // points to FDO
70  UCHAR LUN; // lun id
71  PVOID InquiryData; // USB SCSI inquiry data
72  PUCHAR FormatData; // USB SCSI Read Format Capacity Data
73  UCHAR Claimed; // indicating if it has been claimed by upper driver
74  ULONG BlockLength; // length of block
75  ULONG LastLogicBlockAddress; // last block address
76  PDEVICE_OBJECT *PDODeviceObject; // entry in pdo list
77  PDEVICE_OBJECT Self; // self
78  UCHAR MediumTypeCode; // floppy medium type code
79  UCHAR IsFloppy; // is device floppy
81 
82 //
83 // max lun command identifier
84 //
85 #define USB_BULK_GET_MAX_LUN 0xFE
86 #define USB_BULK_RESET_DEVICE 0xFF
87 
88 #include <pshpack1.h>
89 typedef struct
90 {
91  ULONG Signature; // CBW signature
92  ULONG Tag; // CBW Tag of operation
93  ULONG DataTransferLength; // data transfer length
94  UCHAR Flags; // CBW Flags endpoint direction
95  UCHAR LUN; // lun unit
96  UCHAR CommandBlockLength; // Command block length
97  UCHAR CommandBlock[16];
98 }CBW, *PCBW;
99 
100 C_ASSERT(sizeof(CBW) == 31);
101 
102 
103 #define CBW_SIGNATURE 0x43425355
104 #define CSW_SIGNATURE 0x53425355
105 
106 #define MAX_LUN 0xF
107 
108 typedef struct
109 {
110  ULONG Signature; // CSW signature
111  ULONG Tag; // CSW tag
112  ULONG DataResidue; // CSW data transfer diff
113  UCHAR Status; // CSW status
114 }CSW, *PCSW;
115 
116 //--------------------------------------------------------------------------------------------------------------------------------------------
117 //
118 // UFI INQUIRY command
119 //
120 typedef struct
121 {
122  UCHAR Code; // operation code 0x12
123  UCHAR LUN; // lun address
124  UCHAR PageCode; // product data information, always 0x00
125  UCHAR Reserved; // reserved 0x00
126  UCHAR AllocationLength; // length of inquiry data to be returned, default 36 bytes
127  UCHAR Reserved1[7]; //reserved bytes 0x00
129 
130 C_ASSERT(sizeof(UFI_INQUIRY_CMD) == 12);
131 
132 #define UFI_INQUIRY_CMD_LEN 0x6
133 
134 //
135 // UFI INQUIRY command response
136 //
137 typedef struct
138 {
139  UCHAR DeviceType; // device type
140  UCHAR RMB; // removable media bit
141  UCHAR Version; // contains version 0x00
142  UCHAR Format; // response format
143  UCHAR Length; // additional length
144  UCHAR Reserved[3]; // reserved
145  UCHAR Vendor[8]; // vendor identification string
146  UCHAR Product[16]; // product identification string
147  UCHAR Revision[4]; // product revision code
149 
150 C_ASSERT(sizeof(UFI_INQUIRY_RESPONSE) == 36);
151 
152 //--------------------------------------------------------------------------------------------------------------------------------------------
153 //
154 // UFI read cmd
155 //
156 typedef struct
157 {
158  UCHAR Code; // operation code
159  UCHAR LUN; // lun
160  UCHAR LogicalBlockByte0; // lba byte 0
161  UCHAR LogicalBlockByte1; // lba byte 1
162  UCHAR LogicalBlockByte2; // lba byte 2
163  UCHAR LogicalBlockByte3; // lba byte 3
164  UCHAR Reserved; // reserved 0x00
165  UCHAR ContiguousLogicBlocksByte0; // msb contiguous logic blocks byte
166  UCHAR ContiguousLogicBlocksByte1; // msb contiguous logic blocks
167  UCHAR Reserved1[3]; // reserved 0x00
169 
170 C_ASSERT(sizeof(UFI_READ_WRITE_CMD) == 12);
171 
172 #define UFI_READ_WRITE_CMD_LEN (0xA)
173 
174 //--------------------------------------------------------------------------------------------------------------------------------------------
175 //
176 // UFI read capacity cmd
177 //
178 typedef struct
179 {
180  UCHAR Code; // operation code 0x25
181  UCHAR LUN; // lun address
182  UCHAR LBA[4]; // logical block address, should be zero
183  UCHAR Reserved1[2]; // reserved 0x00
184  UCHAR PMI; // PMI = 0x00
185  UCHAR Reserved2[3]; // reserved 0x00
187 
188 C_ASSERT(sizeof(UFI_CAPACITY_CMD) == 12);
189 
190 #define UFI_CAPACITY_CMD_LEN 0xA //FIXME support length 16 too if requested
191 
192 //
193 // UFI Read Capacity command response
194 //
195 typedef struct
196 {
197  ULONG LastLogicalBlockAddress; // last logical block address
198  ULONG BlockLength; // block length in bytes
200 
201 #define UFI_READ_CAPACITY_CMD_LEN 0xA
202 C_ASSERT(sizeof(UFI_CAPACITY_RESPONSE) == 8);
203 
204 //--------------------------------------------------------------------------------------------------------------------------------------------
205 //
206 // UFI sense mode cmd
207 //
208 typedef struct
209 {
210  UCHAR Code; // operation code
211  UCHAR LUN; // lun address
212  UCHAR PageCode:6; // page code selector
213  UCHAR PC:2; // type of parameters to be returned
214  UCHAR Reserved[4]; // reserved 0x00
215  USHORT AllocationLength; // parameters length
216  UCHAR Reserved1[3];
218 
219 C_ASSERT(sizeof(UFI_SENSE_CMD) == 12);
220 
221 #define UFI_SENSE_CMD_LEN (6)
222 
223 typedef struct
224 {
225  USHORT ModeDataLength; // length of parameters for sense cmd
226  UCHAR MediumTypeCode; // 00 for mass storage, 0x94 for floppy
227  UCHAR WP:1; // write protect bit
228  UCHAR Reserved1:2; // reserved 00
229  UCHAR DPOFUA:1; // should be zero
230  UCHAR Reserved2:4; // reserved
231  UCHAR Reserved[4]; // reserved
233 
234 
235 C_ASSERT(sizeof(UFI_MODE_PARAMETER_HEADER) == 8);
236 
237 typedef struct
238 {
239  UCHAR PC;
240  UCHAR PageLength;
242  UCHAR ITM;
243  UCHAR Flags;
244  UCHAR Reserved[3];
246 C_ASSERT(sizeof(UFI_TIMER_PROTECT_PAGE) == 8);
247 
248 //--------------------------------------------------------------------------------------------------------------------------------------------
249 //
250 // UFI read capacity cmd
251 //
252 
253 typedef struct
254 {
255  UCHAR Code;
256  UCHAR LUN;
257  UCHAR Reserved[5];
258  UCHAR AllocationLengthMsb;
259  UCHAR AllocationLengthLsb;
260  UCHAR Reserved1[3];
262 
263 C_ASSERT(sizeof(UFI_READ_FORMAT_CAPACITY) == 12);
264 
265 #define UFI_READ_FORMAT_CAPACITY_CMD_LEN (10)
266 
267 typedef struct
268 {
272  UCHAR CapacityLength;
274 
276 
277 typedef struct
278 {
279  ULONG BlockCount;
280  UCHAR Code;
281  UCHAR BlockLengthByte0;
282  UCHAR BlockLengthByte1;
283  UCHAR BlockLengthByte2;
285 
286 #define UNFORMATTED_MEDIA_CODE_DESCRIPTORY_TYPE (1)
287 #define FORMAT_MEDIA_CODE_DESCRIPTOR_TYPE (2)
288 #define CARTRIDGE_MEDIA_CODE_DESCRIPTOR_TYPE (3)
289 
290 
291 
292 
293 //--------------------------------------------------------------------------------------------------------------------------------------------
294 //
295 // UFI test unit command
296 //
297 
298 typedef struct
299 {
300  UCHAR Code; // operation code 0x00
301  UCHAR LUN; // lun
302  UCHAR Reserved[10]; // reserved 0x00
304 
305 C_ASSERT(sizeof(UFI_TEST_UNIT_CMD) == 12);
306 
307 #define UFI_TEST_UNIT_CMD_LEN (6)
308 
309 //-------------------------------------------------------------------------------------------------------------------------------------------
310 typedef struct
311 {
312  UCHAR Bytes[16];
314 
315 typedef struct
316 {
317  union
318  {
321  };
322  URB Urb;
323  PIRP Irp;
326  PFDO_DEVICE_EXTENSION FDODeviceExtension;
329  ULONG ErrorIndex;
332 
333 typedef struct _ERRORHANDLER_WORKITEM_DATA
334 {
338  PIRP Irp;
340 
341 
342 //---------------------------------------------------------------------
343 //
344 // fdo.c routines
345 //
346 NTSTATUS
349  IN OUT PIRP Irp);
350 
351 //---------------------------------------------------------------------
352 //
353 // pdo.c routines
354 //
355 NTSTATUS
358  IN OUT PIRP Irp);
359 
360 NTSTATUS
363  IN UCHAR LUN);
364 
365 //---------------------------------------------------------------------
366 //
367 // misc.c routines
368 //
369 NTSTATUS
370 NTAPI
373  IN OUT PIRP Irp);
374 
375 NTSTATUS
376 NTAPI
379  OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface);
380 
381 PVOID
384  IN ULONG ItemSize);
385 
386 VOID
387 FreeItem(
388  IN PVOID Item);
389 
390 NTSTATUS
393  OUT PURB UrbRequest);
394 
395 NTSTATUS
398  IN PFDO_DEVICE_EXTENSION DeviceExtension);
399 
400 NTSTATUS
401 NTAPI
404  PIRP Irp,
405  PVOID Context);
406 
407 NTSTATUS
410  IN PFDO_DEVICE_EXTENSION DeviceExtension);
411 
412 BOOLEAN
414  IN PUCHAR Buffer,
416  OUT PUCHAR MediumTypeCode);
417 
418 //---------------------------------------------------------------------
419 //
420 // descriptor.c routines
421 //
422 
423 NTSTATUS
426 
427 NTSTATUS
430  IN PFDO_DEVICE_EXTENSION DeviceExtension);
431 
432 NTSTATUS
434  IN PFDO_DEVICE_EXTENSION DeviceExtension);
435 
436 //---------------------------------------------------------------------
437 //
438 // scsi.c routines
439 //
440 NTSTATUS
443  IN PIRP Irp,
444  IN ULONG RetryCount);
445 
446 NTSTATUS
447 NTAPI
450  PIRP Irp,
451  PVOID Ctx);
452 
453 NTSTATUS
456  PIRP Irp);
457 
458 VOID
461  PIRP Irp);
462 
463 
464 //---------------------------------------------------------------------
465 //
466 // disk.c routines
467 //
468 NTSTATUS
471  IN PIRP Irp);
472 
473 NTSTATUS
476  IN PIRP Irp);
477 
478 //---------------------------------------------------------------------
479 //
480 // queue.c routines
481 //
482 VOID
483 NTAPI
486  PIRP Irp);
487 
488 VOID
491 
492 VOID
495 
496 BOOLEAN
499  IN PIRP Irp);
500 
501 VOID
502 NTAPI
505  IN PIRP Irp);
506 
507 VOID
509  PFDO_DEVICE_EXTENSION FDODeviceExtension);
510 
511 VOID
512 NTAPI
514  PVOID Context);
515 
516 VOID
517 NTAPI
519  PVOID Context);
520 
521 
522 
523 VOID
526 
527 VOID
530  IN PIRP Irp);
531 
532 /* error.c */
533 NTSTATUS
536  IN UCHAR bEndpointAddress,
537  OUT PUSHORT Value);
538 
539 NTSTATUS
543 
544 VOID
545 NTAPI
548  PVOID Context);
549 
550 #endif /* _USBSTOR_H_ */
BOOLEAN ResetInProgress
Definition: usbstor.h:56
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IN
Definition: typedefs.h:38
UCHAR PageCode
Definition: usbstor.h:124
struct UFI_TEST_UNIT_CMD * PUFI_TEST_UNIT_CMD
BOOLEAN USBSTOR_QueueAddIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:75
VOID USBSTOR_QueueWaitForPendingRequests(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:171
PPDO_DEVICE_EXTENSION PDODeviceExtension
Definition: usbstor.h:327
struct UFI_INQUIRY_RESPONSE * PUFI_INQUIRY_RESPONSE
VOID USBSTOR_SendCSW(PIRP_CONTEXT Context, PIRP Irp)
Definition: scsi.c:379
struct _ERRORHANDLER_WORKITEM_DATA * PERRORHANDLER_WORKITEM_DATA
VOID NTAPI USBSTOR_StartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: queue.c:300
_In_ PIRP Irp
Definition: csq.h:116
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
VOID USBSTOR_QueueTerminateRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:186
ULONG RetryCount
Definition: usbstor.h:330
_In_ UINT Bytes
Definition: mmcopy.h:9
Definition: usbstor.h:102
NTSTATUS NTAPI USBSTOR_SyncForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
BOOLEAN USBSTOR_IsFloppy(IN PUCHAR Buffer, IN ULONG BufferLength, OUT PUCHAR MediumTypeCode)
Definition: misc.c:427
NTSTATUS USBSTOR_GetPipeHandles(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:319
Definition: usbstor.h:125
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
WORK_QUEUE_ITEM WorkQueueItem
Definition: usbstor.h:315
_In_ ULONG Revision
Definition: rtlfuncs.h:1104
NTSTATUS USBSTOR_PdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: pdo.c:549
PDEVICE_OBJECT DeviceObject
Definition: usbstor.h:313
struct __COMMON_DEVICE_EXTENSION__ * PUSBSTOR_COMMON_DEVICE_EXTENSION
struct UFI_SENSE_CMD * PUFI_SENSE_CMD
struct CSW * PCSW
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct UFI_CAPACITY_DESCRIPTOR * PUFI_CAPACITY_DESCRIPTOR
NTSTATUS USBSTOR_ResetDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: misc.c:251
_In_ ULONG BufferLength
Definition: usbdlib.h:225
BOOLEAN IrpListFreeze
Definition: usbstor.h:55
NTSTATUS USBSTOR_ResetPipeWithHandle(IN PDEVICE_OBJECT DeviceObject, IN USBD_PIPE_HANDLE PipeHandle)
Definition: error.c:46
unsigned char BOOLEAN
NTSTATUS USBSTOR_GetEndpointStatus(IN PDEVICE_OBJECT DeviceObject, IN UCHAR bEndpointAddress, OUT PUSHORT Value)
Definition: error.c:18
struct __COMMON_DEVICE_EXTENSION__ USBSTOR_COMMON_DEVICE_EXTENSION
C_ASSERT(sizeof(CBW)==31)
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
Definition: bufpool.h:45
#define PC(Packet)
Definition: ip.h:106
Definition: bcd.h:202
#define Code
Definition: deflate.h:80
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
Definition: queue.c:17
const KSDEVICE_DESCRIPTOR DeviceDescriptor
Definition: splitter.c:257
NTSTATUS USBSTOR_HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:418
VOID NTAPI ResetHandlerWorkItemRoutine(PVOID Context)
NTSTATUS USBSTOR_SendCBW(PIRP_CONTEXT Context, PIRP Irp)
Definition: scsi.c:591
PMDL TransferBufferMDL
Definition: usbstor.h:328
INT POOL_TYPE
Definition: typedefs.h:76
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
struct UFI_CAPACITY_RESPONSE * PUFI_CAPACITY_RESPONSE
NTSTATUS USBSTOR_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
Definition: misc.c:107
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: fdo.c:277
NTSTATUS NTAPI USBSTOR_CSWCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Ctx)
Definition: scsi.c:130
struct IRP_CONTEXT * PIRP_CONTEXT
struct CBW * PCBW
PCBW cbw
Definition: usbstor.h:319
PVOID AllocateItem(IN POOL_TYPE PoolType, IN ULONG ItemSize)
Definition: misc.c:30
NTSTATUS USBSTOR_HandleInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:81
UCHAR Reserved
Definition: usbstor.h:125
struct _IRP_CONTEXT IRP_CONTEXT
struct UFI_TIMER_PROTECT_PAGE * PUFI_TIMER_PROTECT_PAGE
PUCHAR TransferData
Definition: usbstor.h:325
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
Definition: ndis.h:3944
unsigned char UCHAR
Definition: xmlstorage.h:181
_In_z_ PCCHAR _In_ PDEVICE_OBJECT LowerDeviceObject
Definition: classpnp.h:789
VOID USBSTOR_QueueRelease(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:262
ULONG SerialNumber
Definition: rxce.c:117
Definition: typedefs.h:117
struct UFI_CAPACITY_CMD * PUFI_CAPACITY_CMD
static UCHAR ItemSize[4]
Definition: parser.c:16
PCSW csw
Definition: usbstor.h:320
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS USBSTOR_GetMaxLUN(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: misc.c:204
VOID NTAPI USBSTOR_TimerRoutine(PDEVICE_OBJECT DeviceObject, PVOID Context)
Definition: error.c:206
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
struct UFI_UNKNOWN_CMD * PUFI_UNKNOWN_CMD
Definition: usb.h:529
unsigned short USHORT
Definition: pedump.c:61
UCHAR AllocationLength
Definition: usbstor.h:126
NTSTATUS USBSTOR_CreatePDO(IN PDEVICE_OBJECT DeviceObject, IN UCHAR LUN)
Definition: pdo.c:896
struct UFI_CAPACITY_FORMAT_HEADER * PUFI_CAPACITY_FORMAT_HEADER
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct _ERRORHANDLER_WORKITEM_DATA ERRORHANDLER_WORKITEM_DATA
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT * FunctionalDeviceObject
Definition: ndis.h:4640
static HANDLE PipeHandle
Definition: dhcpcsvc.c:21
Definition: bcd.h:201
struct UFI_INQUIRY_CMD * PUFI_INQUIRY_CMD
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
struct PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
ULONG TransferDataLength
Definition: usbstor.h:324
NTSTATUS NTAPI USBSTOR_GetBusInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface)
Definition: misc.c:57
#define OUT
Definition: typedefs.h:39
NTSTATUS USBSTOR_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
Definition: descriptor.c:75
struct FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG InstanceCount
Definition: iofuncs.h:1319
VOID NTAPI ErrorHandlerWorkItemRoutine(PVOID Context)
Definition: error.c:248
NTSTATUS USBSTOR_SelectConfigurationAndInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:234
VOID NTAPI USBSTOR_CancelIo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:28
NTSTATUS NTAPI USBSTOR_SyncForwardIrpCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
Definition: misc.c:22
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
static const WCHAR Signature[]
Definition: parser.c:141
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
struct UFI_MODE_PARAMETER_HEADER * PUFI_MODE_PARAMETER_HEADER
NTSTATUS USBSTOR_HandleExecuteSCSI(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: scsi.c:560
unsigned short * PUSHORT
Definition: retypes.h:2
struct UFI_READ_FORMAT_CAPACITY * PUFI_READ_FORMAT_CAPACITY
VOID USBSTOR_QueueNextRequest(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:220