13#define NDEBUG_USBHUB_SCE
14#define NDEBUG_USBHUB_PNP
27 DPRINT(
"USBH_Wait: Milliseconds - %x\n", Milliseconds);
43 DPRINT(
"USBHUB_GetConfigValue: ... \n");
68 DPRINT1(
"USBH_CompleteIrp: Irp - %p, CompleteStatus - %X\n",
73 Irp->IoStatus.Status = CompleteStatus;
82 DPRINT_PNP(
"USBH_PassIrp: DeviceObject - %p, Irp - %p\n",
100 DPRINT(
"USBH_SyncIrpComplete: ... \n");
126 IsSet = (BitMapAddress[Bit / 8] & (1 << (Bit & 7))) != 0;
127 DPRINT(
"IsBitSet: Bit - %lX, IsSet - %x\n", Bit, IsSet);
160 DPRINT(
"USBH_WriteFailReason: ID - %x\n", FailReason);
193 DPRINT(
"USBH_TimeoutDPC ... \n");
224 DPRINT(
"USBH_SetPdoRegistryParameter ... \n");
262 DPRINT(
"USBH_SyncSubmitUrb: ... \n");
264 Urb->UrbHeader.UsbdDeviceHandle =
NULL;
290 if (HubTimeoutContext)
294 HubTimeoutContext->
Irp =
Irp;
308 DueTime.QuadPart = -5000 * 10000;
321 IsWaitTimeout =
TRUE;
360 DPRINT(
"USBH_FdoSyncSubmitUrb: FdoDevice - %p, Urb - %p\n",
364 HubExtension = FdoDevice->DeviceExtension;
386 DPRINT(
"USBH_Transact: ... \n");
439 Urb->
Hdr.UsbdDeviceHandle =
NULL;
449 Urb->
Value = RequestValue;
450 Urb->
Index = RequestIndex;
454 if (IsDeviceToHost && BufferLen)
477 ULONG ResetRetry = 0;
480 DPRINT(
"USBH_SyncResetPort: Port - %x\n",
Port);
496 (
PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0))
528 Timeout.QuadPart = -5000 * 10000;
536 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_RESET_PORT_LOCK;
558 (
PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0) ||
565 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_RESET_PORT_LOCK;
579 if ((
PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0) &&
587 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_RESET_PORT_LOCK;
598 KeSetEvent(&HubExtension->PendingRequestEvent,
619 DPRINT(
"USBH_GetDeviceType: ... \n");
625 DPRINT1(
"USBH_GetDeviceType: no QueryDeviceInformation()\n");
639 DPRINT1(
"USBH_GetDeviceType: ExAllocatePoolWithTag() failed\n");
686 DPRINT(
"USBHUB_GetExtendedHubInfo: ... \n");
688 GetExtendedHubInformation = HubExtension->BusInterface.GetExtendedHubInformation;
690 return GetExtendedHubInformation(HubExtension->BusInterface.BusContext,
691 HubExtension->LowerPDO,
704 DPRINT(
"USBH_GetRootHubExtension: HubExtension - %p\n", HubExtension);
706 RootHubExtension = HubExtension;
708 if (HubExtension->LowerPDO != HubExtension->RootHubPdo)
716 while (
Device->DriverObject != HubExtension->Common.SelfDevice->DriverObject);
718 RootHubExtension =
Device->DeviceExtension;
721 DPRINT(
"USBH_GetRootHubExtension: RootHubExtension - %p\n", RootHubExtension);
723 return RootHubExtension;
738 DPRINT(
"USBH_SyncGetRootHubPdo: ... \n");
790 DPRINT(
"USBH_SyncGetHubCount: *OutHubCount - %x\n", *OutHubCount);
840 DPRINT(
"USBH_SyncGetDeviceHandle: ... \n");
856 DPRINT1(
"USBH_SyncGetDeviceHandle: Irp - NULL!\n");
883 DPRINT(
"USBH_GetDeviceDescriptor: ... \n");
891 DPRINT1(
"USBH_SyncGetDeviceHandle: Urb - NULL!\n");
922 DPRINT(
"USBH_SyncGetDeviceConfigurationDescriptor: ... \n");
982 DPRINT(
"USBH_GetConfigurationDescriptor: ... \n");
1023 *OutDescriptor =
NULL;
1028 if (ReturnedLen < ConfigDescriptor->wTotalLength)
1040 *OutDescriptor =
NULL;
1060 DPRINT(
"USBH_SyncGetHubDescriptor: ... \n");
1066 if (!ExtendedHubInfo)
1079 ExtendedHubInfo =
NULL;
1125 RequestValue = 0x2900;
1141 HubDescriptor =
NULL;
1160 if (HubExtension->PortData)
1162 PortData = HubExtension->PortData;
1164 for (ix = 0; ix < NumberPorts; ix++)
1168 if (ExtendedHubInfo)
1204 for (ix = 0; ix < NumberPorts; ix++)
1208 if (ExtendedHubInfo)
1220 HubExtension->HubDescriptor = HubDescriptor;
1222 HubExtension->PortData = PortData;
1224 if (ExtendedHubInfo)
1238 if (ExtendedHubInfo)
1257 ULONG TransferedLength;
1260 DPRINT(
"USBH_SyncGetStringDescriptor: Index - %x, LanguageId - %x\n",
1308 *OutLength = TransferedLength;
1311 if (IsValidateLength && TransferedLength !=
Descriptor->bLength)
1332 DPRINT(
"USBH_SyncGetStatus: ... \n");
1350 Urb->
Index = RequestIndex;
1354 *OutStatus = UsbStatus;
1369 DPRINT(
"USBH_SyncGetHubStatus\n");
1394 DPRINT(
"USBH_SyncClearHubStatus: RequestValue - %x\n", RequestValue);
1421 DPRINT(
"USBH_SyncGetPortStatus: Port - %x\n",
Port);
1448 DPRINT(
"USBH_SyncClearPortStatus: Port - %x, RequestValue - %x\n",
1480 DPRINT(
"USBH_SyncPowerOnPort: Port - %x, IsWait - %x\n",
Port, IsWait);
1483 PortData = &HubExtension->PortData[
Port - 1];
1486 if (
PortStatus->PortStatus.Usb20PortStatus.CurrentConnectStatus == 1)
1510 HubDescriptor = HubExtension->HubDescriptor;
1514 PortStatus->PortStatus.Usb20PortStatus.CurrentConnectStatus = 1;
1529 DPRINT(
"USBH_SyncPowerOnPorts: ... \n");
1531 HubDescriptor = HubExtension->HubDescriptor;
1540 DPRINT1(
"USBH_SyncPowerOnPorts: USBH_SyncPowerOnPort() failed - %lX\n",
1560 DPRINT(
"USBH_SyncDisablePort ... \n");
1562 PortData = &HubExtension->PortData[
Port - 1];
1596 DPRINT(
"USBH_HubIsBusPowered: ... \n");
1628 DPRINT_SCE(
"USBH_ChangeIndicationAckChangeComplete: ... \n");
1666 DPRINT_SCE(
"USBH_ChangeIndicationAckChange: ... \n");
1670 Urb->Hdr.UsbdDeviceHandle =
NULL;
1673 Urb->TransferBufferLength = 0;
1674 Urb->TransferBuffer =
NULL;
1675 Urb->TransferBufferMDL =
NULL;
1676 Urb->UrbLink =
NULL;
1686 Urb->Value = RequestValue;
1689 IoSizeOfIrp(HubExtension->LowerDevice->StackSize),
1690 HubExtension->LowerDevice->StackSize);
1720 DPRINT_SCE(
"USBH_ChangeIndicationProcessChange: PortStatus - %lX\n",
1779 DPRINT_SCE(
"USBH_ChangeIndicationQueryChange: Port - %x\n",
Port);
1785 ASSERT(HubExtension->WorkItemToQueue !=
NULL);
1787 WorkItem = HubExtension->WorkItemToQueue;
1788 HubExtension->WorkItemToQueue =
NULL;
1796 Urb->Hdr.UsbdDeviceHandle =
NULL;
1800 Urb->TransferBuffer = &HubExtension->PortStatus;
1801 Urb->TransferBufferLength =
sizeof(HubExtension->PortStatus);
1802 Urb->TransferBufferMDL =
NULL;
1803 Urb->UrbLink =
NULL;
1815 HubExtension->Port =
Port;
1818 IoSizeOfIrp(HubExtension->LowerDevice->StackSize),
1819 HubExtension->LowerDevice->StackSize);
1846 DPRINT_SCE(
"USBH_ProcessHubStateChange: HubStatus - %lx\n", HubStatus->AsUlong32);
1848 HubStatusChange = HubStatus->HubChange;
1852 DPRINT1(
"USBH_ProcessHubStateChange: LocalPowerChange\n");
1860 if (HubStatus->HubStatus.OverCurrent)
1862 DPRINT1(
"USBH_ProcessHubStateChange: OverCurrent UNIMPLEMENTED. FIXME\n");
1883 DPRINT_SCE(
"USBH_ProcessPortStateChange ... \n");
1886 PortData = &HubExtension->PortData[
Port - 1];
1888 PortStatusChange =
PortStatus->PortChange.Usb20PortChange;
1898 PortData = &HubExtension->PortData[
Port - 1];
1961 DPRINT1(
"USBH_ProcessPortStateChange: SuspendChange UNIMPLEMENTED. FIXME\n");
1966 DPRINT1(
"USBH_ProcessPortStateChange: OverCurrentIndicatorChange UNIMPLEMENTED. FIXME\n");
1988 DPRINT(
"USBH_GetPortStatus ... \n");
1995 HubExtension->LowerDevice,
2039 DPRINT(
"USBH_EnableParentPort ... \n");
2044 HubExtension->LowerDevice,
2083 DPRINT(
"USBH_ResetInterruptPipe ... \n");
2095 Urb->
PipeHandle = HubExtension->PipeInfo.PipeHandle;
2109 HubExtension->RequestErrors = 0;
2120 ULONG PortStatusFlags = 0;
2122 DPRINT(
"USBH_ResetHub: ... \n");
2157 DPRINT_SCE(
"USBH_ChangeIndicationWorker ... \n");
2176 if (!HubExtension->RequestErrors)
2181 DPRINT_SCE(
"USBH_ChangeIndicationWorker: RequestErrors - %x\n",
2182 HubExtension->RequestErrors);
2184 if (HubExtension->LowerPDO == HubExtension->RootHubPdo)
2189 LowerPortExtension = HubExtension->LowerPDO->DeviceExtension;
2198 if (!LowerHubExtension)
2209 !
PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus)
2224 DPRINT1(
"USBH_ChangeIndicationWorker: USBHUB_FDO_FLAG_ESD_RECOVERING FIXME\n");
2239 Port < HubExtension->HubDescriptor->bNumberOfPorts;
2278 HubExtension->RequestErrors++;
2299 KeSetEvent(&HubExtension->PendingRequestEvent,
2337 DPRINT_SCE(
"USBH_ChangeIndication: IrpStatus - %x, UrbStatus - %x, HubFlags - %lX\n",
2338 Irp->IoStatus.Status,
2359 DPRINT_SCE(
"USBH_ChangeIndication: HubExtension->RequestErrors - %x\n",
2365 DPRINT_SCE(
"USBH_ChangeIndication: HubExtension->RequestErrors - %x\n",
2380 (
PVOID *)&HubWorkItemBuffer,
2406 Bitmap = HubWorkItemBuffer + 1;
2422 if (
Port > NumPorts)
2449 DPRINT_SCE(
"USBH_SubmitStatusChangeTransfer: HubExtension - %p, SCEIrp - %p\n",
2451 HubExtension->SCEIrp);
2455 DPRINT_SCE(
"USBH_SubmitStatusChangeTransfer: USBHUB_FDO_FLAG_NOT_D0_STATE\n");
2456 DPRINT_SCE(
"USBH_SubmitStatusChangeTransfer: HubFlags - %lX\n",
2457 HubExtension->HubFlags);
2462 Irp = HubExtension->SCEIrp;
2473 Urb->
Hdr.UsbdDeviceHandle =
NULL;
2475 Urb->
PipeHandle = HubExtension->PipeInfo.PipeHandle;
2483 IoSizeOfIrp(HubExtension->LowerDevice->StackSize),
2484 HubExtension->LowerDevice->StackSize);
2516 DPRINT(
"USBD_CreateDeviceEx: Port - %x, UsbPortStatus - 0x%04X\n",
2518 UsbPortStatus.AsUshort16);
2520 CreateUsbDevice = HubExtension->BusInterface.CreateUsbDevice;
2522 if (!CreateUsbDevice)
2529 return CreateUsbDevice(HubExtension->BusInterface.BusContext,
2532 UsbPortStatus.AsUshort16,
2544 DPRINT(
"USBD_RemoveDeviceEx: DeviceHandle - %p, Flags - %X\n",
2548 RemoveUsbDevice = HubExtension->BusInterface.RemoveUsbDevice;
2550 if (!RemoveUsbDevice)
2555 return RemoveUsbDevice(HubExtension->BusInterface.BusContext,
2573 DPRINT(
"USBD_InitializeDeviceEx: ... \n");
2575 InitializeUsbDevice = HubExtension->BusInterface.InitializeUsbDevice;
2576 GetUsbDescriptors = HubExtension->BusInterface.GetUsbDescriptors;
2578 if (!InitializeUsbDevice || !GetUsbDescriptors)
2583 Status = InitializeUsbDevice(HubExtension->BusInterface.BusContext,
2591 return GetUsbDescriptors(HubExtension->BusInterface.BusContext,
2607 DPRINT(
"USBHUB_SetDeviceHandleData ... \n");
2609 SetDeviceHandleData = HubExtension->BusInterface.SetDeviceHandleData;
2611 if (!SetDeviceHandleData)
2616 SetDeviceHandleData(HubExtension->BusInterface.BusContext,
2627 DPRINT(
"USBHUB_FlushAllTransfers ... \n");
2629 FlushTransfers = HubExtension->BusInterface.FlushTransfers;
2633 FlushTransfers(HubExtension->BusInterface.BusContext,
NULL);
2641 IN PUSB_NODE_CONNECTION_INFORMATION_EX
Info,
2648 PUSB_NODE_CONNECTION_INFORMATION_EX NodeInfo;
2654 DPRINT(
"USBD_GetDeviceInformationEx ... \n");
2702 NodeInfoLength = (
sizeof(USB_NODE_CONNECTION_INFORMATION_EX) -
sizeof(
USB_PIPE_INFO)) +
2715 NodeInfo->ConnectionIndex =
Info->ConnectionIndex;
2721 NodeInfo->CurrentConfigurationValue =
DeviceInfo->CurrentConfigurationValue;
2724 NodeInfo->DeviceAddress =
DeviceInfo->DeviceAddress;
2725 NodeInfo->NumberOfOpenPipes =
DeviceInfo->NumberOfOpenPipes;
2726 NodeInfo->ConnectionStatus =
Info->ConnectionStatus;
2728 for (PipeNumber = 0;
2742 if (NodeInfoLength <=
Length)
2768 DPRINT(
"USBD_RestoreDeviceEx: HubExtension - %p, OldDeviceHandle - %p, NewDeviceHandle - %p\n",
2773 RestoreUsbDevice = HubExtension->BusInterface.RestoreUsbDevice;
2775 if (RestoreUsbDevice)
2777 Status = RestoreUsbDevice(HubExtension->BusInterface.BusContext,
2795 PVOID * OutHubWorkItemBuffer,
2800 PVOID WorkItemBuffer;
2802 DPRINT(
"USBH_AllocateWorkItem: ... \n");
2838 if (!WorkItemBuffer)
2857 if (OutHubIoWorkItem)
2859 *OutHubIoWorkItem = HubIoWorkItem;
2862 if (OutHubWorkItemBuffer)
2912 DPRINT(
"USBH_Worker: HubIoWorkItem %p complete\n",
Context);
2920 DPRINT(
"USBH_QueueWorkItem: ... \n");
2926 &HubIoWorkItem->HubWorkItemLink,
2927 &HubExtension->WorkItemSpinLock);
2931 HubIoWorkItem->HubWorkItemType,
2941 DPRINT(
"USBH_FreeWorkItem: ... \n");
2943 WorkItem = HubIoWorkItem->HubWorkItem;
2945 if (HubIoWorkItem->HubWorkItemBuffer)
2961 DPRINT(
"USBHUB_RootHubCallBack: ... \n");
2965 if (HubExtension->
SCEIrp)
2990 DPRINT(
"USBD_RegisterRootHubCallBack: ... \n");
2992 RootHubInitNotification = HubExtension->BusInterface.RootHubInitNotification;
2994 if (!RootHubInitNotification)
3001 return RootHubInitNotification(HubExtension->BusInterface.BusContext,
3013 DPRINT(
"USBD_UnRegisterRootHubCallBack ... \n");
3015 RootHubInitNotification = HubExtension->BusInterface.RootHubInitNotification;
3017 if (!RootHubInitNotification)
3022 Status = RootHubInitNotification(HubExtension->BusInterface.BusContext,
3046 DPRINT(
"USBH_HubSetDWakeCompletion: ... \n");
3063 DPRINT(
"USBH_HubQueuePortIdleIrps ... \n");
3069 NumPorts = HubExtension->HubDescriptor->bNumberOfPorts;
3073 PortDevice = HubExtension->PortData[
Port].DeviceObject;
3084 DPRINT1(
"USBH_HubQueuePortIdleIrps: IdleIrp != NULL. FIXME\n");
3092 HubIdleIrp = HubExtension->PendingIdleIrp;
3093 HubExtension->PendingIdleIrp =
NULL;
3114 DPRINT(
"USBH_HubCompleteQueuedPortIdleIrps ... \n");
3118 DPRINT1(
"USBH_HubCompleteQueuedPortIdleIrps: IdleList not Empty. FIXME\n");
3132 DPRINT(
"USBH_FlushPortPwrList ... \n");
3142 for (
Port = 0;
Port < HubExtension->HubDescriptor->bNumberOfPorts; ++
Port)
3144 PortDevice = HubExtension->PortData[
Port].DeviceObject;
3165 DPRINT1(
"USBH_FlushPortPwrList: PortPowerList FIXME\n");
3177 KeSetEvent(&HubExtension->PendingRequestEvent,
3190 DPRINT(
"USBH_HubCompletePortIdleIrps ... \n");
3209 DPRINT(
"USBH_HubCancelIdleIrp ... \n");
3231 DPRINT(
"USBH_CheckIdleAbort: ... \n");
3244 PortData = HubExtension->PortData;
3246 for (
Port = 0;
Port < HubExtension->HubDescriptor->bNumberOfPorts;
Port++)
3262 if (IsExtCheck ==
TRUE)
3264 PortData = HubExtension->PortData;
3267 Port < HubExtension->HubDescriptor->bNumberOfPorts;
3292 KeSetEvent(&HubExtension->PendingRequestEvent,
3308 DPRINT(
"USBH_FdoWaitWakeIrpCompletion ... \n");
3320 DPRINT(
"USBH_FdoSubmitWaitWakeIrp: ... \n");
3322 PowerState.SystemState = HubExtension->SystemWake;
3341 HubExtension->PendingWakeIrp =
Irp;
3342 DPRINT(
"USBH_FdoSubmitWaitWakeIrp: PendingWakeIrp - %p\n",
3343 HubExtension->PendingWakeIrp);
3348 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_PENDING_WAKE_IRP;
3352 KeSetEvent(&HubExtension->PendingRequestEvent,
3377 PUSB_IDLE_CALLBACK_INFO CallbackInfo;
3384 DPRINT(
"USBH_FdoIdleNotificationCallback: HubExtension - %p, HubFlags - %lX\n",
3408 DPRINT(
"Status != STATUS_PENDING. DbgBreakPoint()\n");
3410 HubExtension->
HubFlags &= ~USBHUB_FDO_FLAG_GOING_IDLE;
3454 if (!CallbackInfo->IdleCallback)
3474 DPRINT(
"USBH_FdoIdleNotificationCallback: IdleContext - %p\n",
3475 CallbackInfo->IdleContext);
3477 CallbackInfo->IdleCallback(CallbackInfo->IdleContext);
3510 DPRINT1(
"USBH_FdoIdleNotificationCallback: HubFlags - %lX\n",
3545 HubExtension->
HubFlags &= ~USBHUB_FDO_FLAG_GOING_IDLE;
3550 DPRINT(
"USBH_FdoIdleNotificationCallback: LowerPdo - %p\n",
3553 DPRINT(
"USBH_FdoIdleNotificationCallback: PowerState.DeviceState - %x\n",
3584 DPRINT(
"USBH_CompletePortIdleIrpsWorker ... \n");
3587 NtStatus = IdlePortContext->
Status;
3593 DPRINT1(
"USBH_CompletePortIdleIrpsWorker: USBH_RegQueryFlushPortPowerIrpsFlag() UNIMPLEMENTED. FIXME\n");
3612 DPRINT(
"USBH_IdleCompletePowerHubWorker ... \n");
3615 HubExtension->CurrentPowerState.DeviceState !=
PowerDeviceD0 &&
3643 HubExtension->
HubFlags &= ~USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST;
3648 DPRINT(
"USBH_FdoIdleNotificationRequestComplete: IdleIrp - %p\n", IdleIrp);
3657 NtStatus =
Irp->IoStatus.Status;
3659 DPRINT(
"USBH_FdoIdleNotificationRequestComplete: NtStatus - %lX\n",
3667 DPRINT(
"USBH_FdoIdleNotificationRequestComplete: DeviceState - %x\n",
3678 (
PVOID *)&HubWorkItemBuffer,
3683 HubWorkItemBuffer->
Status = NtStatus;
3699 (
PVOID *)&HubWorkItemBuffer,
3704 HubWorkItemBuffer->
Status = NtStatus;
3713 DPRINT(
"USBH_FdoIdleNotificationRequestComplete: Irp - %p\n",
Irp);
3731 DPRINT(
"USBH_FdoSubmitIdleRequestIrp: HubExtension - %p, PendingIdleIrp - %p\n",
3733 HubExtension->PendingIdleIrp);
3735 if (HubExtension->PendingIdleIrp)
3742 HubFlags = HubExtension->HubFlags;
3747 HubExtension->HubFlags = HubFlags & ~USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST;
3752 LowerPDO = HubExtension->LowerPDO;
3755 HubExtension->IdleCallbackInfo.IdleContext = HubExtension;
3761 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST;
3796 HubExtension->PendingIdleIrp =
Irp;
3820 DPRINT(
"USBH_CheckHubIdle: FIXME !!! HubExtension - %p\n", HubExtension);
3838 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_CHECK_IDLE_LOCK;
3843 HubFlags = HubExtension->HubFlags;
3844 DPRINT(
"USBH_CheckHubIdle: HubFlags - %lX\n", HubFlags);
3864 if (HubExtension->ResetRequestCount)
3870 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_DEFER_CHECK_IDLE;
3882 IsAllPortsIdle =
TRUE;
3884 PortData = HubExtension->PortData;
3887 Port < HubExtension->HubDescriptor->bNumberOfPorts;
3898 DPRINT(
"USBH_CheckHubIdle: PortExtension - %p\n",
3901 IsAllPortsIdle =
FALSE;
3926 KeSetEvent(&HubExtension->PendingRequestEvent,
3931 DPRINT(
"USBH_CheckHubIdle: IsAllPortsIdle - %x, IsHubIdle - %x\n",
3935 if (IsAllPortsIdle && IsHubIdle)
3942 HubExtension->HubFlags &= ~USBHUB_FDO_FLAG_CHECK_IDLE_LOCK;
3951 DPRINT(
"USBH_CheckIdleWorker: ... \n");
3962 DPRINT(
"USBH_CheckIdleDeferred: HubExtension - %p\n", HubExtension);
3971 DPRINT(
"USBH_CheckIdleDeferred: HubIoWorkItem - %p\n", HubIoWorkItem);
3988 DPRINT(
"USBH_PdoSetCapabilities ... \n");
3990 HubExtension = PortExtension->HubExtension;
3992 PortExtension->Capabilities.Size = 64;
3993 PortExtension->Capabilities.Version = 1;
3995 PortExtension->Capabilities.Removable = 1;
3996 PortExtension->Capabilities.Address = PortExtension->PortNumber;
3998 if (PortExtension->SerialNumber)
4000 PortExtension->Capabilities.UniqueID = 1;
4004 PortExtension->Capabilities.UniqueID = 0;
4007 PortExtension->Capabilities.RawDeviceOK = 0;
4019 PortExtension->Capabilities.DeviceD1 = 1;
4020 PortExtension->Capabilities.DeviceD2 = 1;
4022 PortExtension->Capabilities.WakeFromD0 = 1;
4023 PortExtension->Capabilities.WakeFromD1 = 1;
4024 PortExtension->Capabilities.WakeFromD2 = 1;
4026 pDeviceState = &PortExtension->Capabilities.DeviceState[2];
4062 DPRINT(
"USBH_ProcessDeviceInformation ... \n");
4067 sizeof(PortExtension->InterfaceDescriptor));
4069 PortExtension->PortPdoFlags &= ~USBHUB_PDO_FLAG_HUB_DEVICE;
4084 PortExtension->PortPdoFlags &= ~USBHUB_PDO_FLAG_REMOTE_WAKEUP;
4095 DPRINT_PNP(
"USBH_ProcessDeviceInformation: Class - %x, SubClass - %x, Protocol - %x\n",
4096 PortExtension->DeviceDescriptor.bDeviceClass,
4097 PortExtension->DeviceDescriptor.bDeviceSubClass,
4098 PortExtension->DeviceDescriptor.bDeviceProtocol);
4100 DPRINT_PNP(
"USBH_ProcessDeviceInformation: bNumConfigurations - %x, bNumInterfaces - %x\n",
4101 PortExtension->DeviceDescriptor.bNumConfigurations,
4116 PortExtension->DeviceDescriptor.bDeviceSubClass == 0x02 &&
4117 PortExtension->DeviceDescriptor.bDeviceProtocol == 0x01)) &&
4119 (PortExtension->DeviceDescriptor.bNumConfigurations < 2))
4121 DPRINT(
"USBH_ProcessDeviceInformation: Multi-Interface configuration\n");
4144 sizeof(PortExtension->InterfaceDescriptor));
4178 DPRINT(
"USBH_CheckDeviceIDUnique: idVendor - 0x%04X, idProduct - 0x%04X\n",
4182 if (!HubExtension->HubDescriptor->bNumberOfPorts)
4187 for (
Port = 0;
Port < HubExtension->HubDescriptor->bNumberOfPorts;
Port++)
4189 PortDevice = HubExtension->PortData[
Port].DeviceObject;
4203 SN_DescriptorLength);
4205 if (NumberBytes == SN_DescriptorLength)
4224 DPRINT(
"USBH_ValidateSerialNumberString: ... \n");
4226 for (ix = 0; SerialNumberString[ix] !=
UNICODE_NULL; ix++)
4228 Symbol = SerialNumberString[ix];
4230 if (Symbol < 0x20 || Symbol > 0x7F ||
Symbol == 0x2C)
4252 DPRINT(
"USBH_CheckDeviceLanguage: LanguageId - 0x%04X\n", LanguageId);
4284 for (ix = 1; ix < NumSymbols; ix++)
4286 if (*pSymbol == (
WCHAR)LanguageId)
4316 DPRINT(
"USBH_GetSerialNumberString: ... \n");
4318 *OutSerialNumber =
NULL;
4319 *OutDescriptorLength = 0;
4361 if (!SerialNumberBuffer)
4369 *OutSerialNumber = SerialNumberBuffer;
4370 *OutDescriptorLength =
Length;
4384 ULONG PdoNumber = 0;
4385 WCHAR CharDeviceName[64];
4390 LPWSTR SerialNumberBuffer;
4397 DPRINT(
"USBH_CreateDevice: Port - %x, UsbPortStatus - %lX\n",
4399 UsbPortStatus.AsUshort16);
4404 sizeof(CharDeviceName),
4405 L"\\Device\\USBPDO-%d",
4429 DeviceObject->StackSize = HubExtension->RootHubPdo2->StackSize;
4434 DPRINT(
"USBH_CreateDevice: PortExtension - %p\n", PortExtension);
4458 SerialNumberBuffer =
NULL;
4460 IsHsDevice = UsbPortStatus.Usb20PortStatus.HighSpeedDeviceAttached;
4461 IsLsDevice = UsbPortStatus.Usb20PortStatus.LowSpeedDeviceAttached;
4463 if (IsLsDevice == 0)
4485 DPRINT1(
"USBH_CreateDevice: IoCreateDevice() failed - %lX\n",
Status);
4496 DPRINT1(
"USBH_CreateDevice: USBD_CreateDeviceEx() failed - %lX\n",
Status);
4504 DPRINT1(
"USBH_CreateDevice: USBH_SyncResetPort() failed - %lX\n",
Status);
4522 DPRINT1(
"USBH_CreateDevice: USBD_InitializeDeviceEx() failed - %lX\n",
Status);
4527 DPRINT1(
"USBH_RegQueryDeviceIgnoreHWSerNumFlag UNIMPLEMENTED. FIXME\n");
4534 IgnoringHwSerial =
FALSE;
4537 if (IgnoringHwSerial)
4548 &SerialNumberBuffer,
4553 if (SerialNumberBuffer)
4558 SerialNumberBuffer =
NULL;
4561 if (SerialNumberBuffer &&
4569 SerialNumberBuffer =
NULL;
4574 SerialNumberBuffer);
4601 if (SerialNumberBuffer)
4630 DPRINT(
"USBH_ResetDevice: HubExtension - %p, Port - %x, IsKeepDeviceData - %x, IsWait - %x\n",
4642 !(
PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus))
4656 PortData = &HubExtension->PortData[
Port-1];
4671 KeSetEvent(&HubExtension->PendingRequestEvent,
4754 if (IsKeepDeviceData)
4772 PortExtension->
PortPdoFlags &= ~USBHUB_PDO_FLAG_REMOVING_PORT_PDO;
4799 KeSetEvent(&HubExtension->PendingRequestEvent,
4825 DPRINT(
"USBH_PdoDispatch: IRP_MJ_CREATE / IRP_MJ_CLOSE (%d)\n",
4833 DPRINT(
"USBH_PdoDispatch: IRP_MJ_DEVICE_CONTROL ControlCode - %x\n",
4845 DPRINT1(
"USBH_PdoDispatch: IOCTL_KS_PROPERTY FIXME\n");
4864 &ShouldCompleteIrp);
4866 if (ShouldCompleteIrp)
4878 DPRINT1(
"USBH_PdoDispatch: USBH_SystemControl() UNIMPLEMENTED. FIXME\n");
4905 DPRINT(
"USBH_FdoDispatch: HubExtension - %p, Irp - %p, MajorFunction - %X\n",
4933 DPRINT1(
"USBH_FdoDispatch: USBH_SystemControl() UNIMPLEMENTED. FIXME\n");
4955 DPRINT(
"USBH_AddDevice: DriverObject - %p, LowerPDO - %p\n",
4971 DPRINT1(
"USBH_AddDevice: IoCreateDevice() fail\n");
4992 DPRINT1(
"USBH_AddDevice: IoAttachDeviceToDeviceStack() fail\n");
5002 DPRINT(
"USBH_AddDevice: LowerDevice - %p\n", LowerDevice);
5014 DPRINT(
"USBH_AddDevice: call IoWMIRegistrationControl() UNIMPLEMENTED. FIXME\n");
5023 DPRINT(
"USBH_DriverUnload: UNIMPLEMENTED\n");
5038 ULONG ExtensionType;
5047 DPRINT(
"USBH_HubDispatch: DeviceObject - %p, Irp - %p\n",
5071 DPRINT(
"USBH_HubDispatch: DeviceObject - %p, Irp - %p\n",
5080 DPRINT1(
"USBH_HubDispatch: Unknown ExtensionType - %x\n", ExtensionType);
5094 DPRINT(
"USBH_RegQueryGenericUSBDeviceString ... \n");
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define ALIGN_DOWN_BY(size, align)
#define InterlockedIncrement
#define InterlockedExchange
#define InterlockedDecrement
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
#define STATUS_NOT_SUPPORTED
#define STATUS_DEVICE_REMOVED
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
BOOL NTAPI QueryDeviceInformation(_In_ PWCHAR DriveRoot, _Out_ PVOID DeviceInformation, _In_ ULONG BufferSize)
Retrieves disk device information.
MIXER_STATUS Enum(IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutKey)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
DRIVER_INITIALIZE DriverEntry
VOID NTAPI USBHUB_DumpingConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor)
VOID NTAPI USBHUB_DumpingDeviceDescriptor(IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
NTSTATUS NTAPI USBH_DeviceControl(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp)
NTSTATUS NTAPI USBH_PdoInternalControl(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp)
NTSTATUS NTAPI USBH_PdoPnP(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp, IN UCHAR Minor, OUT BOOLEAN *IsCompleteIrp)
NTSTATUS NTAPI USBH_FdoPnP(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN UCHAR Minor)
NTSTATUS NTAPI USBH_HubSetD0(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_FdoPower(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN UCHAR Minor)
NTSTATUS NTAPI USBH_PdoPower(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp, IN UCHAR Minor)
#define InterlockedExchangePointer(Target, Value)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define RtlCompareMemory(s1, s2, l)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define InitializeListHead(ListHead)
#define KeDelayExecutionThread(mode, foo, t)
#define KeInitializeSpinLock(sl)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
_Outptr_ PUSB_DEVICE_HANDLE * NewDeviceHandle
USB_BUSIFFN_ROOTHUB_INIT_NOTIFY * PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY
USB_BUSIFFN_INITIALIZE_USB_DEVICE * PUSB_BUSIFFN_INITIALIZE_USB_DEVICE
_Inout_ PUSB_DEVICE_HANDLE OldDeviceHandle
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE HubDeviceHandle
USB_BUSIFFN_CREATE_USB_DEVICE * PUSB_BUSIFFN_CREATE_USB_DEVICE
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
USB_BUSIFFN_GET_USB_DESCRIPTORS * PUSB_BUSIFFN_GET_USB_DESCRIPTORS
_In_ GUID _In_ PVOID ValueData
USB_BUSIFFN_RESTORE_DEVICE * PUSB_BUSIFFN_RESTORE_DEVICE
USB_BUSIFFN_FLUSH_TRANSFERS * PUSB_BUSIFFN_FLUSH_TRANSFERS
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
_In_ PVOID _In_ PDEVICE_OBJECT UsbDevicePdo
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG _Out_writes_bytes_to_ ConfigDescriptorBufferLength PUCHAR _Inout_ PULONG ConfigDescriptorBufferLength
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR DeviceDescriptorBuffer
struct _USB_DEVICE_INFORMATION_0 USB_DEVICE_INFORMATION_0
USB_BUSIFFN_SET_DEVHANDLE_DATA * PUSB_BUSIFFN_SET_DEVHANDLE_DATA
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG _Out_writes_bytes_to_ ConfigDescriptorBufferLength PUCHAR ConfigDescriptorBuffer
USB_BUSIFFN_REMOVE_USB_DEVICE * PUSB_BUSIFFN_REMOVE_USB_DEVICE
USB_BUSIFFN_GET_EXTENDED_HUB_INFO * PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO
_In_ PUSB_DEVICE_HANDLE _In_ ULONG DeviceInformationBufferLength
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG DeviceDescriptorBufferLength
USB_BUSIFFN_GET_DEVICE_INFORMATION * PUSB_BUSIFFN_GET_DEVICE_INFORMATION
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define LOW_REALTIME_PRIORITY
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
#define InterlockedCompareExchange
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
IoSetCancelRoutine(Irp, CancelRoutine)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
#define IOCTL_KS_PROPERTY
#define ExFreePoolWithTag(_P, _T)
static OUT PIO_STATUS_BLOCK IoStatusBlock
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_Out_ _At_ TimerCancelled PBOOLEAN TimerCancelled
#define FILE_AUTOGENERATED_DEVICE_NAME
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
_Out_ _Inout_ POEM_STRING DestinationString
#define RTL_REGISTRY_CONTROL
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RTL_QUERY_REGISTRY_REQUIRED
#define STANDARD_RIGHTS_ALL
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER
#define IoSkipCurrentIrpStackLocation(Irp)
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
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 IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
VOID NTAPI IoInitializeIrp(IN PIRP Irp, IN USHORT PacketSize, IN CCHAR StackSize)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
BOOLEAN NTAPI IoCancelIrp(IN PIRP Irp)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireCancelSpinLock(OUT PKIRQL Irql)
ULONG NTAPI KeQueryTimeIncrement(VOID)
NTSTATUS NTAPI PoRequestPowerIrp(_In_ PDEVICE_OBJECT DeviceObject, _In_ UCHAR MinorFunction, _In_ POWER_STATE PowerState, _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction, _In_opt_ __drv_aliasesMem PVOID Context, _Outptr_opt_ PIRP *pIrp)
enum _DEVICE_POWER_STATE * PDEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
#define STATUS_DELETE_PENDING
#define STATUS_ASSERTION_FAILURE
#define STATUS_POWER_STATE_INVALID
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
#define IRP_MJ_DEVICE_CONTROL
#define SUBLANG_ENGLISH_US
VOID NTAPI KeInitializeSemaphore(IN PKSEMAPHORE Semaphore, IN LONG Count, IN LONG Limit)
LONG NTAPI KeReleaseSemaphore(IN PKSEMAPHORE Semaphore, IN KPRIORITY Increment, IN LONG Adjustment, IN BOOLEAN Wait)
#define STATUS_MORE_PROCESSING_REQUIRED
#define STATUS_BUFFER_TOO_SMALL
base of all file and directory entries
PDEVICE_OBJECT SelfDevice
union _IO_STACK_LOCATION::@1609 Parameters
struct _IO_STACK_LOCATION::@4102::@4141 Others
struct _IO_STACK_LOCATION::@1609::@1610 DeviceIoControl
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
unsigned short MaximumLength
USBD_PIPE_HANDLE PipeHandle
ULONG TransferBufferLength
ULONG TransferBufferLength
ULONG TransferBufferLength
ULONG TransferBufferLength
UCHAR RequestTypeReservedBits
USBD_PIPE_HANDLE PipeHandle
PUSBHUB_PORT_DATA PortData
POWER_STATE CurrentPowerState
KEVENT PendingRequestEvent
USB_PORT_STATUS_AND_CHANGE PortStatus
KSEMAPHORE ResetDeviceSemaphore
COMMON_DEVICE_EXTENSION Common
DEVICE_POWER_STATE DeviceWake
KSPIN_LOCK WorkItemSpinLock
PDEVICE_OBJECT LowerDevice
PUSBHUB_IO_WORK_ITEM WorkItemToQueue
KEVENT RootHubNotificationEvent
PUSB_HUB_DESCRIPTOR HubDescriptor
PDEVICE_OBJECT RootHubPdo
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST SCEWorkerUrb
DEVICE_POWER_STATE DeviceState[POWER_SYSTEM_MAXIMUM]
PUSBHUB_WORKER_ROUTINE HubWorkerRoutine
PUSBHUB_FDO_EXTENSION HubExtension
WORK_QUEUE_TYPE HubWorkItemType
LIST_ENTRY HubWorkItemLink
USB_CONNECTION_STATUS ConnectionStatus
USB_PORT_STATUS_AND_CHANGE PortStatus
PDEVICE_OBJECT DeviceObject
KSPIN_LOCK PortPowerListSpinLock
USB_DEVICE_DESCRIPTOR DeviceDescriptor
PUSB_DEVICE_HANDLE DeviceHandle
PUSBHUB_FDO_EXTENSION HubExtension
COMMON_DEVICE_EXTENSION Common
LONG PendingDevicePoRequest
USHORT SN_DescriptorLength
PUSBHUB_FDO_EXTENSION RootHubExtension
USB_CONFIGURATION_DESCRIPTOR ConfigDescriptor
KSPIN_LOCK PortTimeoutSpinLock
POWER_STATE CurrentPowerState
LONG PendingSystemPoRequest
PUSBHUB_FDO_EXTENSION HubExtension
KSPIN_LOCK UrbTimeoutSpinLock
UCHAR bPowerOnToPowerGood
static VOID ErrorExit(LPTSTR lpszMessage)
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
BOOLEAN NTAPI KeCancelTimer(IN OUT PKTIMER Timer)
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_DEVICE
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_INVALID_DEVICE_STATE
#define STATUS_DEVICE_BUSY
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
DEVICE_POWER_STATE DeviceState
USHORT PortEnableDisableChange
USHORT OverCurrentIndicatorChange
USHORT ConnectStatusChange
USHORT PortEnabledDisabled
USB_20_PORT_CHANGE Usb20PortChange
USB_PORT_STATUS PortStatus
USB_PORT_CHANGE PortChange
USB_20_PORT_STATUS Usb20PortStatus
#define USB_REQUEST_GET_STATUS
#define BMREQUEST_TO_DEVICE
#define USB_GETSTATUS_SELF_POWERED
#define USB_REQUEST_GET_DESCRIPTOR
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
#define MAXIMUM_USB_STRING_LENGTH
#define USB_CONFIG_BUS_POWERED
struct _USB_HUB_DESCRIPTOR USB_HUB_DESCRIPTOR
#define USB_DEVICE_DESCRIPTOR_TYPE
#define BMREQUEST_TO_OTHER
struct _USB_DEVICE_DESCRIPTOR USB_DEVICE_DESCRIPTOR
#define USB_REQUEST_SET_FEATURE
#define BMREQUEST_HOST_TO_DEVICE
#define USB_STRING_DESCRIPTOR_TYPE
#define BMREQUEST_STANDARD
#define USB_DEVICE_CLASS_HUB
#define USB_REQUEST_CLEAR_FEATURE
#define USB_DEVICE_CLASS_RESERVED
#define BMREQUEST_DEVICE_TO_HOST
#define USB_CONFIG_POWERED_MASK
enum _USB_DEVICE_TYPE USB_DEVICE_TYPE
#define USB_DEVICE_CLASS_MISCELLANEOUS
#define USBD_ERROR(Status)
#define USBD_TRANSFER_DIRECTION_IN
#define USBD_SHORT_TRANSFER_OK
#define URB_FUNCTION_CLASS_DEVICE
#define URB_FUNCTION_CLASS_OTHER
#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
#define USBD_SUCCESS(Status)
#define USBD_TRANSFER_DIRECTION_OUT
#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL
#define URB_FUNCTION_GET_STATUS_FROM_DEVICE
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
PUSB_INTERFACE_DESCRIPTOR NTAPI USBD_ParseConfigurationDescriptorEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PVOID StartPosition, LONG InterfaceNumber, LONG AlternateSetting, LONG InterfaceClass, LONG InterfaceSubClass, LONG InterfaceProtocol)
NTSTATUS NTAPI USBH_SyncGetStatus(IN PDEVICE_OBJECT DeviceObject, IN PUSHORT OutStatus, IN USHORT Function, IN USHORT RequestIndex)
NTSTATUS NTAPI USBH_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT LowerPDO)
NTSTATUS NTAPI USBH_HubDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PUSBHUB_FDO_EXTENSION NTAPI USBH_GetRootHubExtension(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_GetPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PULONG PortStatus)
NTSTATUS NTAPI USBH_SubmitStatusChangeTransfer(IN PUSBHUB_FDO_EXTENSION HubExtension)
VOID NTAPI USBH_PdoSetCapabilities(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension)
NTSTATUS NTAPI USBH_FdoSubmitIdleRequestIrp(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_WriteFailReasonID(IN PDEVICE_OBJECT DeviceObject, IN ULONG FailReason)
VOID NTAPI USBH_CheckHubIdle(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_EnableParentPort(IN PUSBHUB_FDO_EXTENSION HubExtension)
PWSTR GenericUSBDeviceString
VOID NTAPI USBHUB_SetDeviceHandleData(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PDEVICE_OBJECT UsbDevicePdo, IN PVOID DeviceHandle)
NTSTATUS NTAPI USBH_FdoIdleNotificationRequestComplete(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS NTAPI USBH_SyncGetHubDescriptor(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBD_RemoveDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, IN ULONG Flags)
VOID NTAPI USBH_CompleteIrp(IN PIRP Irp, IN NTSTATUS CompleteStatus)
VOID NTAPI USBH_ChangeIndicationWorker(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
VOID NTAPI USBH_Worker(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
NTSTATUS NTAPI USBH_ProcessDeviceInformation(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension)
NTSTATUS NTAPI USBD_UnRegisterRootHubCallBack(IN PUSBHUB_FDO_EXTENSION HubExtension)
VOID NTAPI USBH_FlushPortPwrList(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_ChangeIndicationProcessChange(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS NTAPI USBH_CheckDeviceLanguage(IN PDEVICE_OBJECT DeviceObject, IN USHORT LanguageId)
NTSTATUS NTAPI USBH_GetDeviceDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PUSB_DEVICE_DESCRIPTOR HubDeviceDescriptor)
VOID NTAPI USBH_CheckIdleWorker(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
VOID NTAPI USBH_IdleCompletePowerHubWorker(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
NTSTATUS NTAPI USBH_ChangeIndication(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS NTAPI USBH_SyncGetRootHubPdo(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_OBJECT *OutPdo1, IN OUT PDEVICE_OBJECT *OutPdo2)
NTSTATUS NTAPI USBH_SyncGetDeviceConfigurationDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, IN ULONG NumberOfBytes, IN PULONG OutLength)
NTSTATUS NTAPI USBH_Wait(IN ULONG Milliseconds)
NTSTATUS NTAPI USBHUB_GetExtendedHubInfo(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_EXTHUB_INFORMATION_0 HubInfoBuffer)
VOID NTAPI USBHUB_RootHubCallBack(IN PVOID Context)
VOID NTAPI USBH_CheckIdleDeferred(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_AllocateWorkItem(PUSBHUB_FDO_EXTENSION HubExtension, PUSBHUB_IO_WORK_ITEM *OutHubIoWorkItem, PUSBHUB_WORKER_ROUTINE WorkerRoutine, SIZE_T BufferLength, PVOID *OutHubWorkItemBuffer, WORK_QUEUE_TYPE Type)
VOID NTAPI USBH_FreeWorkItem(IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem)
NTSTATUS NTAPI USBH_FdoDispatch(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp)
NTSTATUS NTAPI USBH_SyncSubmitUrb(IN PDEVICE_OBJECT DeviceObject, IN PURB Urb)
NTSTATUS NTAPI USBH_SyncPowerOnPort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN BOOLEAN IsWait)
VOID NTAPI USBH_HubCompletePortIdleIrps(IN PUSBHUB_FDO_EXTENSION HubExtension, IN NTSTATUS NtStatus)
VOID NTAPI USBH_FdoIdleNotificationCallback(IN PVOID Context)
NTSTATUS NTAPI USBH_SyncGetStringDescriptor(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Index, IN USHORT LanguageId, IN PUSB_STRING_DESCRIPTOR Descriptor, IN ULONG NumberOfBytes, IN PULONG OutLength, IN BOOLEAN IsValidateLength)
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
VOID NTAPI USBH_CompletePortIdleIrpsWorker(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
VOID NTAPI USBH_QueueWorkItem(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem)
NTSTATUS NTAPI USBH_Transact(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID TransferBuffer, IN ULONG BufferLen, IN BOOLEAN IsDeviceToHost, IN USHORT Function, IN BM_REQUEST_TYPE RequestType, IN UCHAR Request, IN USHORT RequestValue, IN USHORT RequestIndex)
NTSTATUS NTAPI USBD_InitializeDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, IN PUCHAR DeviceDescriptorBuffer, IN ULONG DeviceDescriptorBufferLength, IN PUCHAR ConfigDescriptorBuffer, IN ULONG ConfigDescriptorBufferLength)
BOOLEAN NTAPI USBH_ValidateSerialNumberString(IN PUSHORT SerialNumberString)
NTSTATUS NTAPI USBH_SyncIrpComplete(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
VOID NTAPI USBH_HubCancelIdleIrp(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP IdleIrp)
VOID NTAPI USBH_HubCompleteQueuedPortIdleIrps(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PLIST_ENTRY IdleList, IN NTSTATUS NtStatus)
VOID NTAPI USBH_HubSetDWakeCompletion(IN PDEVICE_OBJECT DeviceObject, IN UCHAR MinorFunction, IN POWER_STATE PowerState, IN PVOID Context, IN PIO_STATUS_BLOCK IoStatus)
NTSTATUS NTAPI USBH_SyncGetPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus, IN ULONG Length)
PUSB_DEVICE_HANDLE NTAPI USBH_SyncGetDeviceHandle(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI USBH_ChangeIndicationAckChangeComplete(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
VOID NTAPI USBHUB_FlushAllTransfers(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_SyncGetHubStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus, IN ULONG Length)
NTSTATUS NTAPI USBH_GetConfigurationDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PUSB_CONFIGURATION_DESCRIPTOR *OutDescriptor)
VOID NTAPI USBH_ProcessHubStateChange(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus)
NTSTATUS NTAPI USBD_RegisterRootHubCallBack(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_CreateDevice(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN USB_PORT_STATUS UsbPortStatus, IN ULONG IsWait)
NTSTATUS NTAPI USBH_SyncClearHubStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT RequestValue)
NTSTATUS NTAPI USBH_SyncDisablePort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port)
VOID NTAPI USBH_ProcessPortStateChange(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus)
NTSTATUS NTAPI USBD_CreateDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE *OutDeviceHandle, IN USB_PORT_STATUS UsbPortStatus, IN USHORT Port)
NTSTATUS NTAPI USBH_ResetDevice(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN BOOLEAN IsKeepDeviceData, IN BOOLEAN IsWait)
NTSTATUS NTAPI USBD_RestoreDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN OUT PUSB_DEVICE_HANDLE OldDeviceHandle, IN OUT PUSB_DEVICE_HANDLE NewDeviceHandle)
NTSTATUS NTAPI USBH_ChangeIndicationAckChange(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *Urb, IN USHORT Port, IN USHORT RequestValue)
NTSTATUS NTAPI USBH_GetDeviceType(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, OUT USB_DEVICE_TYPE *OutDeviceType)
NTSTATUS NTAPI USBH_SyncResetPort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port)
NTSTATUS NTAPI USBH_SyncGetHubCount(IN PDEVICE_OBJECT DeviceObject, IN OUT PULONG OutHubCount)
NTSTATUS NTAPI USBH_FdoSubmitWaitWakeIrp(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_SetPdoRegistryParameter(IN PDEVICE_OBJECT DeviceObject, IN PCWSTR ValueName, IN PVOID Data, IN ULONG DataSize, IN ULONG Type, IN ULONG DevInstKeyType)
NTSTATUS NTAPI USBH_PdoDispatch(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp)
NTSTATUS NTAPI USBH_ChangeIndicationQueryChange(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *Urb, IN USHORT Port)
NTSTATUS NTAPI USBH_ResetHub(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBH_FdoSyncSubmitUrb(IN PDEVICE_OBJECT FdoDevice, IN PURB Urb)
VOID NTAPI USBH_HubQueuePortIdleIrps(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PLIST_ENTRY IdleList)
BOOLEAN NTAPI USBH_CheckDeviceIDUnique(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT idVendor, IN USHORT idProduct, IN PVOID SerialNumber, IN USHORT SN_DescriptorLength)
VOID NTAPI USBH_UrbTimeoutDPC(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
NTSTATUS NTAPI USBH_RegQueryGenericUSBDeviceString(PVOID USBDeviceString)
NTSTATUS NTAPI USBH_ResetInterruptPipe(IN PUSBHUB_FDO_EXTENSION HubExtension)
NTSTATUS NTAPI USBD_GetDeviceInformationEx(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_NODE_CONNECTION_INFORMATION_EX Info, IN ULONG Length, IN PUSB_DEVICE_HANDLE DeviceHandle)
NTSTATUS NTAPI USBH_SyncPowerOnPorts(IN PUSBHUB_FDO_EXTENSION HubExtension)
VOID NTAPI USBH_DriverUnload(IN PDRIVER_OBJECT DriverObject)
NTSTATUS NTAPI USBH_GetConfigValue(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
NTSTATUS NTAPI USBH_GetSerialNumberString(IN PDEVICE_OBJECT DeviceObject, IN LPWSTR *OutSerialNumber, IN PUSHORT OutDescriptorLength, IN USHORT LanguageId, IN UCHAR Index)
BOOLEAN NTAPI USBH_CheckIdleAbort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN BOOLEAN IsWait, IN BOOLEAN IsExtCheck)
NTSTATUS NTAPI USBH_PassIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI USBH_FdoWaitWakeIrpCompletion(IN PDEVICE_OBJECT DeviceObject, IN UCHAR MinorFunction, IN POWER_STATE PowerState, IN PVOID Context, IN PIO_STATUS_BLOCK IoStatus)
BOOLEAN NTAPI USBH_HubIsBusPowered(IN PDEVICE_OBJECT DeviceObject, IN PUSB_CONFIGURATION_DESCRIPTOR HubConfigDescriptor)
NTSTATUS NTAPI USBH_SyncClearPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN USHORT RequestValue)
BOOLEAN NTAPI IsBitSet(IN PUCHAR BitMapAddress, IN USHORT Bit)
#define USBHUB_FEATURE_C_PORT_ENABLE
#define USBHUB_FDO_FLAG_DEVICE_STARTED
#define USBHUB_FDO_FLAG_DEVICE_STOPPING
#define USBHUB_PDO_FLAG_OVERCURRENT_PORT
#define USBHUB_FDO_FLAG_DEVICE_SUSPENDED
#define USBHUB_MAX_REQUEST_ERRORS
#define USBHUB_FDO_FLAG_USB20_HUB
#define USBHUB_FDO_FLAG_WITEM_INIT
#define USBHUB_RESET_PORT_MAX_RETRY
#define USBHUB_FDO_FLAG_STATE_CHANGING
#define USBHUB_PDO_FLAG_REMOVING_PORT_PDO
#define USBHUB_FDO_FLAG_CHECK_IDLE_LOCK
#define USBHUB_FDO_FLAG_ESD_RECOVERING
#define USBHUB_PDO_FLAG_PORT_HIGH_SPEED
#define USBHUB_FEATURE_PORT_RESET
#define USBHUB_FDO_FLAG_DO_SUSPENSE
#define USBHUB_PDO_FLAG_PORT_LOW_SPEED
#define USBHUB_PDO_FLAG_REMOTE_WAKEUP
#define USBH_EXTENSION_TYPE_HUB
#define USBHUB_FDO_FLAG_ENUM_POST_RECOVER
#define USBHUB_FDO_FLAG_RESET_PORT_LOCK
struct _USBHUB_STATUS_CHANGE_CONTEXT USBHUB_STATUS_CHANGE_CONTEXT
#define USBHUB_PDO_FLAG_HUB_DEVICE
#define USBHUB_FEATURE_PORT_POWER
#define USBHUB_FEATURE_C_HUB_LOCAL_POWER
#define USBH_EXTENSION_TYPE_PARENT
#define USBHUB_PDO_FLAG_POWER_D1_OR_D2
#define USBH_EXTENSION_TYPE_PORT
#define USBHUB_FEATURE_C_PORT_CONNECTION
#define USBHUB_FDO_FLAG_GOING_IDLE
#define USBHUB_FDO_FLAG_DEVICE_REMOVED
#define USBHUB_FDO_FLAG_DO_ENUMERATION
#define USBHUB_FDO_FLAG_DEVICE_FAILED
#define USBHUB_PDO_FLAG_MULTI_INTERFACE
#define USBHUB_FDO_FLAG_WAKEUP_START
#define USBHUB_FDO_FLAG_NOT_D0_STATE
#define USBHUB_FDO_FLAG_PENDING_WAKE_IRP
#define USBHUB_FEATURE_C_PORT_RESET
#define USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST
#define USBHUB_PDO_FLAG_POWER_D3
#define USBHUB_FEATURE_C_HUB_OVER_CURRENT
#define USBHUB_FDO_FLAG_DEFER_CHECK_IDLE
VOID(NTAPI * PUSBHUB_WORKER_ROUTINE)(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
#define USBHUB_FDO_FLAG_DEVICE_STOPPED
#define USBHUB_PDO_FLAG_INIT_PORT_FAILED
#define USBHUB_FDO_FLAG_NOT_ENUMERATED
#define USBHUB_FEATURE_PORT_ENABLE
#define IOCTL_INTERNAL_USB_SUBMIT_URB
#define IOCTL_INTERNAL_USB_GET_HUB_COUNT
#define IOCTL_INTERNAL_USB_ENABLE_PORT
#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO
#define USBD_PORT_ENABLED
#define USBD_PORT_CONNECTED
#define IOCTL_INTERNAL_USB_GET_PORT_STATUS
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ UCHAR _In_ UCHAR MinorFunction
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_In_ WDFTIMER _In_ LONGLONG DueTime
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IoSizeOfIrp(_StackSize)
_In_ ULONG DevInstKeyType
#define PLUGPLAY_REGKEY_DEVICE
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
_In_ SYSTEM_POWER_STATE SystemPowerState
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID DeferredContext
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2