58 if (DeviceExtension->ChildPDO[
Index])
67 Irp->IoStatus.Information = 0;
73 DeviceRelations->
Count = 0;
78 if (DeviceExtension->ChildPDO[
Index])
81 DeviceRelations->
Objects[DeviceRelations->
Count] = DeviceExtension->ChildPDO[
Index];
86 DeviceRelations->
Count++;
113 if (DeviceExtension->ChildPDO[
Index] !=
NULL)
115 DPRINT(
"Deleting PDO %p RefCount %x AttachedDevice %p \n", DeviceExtension->ChildPDO[
Index], DeviceExtension->ChildPDO[
Index]->ReferenceCount, DeviceExtension->ChildPDO[
Index]->AttachedDevice);
121 if (DeviceExtension->DeviceDescriptor)
123 if (DeviceExtension->ConfigurationDescriptor)
125 if (DeviceExtension->InterfaceInformation)
127 if (DeviceExtension->ResetDeviceWorkItem)
129 if (DeviceExtension->SerialNumber)
165 DPRINT1(
"USBSTOR_FdoHandleStartDevice Lower device failed to start %x\n",
Status);
169 if (!DeviceExtension->ResetDeviceWorkItem)
172 DeviceExtension->ResetDeviceWorkItem =
WorkItem;
187 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get device descriptor with %x\n",
Status);
204 DPRINT1(
"USB Device is not a bulk only device and is not currently supported\n");
210 DPRINT1(
"USB Floppy devices are not supported\n");
219 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to select configuration / interface with %x\n",
Status);
227 DPRINT1(
"USBSTOR_FdoHandleStartDevice no pipe handles %x\n",
Status);
234 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get max lun %x\n",
Status);
245 DPRINT1(
"USBSTOR_FdoHandleStartDevice USBSTOR_CreatePDO failed for Index %lu with Status %x\n",
Index,
Status);
250 DeviceExtension->InstanceCount++;
252 }
while(Index < DeviceExtension->MaxLUN);
264 DPRINT1(
"USBSTOR_FdoHandleStartDevice failed to get device interface %x\n",
Status);
271 DPRINT(
"USBSTOR_FdoHandleStartDevice FDO is initialized\n");
306 DPRINT1(
"USBSTOR_FdoHandlePnp: IRP_MN_STOP_DEVICE unimplemented\n");
316 DPRINT(
"IRP_MN_REMOVE_DEVICE\n");
329 if (DeviceExtension->IrpPendingCount != 0 || DeviceExtension->ActiveSrb !=
NULL)
332 DPRINT1(
"Failing removal/stop request due to pending requests present\n");
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define STATUS_NOT_SUPPORTED
#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)
#define ExAllocatePoolWithTag(hernya, size, tag)
VOID NTAPI IoStopTimer(PDEVICE_OBJECT DeviceObject)
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
#define ExFreePoolWithTag(_P, _T)
#define IRP_MN_SURPRISE_REMOVAL
#define IoSkipCurrentIrpStackLocation(Irp)
#define IoCopyCurrentIrpStackLocationToNext(Irp)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
const KSDEVICE_DESCRIPTOR DeviceDescriptor
PDEVICE_OBJECT Objects[1]
COMMON_DEVICE_EXTENSION Common
struct _IO_STACK_LOCATION::@3974::@3999 QueryDeviceRelations
union _IO_STACK_LOCATION::@1575 Parameters
#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)
#define USB_PROTOCOL_BULK
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
#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