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;
261 DPRINT1(
"FDO_StartDevice lower device failed to start with %x\n",
Status);
270 DPRINT1(
"FDO_StartDevice failed to get descriptors with %x\n",
Status);
276 &FDODeviceExtension->Capabilities);
280 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
289 DPRINT1(
"FDO_StartDevice failed to get capabilities with %x\n",
Status);
307 ASSERT(FDODeviceExtension->FunctionDescriptorCount);
308 ASSERT(FDODeviceExtension->FunctionDescriptor);
310 FDODeviceExtension->FunctionDescriptorCount);
326 DPRINT(
"[USBCCGP] FDO initialized successfully\n");
343 if (FDODeviceExtension->ConfigurationDescriptor ==
NULL ||
344 FDODeviceExtension->InterfaceList ==
NULL)
351 FDODeviceExtension->InterfaceList);
366 DPRINT1(
"USBCCGP_SyncUrbRequest failed to unconfigure device\n",
Status);
396 DPRINT1(
"[USBCCGP] FDO IRP_MN_REMOVE\n");
436 &FDODeviceExtension->Capabilities,
442 IoStack->
Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK =
TRUE;
491 DPRINT(
"FDO_HandleResetCyclePort IOCTL %x\n", IoStack->
Parameters.DeviceIoControl.IoControlCode);
496 ListHead = &FDODeviceExtension->ResetPortListHead;
497 ResetActive = &FDODeviceExtension->ResetPortActive;
502 ListHead = &FDODeviceExtension->CyclePortListHead;
503 ResetActive = &FDODeviceExtension->CyclePortActive;
536 *ResetActive =
FALSE;
646 return PoCallDriver(FDODeviceExtension->NextDeviceObject,
Irp);
#define DO_DEVICE_INITIALIZING
return STATUS_NOT_SUPPORTED
NTSTATUS USBCCGP_EnumerateFunctions(IN PDEVICE_OBJECT DeviceObject)
#define IRP_MN_REMOVE_DEVICE
#define STATUS_INSUFFICIENT_RESOURCES
PBUS_INTERFACE_STANDARD BusInterface
NTSTATUS FDO_CloseConfiguration(IN PDEVICE_OBJECT DeviceObject)
#define STATUS_MORE_PROCESSING_REQUIRED
PDEVICE_OBJECT Objects[1]
NTSTATUS FDO_HandleInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
#define InsertTailList(ListHead, Entry)
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
_In_ PDEVICE_OBJECT DeviceObject
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
#define IRP_MN_QUERY_REMOVE_DEVICE
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
NTSTATUS NTAPI FDO_QueryCapabilitiesCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
_In_ PVOID _In_ ULONG Event
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
NTSTATUS FDO_CreateChildPdo(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
COMMON_DEVICE_EXTENSION Common
#define FILE_AUTOGENERATED_DEVICE_NAME
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
#define IOCTL_INTERNAL_USB_CYCLE_PORT
#define IRP_MN_QUERY_STOP_DEVICE
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
NTSTATUS FDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define KeAcquireSpinLock(sl, irql)
#define IRP_MN_START_DEVICE
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
NTSTATUS FDO_DeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_HandleResetCyclePort(PDEVICE_OBJECT DeviceObject, PIRP Irp)
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
VOID DumpFunctionDescriptor(IN PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor, IN ULONG FunctionDescriptorCount)
COMMON_DEVICE_EXTENSION Common
#define IRP_MJ_SYSTEM_CONTROL
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS USBCCGP_QueryInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1 BusInterface)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
#define KeInitializeEvent(pEvt, foo, foo2)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
NTSTATUS FDO_StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define InitializeListHead(ListHead)
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define KeReleaseSpinLock(sl, irql)
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
#define IOCTL_INTERNAL_USB_RESET_PORT
NTSTATUS FDO_HandlePnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define ObReferenceObject
VOID NTAPI IoFreeIrp(IN PIRP 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)
#define RtlZeroMemory(Destination, Length)
#define RtlCopyMemory(Destination, Source, Length)
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
PURB NTAPI USBD_CreateConfigurationRequestEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSBD_INTERFACE_LIST_ENTRY InterfaceList)
base of all file and directory entries
NTSTATUS FDO_HandleSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI USBCCGP_SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS FDO_QueryCapabilities(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_CAPABILITIES Capabilities)
#define IRP_MN_QUERY_CAPABILITIES