68 if (DeviceExtension->ChildPDO[
Index])
94 if (DeviceExtension->ChildPDO[
Index])
99 DeviceRelations->
Objects[DeviceRelations->
Count] = DeviceExtension->ChildPDO[
Index];
109 DeviceRelations->
Count++;
138 if (DeviceExtension->ChildPDO[
Index] !=
NULL)
140 DPRINT(
"Deleting PDO %p RefCount %x AttachedDevice %p \n", DeviceExtension->ChildPDO[
Index], DeviceExtension->ChildPDO[
Index]->ReferenceCount, DeviceExtension->ChildPDO[
Index]->AttachedDevice);
177 DPRINT1(
"USBSTOR_FdoHandleStartDevice Lower device failed to start %x\n",
Status);
195 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get device descriptor with %x\n",
Status);
218 DPRINT1(
"USB Device is not a bulk only device and is not currently supported\n");
228 DPRINT1(
"[USBSTOR] Error: need to pad CDBs\n");
241 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to select configuration / interface with %x\n",
Status);
254 DPRINT1(
"USBSTOR_FdoHandleStartDevice no pipe handles %x\n",
Status);
267 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get max lun %x\n",
Status);
289 DPRINT1(
"USBSTOR_FdoHandleStartDevice USBSTOR_CreatePDO failed for Index %lu with Status %x\n",
Index,
Status);
297 DeviceExtension->InstanceCount++;
299 }
while(Index < DeviceExtension->MaxLUN);
311 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get device interface %x\n",
Status);
326 DPRINT(
"USBSTOR_FdoHandleStartDevice FDO is initialized\n");
375 DPRINT1(
"USBSTOR_FdoHandlePnp: IRP_MN_STOP_DEVICE unimplemented\n");
387 DPRINT(
"IRP_MN_REMOVE_DEVICE\n");
406 if (DeviceExtension->IrpPendingCount != 0 ||
407 DeviceExtension->ActiveSrb !=
NULL)
413 DPRINT1(
"Failing removal/stop request due to pending requests present\n");
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
static const struct @259 InterfaceDesc[]
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS USBSTOR_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBSTOR_GetPipeHandles(IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBSTOR_SelectConfigurationAndInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBSTOR_GetMaxLUN(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI USBSTOR_GetBusInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface)
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
NTSTATUS NTAPI USBSTOR_SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
VOID NTAPI IoStopTimer(PDEVICE_OBJECT DeviceObject)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
#define IRP_MN_SURPRISE_REMOVAL
#define IoSkipCurrentIrpStackLocation(Irp)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
const KSDEVICE_DESCRIPTOR DeviceDescriptor
PDEVICE_OBJECT Objects[1]
COMMON_DEVICE_EXTENSION Common
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@4003 QueryDeviceRelations
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
struct _USB_CONFIGURATION_DESCRIPTOR USB_CONFIGURATION_DESCRIPTOR
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
#define USB_INTERFACE_DESCRIPTOR_TYPE
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
NTSTATUS USBSTOR_FdoHandleRemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
NTSTATUS USBSTOR_FdoHandleDeviceRelations(IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
NTSTATUS USBSTOR_FdoHandleStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
NTSTATUS USBSTOR_CreatePDO(IN PDEVICE_OBJECT DeviceObject, IN UCHAR LUN)
VOID USBSTOR_DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_STOP_DEVICE
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObReferenceObject