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++;
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");
return STATUS_NOT_SUPPORTED
#define IRP_MN_REMOVE_DEVICE
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS USBSTOR_FdoHandleDeviceRelations(IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
PDEVICE_OBJECT Objects[1]
NTSTATUS NTAPI USBSTOR_GetBusInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
NTSTATUS USBSTOR_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBSTOR_FdoHandleStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS USBSTOR_FdoHandleRemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp)
_In_ PDEVICE_OBJECT DeviceObject
return STATUS_NOT_IMPLEMENTED
NTSTATUS NTAPI USBSTOR_SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static const struct @255 InterfaceDesc[]
#define IRP_MN_QUERY_REMOVE_DEVICE
VOID NTAPI IoStopTimer(PDEVICE_OBJECT DeviceObject)
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define USB_INTERFACE_DESCRIPTOR_TYPE
NTSTATUS USBSTOR_SelectConfigurationAndInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
#define IoCompleteRequest
#define IRP_MN_QUERY_STOP_DEVICE
const KSDEVICE_DESCRIPTOR DeviceDescriptor
#define IRP_MN_SURPRISE_REMOVAL
#define IRP_MN_STOP_DEVICE
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
#define IRP_MN_START_DEVICE
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
#define STATUS_UNSUCCESSFUL
COMMON_DEVICE_EXTENSION Common
struct _USB_CONFIGURATION_DESCRIPTOR USB_CONFIGURATION_DESCRIPTOR
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
VOID USBSTOR_DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
NTSTATUS USBSTOR_CreatePDO(IN PDEVICE_OBJECT DeviceObject, IN UCHAR LUN)
#define ObReferenceObject
NTSTATUS USBSTOR_GetPipeHandles(IN PFDO_DEVICE_EXTENSION DeviceExtension)
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
NTSTATUS USBSTOR_GetMaxLUN(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
#define IRP_MN_QUERY_CAPABILITIES