11#define USB_STOR_TAG 'sbsu'
14#define BooleanFlagOn(Flags, SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))
18#define SrbGetCdb(srb) ((PCDB)(srb->Cdb))
23#define USB_SUBCLASS_RBC 0x01
24#define USB_SUBCLASS_8020 0x02
25#define USB_SUBCLASS_QIC 0x03
26#define USB_SUBCLASS_UFI 0x04
27#define USB_SUBCLASS_8070 0x05
28#define USB_SUBCLASS_SCSI 0x06
29#define USB_SUBCLASS_LOCKABLE 0x07
31#define USB_SUBCLASS_ISD200 0xF0
32#define USB_SUBCLASS_CYP_ATACB 0xF1
33#define USB_SUBCLASS_VENDOR 0xFF
37#define USB_PROTOCOL_CBI 0x00
38#define USB_PROTOCOL_CB 0x01
39#define USB_PROTOCOL_BULK 0x50
40#define USB_PROTOCOL_UAS 0x62
41#define USB_PROTOCOL_USBAT 0x80
42#define USB_PROTOCOL_EUSB_SDDR09 0x81
43#define USB_PROTOCOL_SDDR55 0x82
45#define USB_PROTOCOL_DPCM_USB 0xF0
46#define USB_PROTOCOL_FREECOM 0xF1
47#define USB_PROTOCOL_DATAFAB 0xF2
48#define USB_PROTOCOL_JUMPSHOT 0xF3
49#define USB_PROTOCOL_ALAUDA 0xF4
50#define USB_PROTOCOL_KARMA 0xF5
51#define USB_PROTOCOL_VENDOR 0xFF
55#define USB_BULK_GET_MAX_LUN 0xFE
56#define USB_BULK_RESET_DEVICE 0xFF
58#define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \
59 | USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH)
61#define USB_MAXCHILDREN 16
63#define USBSTOR_DEFAULT_MAX_TRANSFER_LENGTH 0x10000
65#define CBW_SIGNATURE 0x43425355
66#define CSW_SIGNATURE 0x53425355
83#define CSW_STATUS_COMMAND_PASSED 0x00
84#define CSW_STATUS_COMMAND_FAILED 0x01
85#define CSW_STATUS_PHASE_ERROR 0x02
117#define USBSTOR_FDO_FLAGS_DEVICE_RESETTING 0x00000001
118#define USBSTOR_FDO_FLAGS_IRP_LIST_FREEZE 0x00000002
PDEVICE_OBJECT PhysicalDeviceObject
#define INQUIRYDATABUFFERSIZE
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
const KSDEVICE_DESCRIPTOR DeviceDescriptor
USBSTOR_COMMON_DEVICE_EXTENSION Common
ULONG TimerWorkQueueEnabled
PIO_WORKITEM ResetDeviceWorkItem
PDEVICE_OBJECT FunctionalDeviceObject
PSCSI_REQUEST_BLOCK LastTimerActiveSrb
PUSBD_INTERFACE_INFORMATION InterfaceInformation
USB_BUS_INTERFACE_USBDI_V2 BusInterface
IRP_CONTEXT CurrentIrpContext
PSCSI_REQUEST_BLOCK ActiveSrb
PDEVICE_OBJECT LowerDeviceObject
PUSB_STRING_DESCRIPTOR SerialNumber
ULONG SrbErrorHandlingActive
SCSI_REQUEST_BLOCK SenseSrb
PDEVICE_OBJECT LowerDeviceObject
PDEVICE_OBJECT * PDODeviceObject
USBSTOR_COMMON_DEVICE_EXTENSION Common
PDEVICE_OBJECT DeviceObject
WORK_QUEUE_ITEM WorkQueueItem
BOOLEAN AcceleratedTransfer
ULONG MaximumPhysicalPages
ULONG MaximumTransferLength
NTSTATUS USBSTOR_HandleExecuteSCSI(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS USBSTOR_SendCSWRequest(PFDO_DEVICE_EXTENSION FDODeviceExtension, PIRP Irp)
struct PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
struct __COMMON_DEVICE_EXTENSION__ USBSTOR_COMMON_DEVICE_EXTENSION
struct _STORAGE_ADAPTER_DESCRIPTOR_WIN8 * PSTORAGE_ADAPTER_DESCRIPTOR_WIN8
BOOLEAN USBSTOR_QueueAddIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID USBSTOR_QueueRelease(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
NTSTATUS USBSTOR_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
VOID NTAPI USBSTOR_QueueResetDevice(IN PFDO_DEVICE_EXTENSION FDODeviceExtension)
NTSTATUS USBSTOR_ResetPipeWithHandle(IN PDEVICE_OBJECT DeviceObject, IN USBD_PIPE_HANDLE PipeHandle)
struct FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
VOID NTAPI USBSTOR_QueueResetPipe(IN PFDO_DEVICE_EXTENSION FDODeviceExtension)
NTSTATUS USBSTOR_GetMaxLUN(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBSTOR_HandleInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS USBSTOR_ResetDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBSTOR_CreatePDO(IN PDEVICE_OBJECT DeviceObject, IN UCHAR LUN)
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
NTSTATUS USBSTOR_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
struct _ERRORHANDLER_WORKITEM_DATA * PERRORHANDLER_WORKITEM_DATA
VOID USBSTOR_QueueTerminateRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN ULONG ItemSize)
struct _ERRORHANDLER_WORKITEM_DATA ERRORHANDLER_WORKITEM_DATA
struct __COMMON_DEVICE_EXTENSION__ * PUSBSTOR_COMMON_DEVICE_EXTENSION
NTSTATUS USBSTOR_PdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
VOID USBSTOR_QueueWaitForPendingRequests(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI USBSTOR_GetBusInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface)
NTSTATUS USBSTOR_HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct IRP_CONTEXT * PIRP_CONTEXT
NTSTATUS USBSTOR_GetPipeHandles(IN PFDO_DEVICE_EXTENSION DeviceExtension)
VOID USBSTOR_QueueNextRequest(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBSTOR_SelectConfigurationAndInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBSTOR_GetEndpointStatus(IN PDEVICE_OBJECT DeviceObject, IN UCHAR bEndpointAddress, OUT PUSHORT Value)
VOID NTAPI USBSTOR_CancelIo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID FreeItem(IN PVOID Item)
VOID NTAPI USBSTOR_StartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
struct _STORAGE_ADAPTER_DESCRIPTOR_WIN8 STORAGE_ADAPTER_DESCRIPTOR_WIN8
VOID NTAPI USBSTOR_TimerRoutine(PDEVICE_OBJECT DeviceObject, PVOID Context)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value