126 for(
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
128 if (FDODeviceExtension->ChildPDO[
Index])
138 if (!DeviceRelations)
145 for(
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
147 if (FDODeviceExtension->ChildPDO[
Index])
150 DeviceRelations->
Objects[DeviceRelations->
Count] = FDODeviceExtension->ChildPDO[
Index];
156 DeviceRelations->
Count++;
184 sizeof(
PDEVICE_OBJECT) * FDODeviceExtension->FunctionDescriptorCount);
185 if (!FDODeviceExtension->ChildPDO)
192 for(
Index = 0;
Index < FDODeviceExtension->FunctionDescriptorCount;
Index++)
210 FDODeviceExtension->ChildPDO[
Index] = PDODeviceObject;
218 PDODeviceExtension->FunctionDescriptor = &FDODeviceExtension->FunctionDescriptor[
Index];
220 PDODeviceExtension->FunctionIndex =
Index;
221 PDODeviceExtension->FDODeviceExtension = FDODeviceExtension;
222 PDODeviceExtension->InterfaceList = FDODeviceExtension->InterfaceList;
223 PDODeviceExtension->InterfaceListCount = FDODeviceExtension->InterfaceListCount;
224 PDODeviceExtension->ConfigurationHandle = FDODeviceExtension->ConfigurationHandle;
225 PDODeviceExtension->ConfigurationDescriptor = FDODeviceExtension->ConfigurationDescriptor;
236 PDODeviceObject->
Flags &= ~DO_DEVICE_INITIALIZING;
268 DPRINT1(
"FDO_StartDevice lower device failed to start with %x\n",
Status);
277 DPRINT1(
"FDO_StartDevice failed to get descriptors with %x\n",
Status);
283 &FDODeviceExtension->Capabilities);
287 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
296 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
314 ASSERT(FDODeviceExtension->FunctionDescriptorCount);
315 ASSERT(FDODeviceExtension->FunctionDescriptor);
317 FDODeviceExtension->FunctionDescriptorCount);
333 DPRINT(
"[USBCCGP] FDO initialized successfully\n");
350 if (FDODeviceExtension->ConfigurationDescriptor ==
NULL ||
351 FDODeviceExtension->InterfaceList ==
NULL)
358 FDODeviceExtension->InterfaceList);
373 DPRINT1(
"USBCCGP_SyncUrbRequest failed to unconfigure device\n",
Status);
403 DPRINT1(
"[USBCCGP] FDO IRP_MN_REMOVE\n");
443 &FDODeviceExtension->Capabilities,
507 ListHead = &FDODeviceExtension->ResetPortListHead;
508 ResetActive = &FDODeviceExtension->ResetPortActive;
513 ListHead = &FDODeviceExtension->CyclePortListHead;
514 ResetActive = &FDODeviceExtension->CyclePortActive;
547 *ResetActive =
FALSE;
657 return PoCallDriver(FDODeviceExtension->NextDeviceObject,
Irp);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBCCGP_EnumerateFunctions(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBCCGP_QueryInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface)
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
VOID DumpFunctionDescriptor(IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, IN ULONG FunctionDescriptorCount)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
#define FILE_AUTOGENERATED_DEVICE_NAME
#define IoSkipCurrentIrpStackLocation(Irp)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
#define STATUS_MORE_PROCESSING_REQUIRED
base of all file and directory entries
PDEVICE_OBJECT Objects[1]
COMMON_DEVICE_EXTENSION Common
PDRIVER_OBJECT DriverObject
BUS_INTERFACE_STANDARD BusInterface
union _IO_STACK_LOCATION::@1581 Parameters
struct _IO_STACK_LOCATION::@3980::@4007 DeviceCapabilities
struct _IO_STACK_LOCATION::@3980::@4005 QueryDeviceRelations
struct _IO_STACK_LOCATION::@1581::@1582 DeviceIoControl
COMMON_DEVICE_EXTENSION Common
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS FDO_HandleResetCyclePort(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI FDO_QueryCapabilitiesCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS FDO_StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_DeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_CloseConfiguration(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS FDO_CreateChildPdo(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS FDO_QueryCapabilities(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_CAPABILITIES Capabilities)
NTSTATUS FDO_HandleSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_HandleInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_HandlePnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PURB NTAPI USBD_CreateConfigurationRequestEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSBD_INTERFACE_LIST_ENTRY InterfaceList)
#define IOCTL_INTERNAL_USB_RESET_PORT
#define IOCTL_INTERNAL_USB_CYCLE_PORT
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#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_MJ_SYSTEM_CONTROL
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObReferenceObject