ReactOS 0.4.17-dev-1281-g065abb3
rhubpdo.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS USB Host Controller Extension
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Root hub PDO: creation, PnP and power, and routing of the hub's IOCTLs
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#include "ucx01000.h"
9
10#define NDEBUG
11#include <debug.h>
12
13/* SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R: SYSTEM all, Administrators read/write/execute,
14 * Everyone read/write, restricted code read only */
16 L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGW;;;WD)(A;;GR;;;RC)");
17
18static IO_COMPLETION_ROUTINE UcxDeviceMgmtCompletion;
19static IO_COMPLETION_ROUTINE UcxRootHubGetInfoCompletion;
20
21#define UCX_ROOT_HUB_ID L"USB\\ROOT_HUB30"
22
23/* Carries its NUL inside Length */
25
26/* Character counts of the three IDs when every field prints four wide */
27#define UCX_HWID_FULL_CHARS RTL_NUMBER_OF(UCX_ROOT_HUB_ID L"&VID0000&PID0000&REV0000")
28#define UCX_HWID_SHORT_CHARS RTL_NUMBER_OF(UCX_ROOT_HUB_ID L"&VID0000&PID0000")
29#define UCX_HWID_PLAIN_CHARS RTL_NUMBER_OF(UCX_ROOT_HUB_ID)
30#define UCX_HWID_BUFFER_CHARS ((UCX_HWID_FULL_CHARS + UCX_HWID_SHORT_CHARS + UCX_HWID_PLAIN_CHARS + 1) * sizeof(WCHAR))
31
32/* '#' marks each separator and becomes NUL at the offsets a four wide field gives */
34{
38};
39
41static
42VOID
46 _Out_writes_(BufferChars) PWCHAR Buffer,
47 _In_ SIZE_T BufferChars,
49{
50 const UCX_CONTROLLER_PCI_INFORMATION* Pci = &Config->PciDeviceInfo;
51 const UCX_CONTROLLER_ACPI_INFORMATION* Acpi = &Config->AcpiDeviceInfo;
53
54 if (Config->ParentBusType != UcxControllerParentBusTypePci &&
55 Config->ParentBusType != UcxControllerParentBusTypeAcpi)
56 {
58 Ids->Length = sizeof(UcxRootHubDeviceIdText) - sizeof(WCHAR);
59 Ids->MaximumLength = sizeof(UcxRootHubDeviceIdText);
60 return;
61 }
62
63 RtlInitEmptyUnicodeString(Ids, Buffer, (USHORT)(BufferChars * sizeof(WCHAR)));
64
65 /* A truncated result is used as is */
66 if (Config->ParentBusType == UcxControllerParentBusTypePci)
67 {
69 UCX_ROOT_HUB_ID L"&VID%04X&PID%04X&REV%04X#" UCX_ROOT_HUB_ID L"&VID%04X&PID%04X#" UCX_ROOT_HUB_ID L"#",
70 Pci->VendorId, Pci->DeviceId, Pci->RevisionId,
71 Pci->VendorId, Pci->DeviceId);
72 }
73 else
74 {
76 UCX_ROOT_HUB_ID L"&VID%S&PID%S&REV%S#" UCX_ROOT_HUB_ID L"&VID%S&PID%S#" UCX_ROOT_HUB_ID L"#",
77 Acpi->VendorId, Acpi->DeviceId, Acpi->RevisionId,
78 Acpi->VendorId, Acpi->DeviceId);
79 }
80
83}
84
86VOID
88{
90 SYSTEM_POWER_STATE FirstWake;
92
101
102 FirstWake = (Hc->SystemWake == PowerSystemUnspecified) ? PowerSystemWorking : Hc->SystemWake;
103 m_PowerCaps.SystemWake = FirstWake;
104
106 {
107 if (State <= (ULONG)Hc->SystemWake && Hc->DeviceState[State] != PowerDeviceUnspecified)
108 {
110 if (FirstWake == PowerSystemShutdown)
112 }
113 else
114 {
116 }
117 }
118
119 /* Hybrid sleep: waking from S3 means waking from S4 too */
122 {
125 }
126}
127
130{
131 static const UNICODE_STRING InstanceId = RTL_CONSTANT_STRING(L"0\0");
132 static const UNICODE_STRING DeviceId = RTL_CONSTANT_STRING(UCX_ROOT_HUB_ID L"\0");
133 static UCHAR PnpMinor = IRP_MN_QUERY_INTERFACE;
134 static UCHAR PowerMinor = IRP_MN_SET_POWER;
136 WDF_PDO_EVENT_CALLBACKS PdoCallbacks;
138 WDF_IO_QUEUE_CONFIG QueueConfig;
139 PNP_BUS_INFORMATION BusInfo;
141 WCHAR NameBuffer[64];
142 UNICODE_STRING HardwareIds;
145 UcxRootHubPdoContext* PdoContext;
146 WDFDEVICE Pdo = NULL;
147 WDFDEVICE Fdo = m_Controller->m_Fdo;
148 ULONG Index;
150
151 BusInfo.BusTypeGuid = GUID_BUS_TYPE_USB;
152 BusInfo.LegacyBusType = PNPBus;
153 BusInfo.BusNumber = 0;
154 WdfDeviceSetBusInformationForChildren(Fdo, &BusInfo);
155
156 Init = WdfPdoInitAllocate(Fdo);
157 if (Init == NULL)
158 {
159 DPRINT1("Root hub PDO init allocation failed\n");
161 }
162
163 Status = WdfPdoInitAssignInstanceID(Init, &InstanceId);
164 if (NT_SUCCESS(Status))
165 Status = WdfPdoInitAssignDeviceID(Init, &DeviceId);
166 if (NT_SUCCESS(Status))
167 {
168 UcxBuildRootHubHardwareIds(&m_Controller->m_Config, IdBuffer, ARRAYSIZE(IdBuffer), &HardwareIds);
169 Status = WdfPdoInitAddHardwareID(Init, &HardwareIds);
170 }
171
172 if (NT_SUCCESS(Status))
173 {
174 /* The root hub's queues live on the controller FDO */
176
177 Status = WdfDeviceInitAssignWdmIrpPreprocessCallback(Init,
180 NULL,
181 0);
182 }
183 if (NT_SUCCESS(Status))
184 {
185 Status = WdfDeviceInitAssignWdmIrpPreprocessCallback(Init,
188 &PnpMinor,
189 1);
190 }
191 if (NT_SUCCESS(Status))
192 {
193 Status = WdfDeviceInitAssignWdmIrpPreprocessCallback(Init,
196 &PowerMinor,
197 1);
198 }
199
200 if (!NT_SUCCESS(Status))
201 {
202 DPRINT1("Root hub PDO ID or preprocess setup failed 0x%lx\n", Status);
203 WdfDeviceInitFree(Init);
204 return Status;
205 }
206
207 /* Every request reaching the HCD then carries the HCD's request context */
208 WdfDeviceInitSetRequestAttributes(Init, &m_Config.WdfRequestAttributes);
209
215 WdfDeviceInitSetPnpPowerEventCallbacks(Init, &PnpPower);
216
217 WDF_PDO_EVENT_CALLBACKS_INIT(&PdoCallbacks);
220 WdfPdoInitSetEventCallbacks(Init, &PdoCallbacks);
221
223
224 /* USBPDO-n is shared with the PDOs the hub creates; take the first free one */
225 for (Index = 0;; Index++)
226 {
227 Status = RtlStringCchPrintfW(NameBuffer, ARRAYSIZE(NameBuffer), L"\\Device\\USBPDO-%d", Index);
228 if (!NT_SUCCESS(Status))
229 break;
230
231 RtlInitUnicodeString(&Name, NameBuffer);
232 Status = WdfDeviceInitAssignName(Init, &Name);
233 if (!NT_SUCCESS(Status))
234 break;
235
236 Status = WdfDeviceInitAssignSDDLString(Init, &UcxRootHubPdoSddl);
237 if (!NT_SUCCESS(Status))
238 break;
239
240 Status = WdfDeviceCreate(&Init, &Attributes, &Pdo);
242 break;
243 }
244
245 if (!NT_SUCCESS(Status))
246 {
247 DPRINT1("Root hub PDO create failed at USBPDO-%lu 0x%lx\n", Index, Status);
248 if (Init != NULL)
249 WdfDeviceInitFree(Init);
250 return Status;
251 }
252
253 DPRINT("Root hub PDO %p is %wZ\n", Pdo, &Name);
254
255 /* User mode IOCTLs on the root hub PDO are not served */
258 Status = WdfIoQueueCreate(Pdo, &QueueConfig, WDF_NO_OBJECT_ATTRIBUTES, WDF_NO_HANDLE);
259 if (!NT_SUCCESS(Status))
260 {
261 DPRINT1("Root hub PDO %p queue create failed 0x%lx\n", Pdo, Status);
263 return Status;
264 }
265
270
273 m_PnpCaps.Address = 0;
275 WdfDeviceSetPnpCapabilities(Pdo, &m_PnpCaps);
276
278 WdfDeviceSetPowerCapabilities(Pdo, &m_PowerCaps);
279
280 PdoContext = UcxGetRootHubPdoContext(Pdo);
281 PdoContext->RootHub = this;
282 PdoContext->Controller = m_Controller;
284
285 Status = WdfDeviceCreateDeviceInterface(Pdo, &GUID_DEVINTERFACE_USB_HUB, NULL);
286 if (!NT_SUCCESS(Status))
287 {
288 DPRINT1("Root hub PDO %p hub interface create failed 0x%lx\n", Pdo, Status);
290 return Status;
291 }
292
293 {
295
296 m_Pdo = Pdo;
297 }
298
299 Status = WdfFdoAddStaticChild(Fdo, Pdo);
300 if (!NT_SUCCESS(Status))
301 {
302 DPRINT1("Root hub PDO %p static child add failed 0x%lx\n", Pdo, Status);
303 m_Pdo = NULL;
305 return Status;
306 }
307
308 /* From here the PDO belongs to the FDO and is not deleted on failure */
309 return AddQueryInterfaces();
310}
311
312/* PCI device properties the hub reads from the root hub PDO to map root ports to USB4 hosts */
314 { { 0x3ab22e31, 0x8264, 0x4b4e, { 0x9a, 0xf5, 0xa8, 0xd2, 0xd8, 0xe3, 0x3e, 0x62 } }, 40 };
316 { { 0x3ab22e31, 0x8264, 0x4b4e, { 0x9a, 0xf5, 0xa8, 0xd2, 0xd8, 0xe3, 0x3e, 0x62 } }, 42 };
318 { { 0x3ab22e31, 0x8264, 0x4b4e, { 0x9a, 0xf5, 0xa8, 0xd2, 0xd8, 0xe3, 0x3e, 0x62 } }, 45 };
319
322static
323VOID
324NTAPI
325UcxRootHubCopyPciProperties(
326 _In_ WDFDEVICE Controller,
327 _In_ WDFDEVICE Pdo)
328{
330 WDFMEMORY Attributes = NULL;
332 size_t AttributesSize = 0;
339
341 Status = WdfDeviceQueryPropertyEx(Controller, &Property, sizeof(Serial), &Serial, &Required, &SerialType);
343 {
345 Status = WdfDeviceQueryPropertyEx(Controller, &Property, sizeof(Serial), &Serial, &Required, &SerialType);
346 }
347
349 if (Found)
350 {
352 Status = WdfDeviceAllocAndQueryPropertyEx(Controller,
353 &Property,
354 PagedPool,
356 &Attributes,
358 if (NT_SUCCESS(Status))
359 {
360 AttributesData = WdfMemoryGetBuffer(Attributes, &AttributesSize);
361 }
362 else
363 {
364 /* QUIRK: the serial number is dropped as well */
365 DPRINT1("Controller %p USB4 port attributes query failed 0x%lx\n", Controller, Status);
367 Found = FALSE;
368 }
369 }
370
372 Status = WdfDeviceAssignProperty(Pdo, &Property, AttributesType, (ULONG)AttributesSize, AttributesData);
373 if (!NT_SUCCESS(Status))
374 {
375 DPRINT1("Root hub PDO %p USB4 port attributes assign failed 0x%lx\n", Pdo, Status);
376 }
377 else
378 {
379 /* QUIRK: a parent serial number is published under the serial number key */
381 Status = WdfDeviceAssignProperty(Pdo,
382 &Property,
384 Found ? sizeof(Serial) : 0,
385 Found ? &Serial : NULL);
386 if (!NT_SUCCESS(Status))
387 DPRINT1("Root hub PDO %p serial number assign failed 0x%lx\n", Pdo, Status);
388 }
389
390 if (Attributes != NULL)
392}
393
394/* PnP and power */
395
397NTAPI
399 _In_ WDFDEVICE Device,
400 _In_ WDFCMRESLIST ResourcesRaw,
401 _In_ WDFCMRESLIST ResourcesTranslated)
402{
403 UcxRootHubPdoContext* Context = UcxGetRootHubPdoContext(Device);
404 UcxRootHub* RootHub = Context->RootHub;
406 WDFSTRING Name;
408
411
413 Attributes.ParentObject = Device;
414
415 Status = WdfStringCreate(NULL, &Attributes, &Name);
416 if (!NT_SUCCESS(Status))
417 {
418 DPRINT1("Root hub PDO %p interface string create failed 0x%lx\n", Device, Status);
419 return Status;
420 }
421
422 Status = WdfDeviceRetrieveDeviceInterfaceString(Device, &GUID_DEVINTERFACE_USB_HUB, NULL, Name);
423 if (!NT_SUCCESS(Status))
424 {
425 DPRINT1("Root hub PDO %p hub interface name query failed 0x%lx\n", Device, Status);
427 return Status;
428 }
429
430 /* Controller errata are known by now */
431 Context->Controller->m_ClearTtBufferOnAsyncCancel = Context->Controller->QueryClearTtBufferOnCancel();
432
433 {
434 SpinLockGuard Guard(&RootHub->m_PdoInfoLock);
435
436 RootHub->m_PdoStarted = TRUE;
437 RootHub->m_SymbolicName = Name;
438 }
439
440 UcxRootHubCopyPciProperties(Context->Controller->m_Fdo, Device);
441
442 /* Unknown until the first S IRP, as USBPORT reports it */
443 RootHub->m_LastSystemSleepState = PowerSystemUnspecified;
444 DPRINT("Root hub PDO %p prepared\n", Device);
445 return STATUS_SUCCESS;
446}
447
449NTAPI
451 _In_ WDFDEVICE Device,
452 _In_ WDFCMRESLIST ResourcesTranslated)
453{
454 UcxRootHub* RootHub = UcxGetRootHubPdoContext(Device)->RootHub;
455 WDFSTRING Name;
456
458
459 {
460 SpinLockGuard Guard(&RootHub->m_PdoInfoLock);
461
462 RootHub->m_PdoStarted = FALSE;
463 Name = RootHub->m_SymbolicName;
464 RootHub->m_SymbolicName = NULL;
465 }
466
467 if (Name != NULL)
469
470 DPRINT("Root hub PDO %p released\n", Device);
471 return STATUS_SUCCESS;
472}
473
475NTAPI
477 _In_ WDFDEVICE Device,
479{
480 UcxRootHubPdoContext* Context = UcxGetRootHubPdoContext(Device);
481 UcxInterruptQueueState* State = Context->RootHub->m_InterruptState;
482
484
485 DPRINT("Root hub PDO %p D0 entry, previous WDF state %d\n", Device, PreviousState);
486
487 {
488 SpinLockGuard Guard(&State->PortChangeLock);
489
490 State->IndicateWakeEnabled = FALSE;
491 }
492
493 /* A port change may still be inside WdfDeviceIndicateWakeStatus */
494 KeWaitForSingleObject(&State->NoIndicateWakeInProgress, Executive, KernelMode, FALSE, NULL);
495
496 Context->Controller->PostResetEvent(CrEvent::RootHubPoweredUp);
497 Context->Controller->m_RootHubInD0 = TRUE;
498
499 return STATUS_SUCCESS;
500}
501
503NTAPI
505 _In_ WDFDEVICE Device,
507{
508 UcxRootHubPdoContext* Context = UcxGetRootHubPdoContext(Device);
509 UcxController* Controller = Context->Controller;
510 UcxRootHub* RootHub = Context->RootHub;
511 UcxInterruptQueueState* State = RootHub->m_InterruptState;
512 BOOLEAN WakeNow = FALSE;
513
515
516 DPRINT("Root hub PDO %p D0 exit, target WDF state %d\n", Device, TargetState);
517
518 /* Waits out any reset recovery that still needs the root hub */
521 Controller->m_RootHubInD0 = FALSE;
522
523 {
524 SpinLockGuard Guard(&State->PortChangeLock);
525
526 /* The hub may have dropped its last transfer; make the next one reach the HCD */
527 if (!State->LastTransferCanceled)
528 State->PortChangeGeneration++;
529
530 /* S0 idle: changes from now on must wake the root hub */
531 if (RootHub->m_SystemPowerAction == PowerActionNone)
532 {
533 State->IndicateWakeEnabled = TRUE;
534 WakeNow = (State->PortChangeGeneration != State->PortChangeGenerationProcessed);
535 }
536 }
537
538 if (WakeNow)
539 WdfDeviceIndicateWakeStatus(Device, STATUS_SUCCESS);
540
541 return STATUS_SUCCESS;
542}
543
545NTAPI
547 _In_ WDFDEVICE Device,
549{
551
552 if (UcxGetRootHubPdoContext(Device)->Controller->IsResetInProgress())
553 {
554 DPRINT1("Root hub PDO %p wake arm failed, controller reset in progress\n", Device);
556 }
557
558 DPRINT("Root hub PDO %p wake armed\n", Device);
559 return STATUS_SUCCESS;
560}
561
562VOID
563NTAPI
565 _In_ WDFDEVICE Device)
566{
568}
569
570VOID
571NTAPI
573 _In_ WDFQUEUE Queue,
574 _In_ WDFREQUEST Request,
576 _In_ size_t InputBufferLength,
578{
582 DPRINT1("Root hub PDO user IOCTL 0x%lx not supported\n", IoControlCode);
583 WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
584}
585
586/* Internal IOCTL routing */
587
589{
590 Skip,
593};
594
596static
597WDFQUEUE
598NTAPI
603{
605
606 switch (IoControlCode)
607 {
613 return Controller->m_DeviceMgmtQueue;
614
623 return Controller->m_DeviceMgmtQueue;
624
626 return Controller->m_TreePurgeQueue;
627
629 return Controller->m_Address0Queue;
630
631 /* The port info IOCTLs get the completion routine only so HCD failures print */
636 return Controller->m_DefaultQueue;
637
646 return Controller->m_DefaultQueue;
647
648 default:
649 return NULL;
650 }
651}
652
653static
655NTAPI
657 _In_ PIRP Irp,
659{
660 Irp->IoStatus.Status = Status;
661 Irp->IoStatus.Information = 0;
663 return Status;
664}
665
667static
668VOID
669NTAPI
671 _In_ WDFDEVICE Device,
672 _In_ PIRP Irp,
675{
677
678 Status = IoSetCompletionRoutineEx(WdfDeviceWdmGetDeviceObject(Device),
679 Irp,
680 Routine,
681 Context,
682 TRUE,
683 TRUE,
684 TRUE);
685 if (!NT_SUCCESS(Status))
687}
688
689static
691NTAPI
694 _In_ PIRP Irp)
695{
696 if (Controller->m_Config.EvtControllerReset == NULL)
697 {
698 DPRINT1("Controller %p has no reset callback, failing async port reset\n", Controller);
700 }
701
702 if (Controller->HasFailed())
703 {
704 DPRINT1("Controller %p has failed, refusing async port reset\n", Controller);
706 }
707
708 DPRINT("Controller %p async port reset requested by hub\n", Controller);
709
711
712 NT_ASSERT(Controller->m_RootHub->m_PendingAsyncReset == NULL);
713 Controller->m_RootHub->m_PendingAsyncReset = Irp;
714
715 Controller->PostResetEvent(CrEvent::HubRequestsReset);
716 return STATUS_PENDING;
717}
718
720NTAPI
722 _In_ WDFDEVICE Device,
724{
725 UcxController* Controller = UcxGetRootHubPdoContext(Device)->Controller;
728 WDFQUEUE Queue;
729
732
735
737 if (Queue == NULL)
738 {
739 DPRINT1("Root hub PDO internal IOCTL 0x%lx not supported, IRP %p\n", Code, Irp);
741 }
742
743 switch (Setup)
744 {
748 break;
749
753 break;
754
755 default:
757 break;
758 }
759
760 return WdfDeviceWdmDispatchIrpToIoQueue(Device, Irp, Queue, WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP);
761}
762
763/* KMDF cannot version one interface GUID by size, so the requested size and version go along */
765NTAPI
767 _In_ WDFDEVICE Device,
769{
771 const GUID* Type = Stack->Parameters.QueryInterface.InterfaceType;
772
773 if (IsEqualGUID(*Type, USB_BUS_INTERFACE_USBDI_GUID) ||
774 IsEqualGUID(*Type, GUID_UCXHUB_PARENT_INTERFACE) ||
775 IsEqualGUID(*Type, GUID_UCXHUB_STACK_INTERFACE))
776 {
777 Stack->Parameters.QueryInterface.Interface->Size = Stack->Parameters.QueryInterface.Size;
778 Stack->Parameters.QueryInterface.Interface->Version = Stack->Parameters.QueryInterface.Version;
779 }
780
783}
784
785/* Track the S IRPs since the D IRP reports a stale power action */
787NTAPI
789 _In_ WDFDEVICE Device,
791{
793 UcxRootHub* RootHub = UcxGetRootHubPdoContext(Device)->RootHub;
795
796 if (Stack->Parameters.Power.Type == SystemPowerState)
797 {
798 Target = (SYSTEM_POWER_STATE)Stack->Parameters.Power.SystemPowerStateContext.TargetSystemState;
799
801 {
802 RootHub->m_LastSystemSleepState = Target;
803 RootHub->m_SystemPowerAction = Stack->Parameters.Power.ShutdownType;
804 }
805 else
806 {
807 RootHub->m_SystemPowerAction = PowerActionNone;
808 }
809 }
810
813}
814
815/* Completion routines */
816
817static
819NTAPI
822 _In_ PIRP Irp,
823 _In_reads_opt_(_Inexpressible_("varies")) PVOID Context)
824{
826 PVOID Payload = Stack->Parameters.Others.Argument1;
828
831
832 if (Irp->PendingReturned)
834
835 switch (Stack->Parameters.DeviceIoControl.IoControlCode)
836 {
838 Device = UcxUsbDevice::FromHandle(((PENDPOINTS_CONFIGURE)Payload)->Header.UsbDevice);
839 return Device->OnHcdEndpointsConfigureDone(Irp, (PENDPOINTS_CONFIGURE)Payload);
840
842 Device = UcxUsbDevice::FromHandle(((PUSBDEVICE_ENABLE)Payload)->Header.UsbDevice);
843 return Device->OnHcdEnableDone(Irp, (PUSBDEVICE_ENABLE)Payload);
844
846 Device = UcxUsbDevice::FromHandle(((PUSBDEVICE_RESET)Payload)->Header.UsbDevice);
847 if (Device->m_ResetFailedByControllerReset)
848 {
849 Device->m_ResetFailedByControllerReset = FALSE;
851 }
852 return Device->OnHcdResetDone(Irp, (PUSBDEVICE_RESET)Payload);
853
855 Device = UcxUsbDevice::FromHandle(((PENDPOINT_RESET)Payload)->Header.UsbDevice);
856 if (Device->m_EndpointResetFailedByControllerReset)
857 {
858 Device->m_EndpointResetFailedByControllerReset = FALSE;
860 }
861 return UcxEndpoint::FromHandle(((PENDPOINT_RESET)Payload)->Endpoint)->OnHcdResetDone(Irp);
862
863 default:
865 }
866}
867
868/* Gives the hub its full structure size back and remembers the port counts */
869static
871NTAPI
874 _In_ PIRP Irp,
875 _In_reads_opt_(_Inexpressible_("varies")) PVOID Context)
876{
878 ULONG Code = Stack->Parameters.DeviceIoControl.IoControlCode;
881
883
884 if (Irp->PendingReturned)
886
887 if (!NT_SUCCESS(Irp->IoStatus.Status))
888 {
889 DPRINT1("Root hub PDO %p IOCTL 0x%lx failed by HCD 0x%lx\n",
890 Context, Code, Irp->IoStatus.Status);
892 }
893
896
897 Info = (PUCXHUB_ROOTHUB_INFO)Stack->Parameters.Others.Argument1;
898 RootHub = UcxGetRootHubPdoContext((WDFDEVICE)Context)->RootHub;
899
900 Info->Info.Size = sizeof(*Info);
901 RootHub->m_NumberOf20Ports = Info->Info.NumberOf20Ports;
902 RootHub->m_NumberOf30Ports = Info->Info.NumberOf30Ports;
903
904 DPRINT("Root hub %p has %lu USB 2 and %lu USB 3 ports\n",
905 RootHub, (ULONG)Info->Info.NumberOf20Ports, (ULONG)Info->Info.NumberOf30Ports);
906
908}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
Type
Definition: Type.h:7
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:834
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define ARRAYSIZE(a)
Definition: cat.c:25
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
RtlInitEmptyUnicodeString(SymbolicLinkName, NULL, 0)
WdfDeviceWdmDispatchPreprocessedIrp(Device, Irp)
WdfPdoInitAllowForwardingRequestToParent(Init)
WdfDeviceSetSpecialFileSupport(Device, WdfSpecialFilePaging, TRUE)
Definition: bufpool.h:45
Definition: Header.h:9
WDFDEVICE m_Fdo
Definition: hostctl.h:288
UCX_CONTROLLER_CONFIG m_Config
Definition: hostctl.h:289
DEVICE_CAPABILITIES m_HcCaps
Definition: hostctl.h:303
NTSTATUS OnHcdResetDone(_In_ PIRP Irp)
Definition: pipeio.cpp:25
WDF_DEVICE_PNP_CAPABILITIES m_PnpCaps
Definition: rhub.h:130
VOID BuildPowerCapabilities()
Definition: rhubpdo.cpp:87
WDFDEVICE m_Pdo
Definition: rhub.h:135
NTSTATUS CreatePdo()
Definition: rhubpdo.cpp:129
KSPIN_LOCK m_PdoInfoLock
Definition: rhub.h:134
WDF_DEVICE_POWER_CAPABILITIES m_PowerCaps
Definition: rhub.h:131
UCX_ROOTHUB_CONFIG m_Config
Definition: rhub.h:116
POWER_ACTION m_SystemPowerAction
Definition: rhub.h:143
UcxController * m_Controller
Definition: rhub.h:115
NTSTATUS AddQueryInterfaces()
WDFDEVICE Pdo() const
Definition: rhub.h:108
NTSTATUS NTAPI UcxProcessSubmitUrb(_In_ WDFDEVICE RootHubPdo, _In_ PIRP Irp)
Definition: clientxrb.cpp:169
@ RootHubPoweredUp
@ HubRequestsReset
@ RootHubPoweringDown
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
LPWSTR Name
Definition: desk.c:124
ULONG DEVPROPTYPE
Definition: devpropdef.h:24
#define DEVPROP_TYPE_EMPTY
Definition: devpropdef.h:29
#define DEVPROP_TYPE_UINT32
Definition: devpropdef.h:36
_In_ ULONG Attributes
Definition: dispmprt.h:1077
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
#define L(x)
Definition: resources.c:13
#define _IRQL_requires_(irql)
Definition: driverspecs.h:229
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define PagedPool
Definition: env_spec_w32.h:308
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
Definition: fsrtlfuncs.h:908
Status
Definition: gdiplustypes.h:24
_In_ const HubIdStrings * Ids
return RtlUnicodeStringPrintf(Name, L"uxd_port_%03u", PortNumber)
#define IOCTL_UCXHUB_RESET_PORT_ASYNC
Definition: hubucx.h:78
#define IOCTL_UCXHUB_DEVICE_ENABLE
Definition: hubucx.h:53
#define IOCTL_UCXHUB_DEVICE_ADDRESS
Definition: hubucx.h:55
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
#define IOCTL_UCXHUB_ROOTHUB_GET_20PORT_INFO
Definition: hubucx.h:51
#define IOCTL_UCXHUB_ROOTHUB_GET_30PORT_INFO
Definition: hubucx.h:52
#define IOCTL_UCXHUB_ADDRESS0_OWNERSHIP_ACQUIRE
Definition: hubucx.h:49
#define IOCTL_UCXHUB_DEVICE_TREE_PURGE_IO
Definition: hubucx.h:67
#define IOCTL_UCXHUB_DEVICE_START_IO
Definition: hubucx.h:60
#define IOCTL_UCXHUB_FREE_DUMP_DATA
Definition: hubucx.h:74
#define IOCTL_UCXHUB_ENDPOINT_RESET
Definition: hubucx.h:63
#define IOCTL_UCXHUB_DEVICE_UPDATE
Definition: hubucx.h:56
#define IOCTL_UCXHUB_ROOTHUB_GET_INFO
Definition: hubucx.h:50
#define IOCTL_UCXHUB_DEVICE_DISABLE
Definition: hubucx.h:58
#define IOCTL_UCXHUB_DEVICE_RESET
Definition: hubucx.h:54
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
Definition: hubucx.h:238
#define IOCTL_UCXHUB_DEVICE_HUB_INFO
Definition: hubucx.h:57
#define IOCTL_UCXHUB_DEFAULT_ENDPOINT_UPDATE
Definition: hubucx.h:62
#define IOCTL_UCXHUB_QUERY_USB_CAPABILITY
Definition: hubucx.h:65
#define IOCTL_UCXHUB_SET_FUNCTION_HANDLE_DATA
Definition: hubucx.h:66
#define IOCTL_UCXHUB_GET_DUMP_DATA
Definition: hubucx.h:72
#define IOCTL_UCXHUB_NOTIFY_FORWARD_PROGRESS
Definition: hubucx.h:69
#define IOCTL_UCXHUB_ENDPOINTS_CONFIGURE
Definition: hubucx.h:61
#define IOCTL_UCXHUB_DEVICE_PURGE_IO
Definition: hubucx.h:59
#define IOCTL_UCXHUB_DEVICE_ABORT_IO
Definition: hubucx.h:68
_In_ UCXUSBDEVICE _In_ PDEVICE_OBJECT Pdo
Definition: hubucx.h:280
struct _UCXHUB_ROOTHUB_INFO * PUCXHUB_ROOTHUB_INFO
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
NTSTATUS NTAPI IoSetCompletionRoutineEx(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PIO_COMPLETION_ROUTINE CompletionRoutine, IN PVOID Context, IN BOOLEAN InvokeOnSuccess, IN BOOLEAN InvokeOnError, IN BOOLEAN InvokeOnCancel)
Definition: iocomp.c:220
IoMarkIrpPending(Irp)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:490
_In_ PIRP Irp
Definition: kse.h:79
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
if(dx< 0)
Definition: linetemp.h:194
unsigned __int64 ULONG64
Definition: imports.h:198
#define KernelMode
Definition: asm.h:38
#define _Inout_
Definition: no_sal2.h:162
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_reads_opt_(s)
Definition: no_sal2.h:222
#define _In_
Definition: no_sal2.h:158
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
WCHAR * PWCH
Definition: ntbasedef.h:422
#define UNICODE_NULL
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define DECLARE_GLOBAL_CONST_UNICODE_STRING(_var, _str)
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCopyCurrentIrpStackLocationToNext(Irp)
Definition: ntifs_ex.h:413
#define IoCompleteRequest
Definition: irp.c:1272
@ PowerSystemUnspecified
Definition: ntpoapi.h:35
@ PowerSystemSleeping1
Definition: ntpoapi.h:37
@ PowerSystemSleeping3
Definition: ntpoapi.h:39
@ PowerSystemShutdown
Definition: ntpoapi.h:41
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerSystemHibernate
Definition: ntpoapi.h:40
@ PowerActionNone
Definition: ntpoapi.h:123
@ PowerDeviceUnspecified
Definition: ntpoapi.h:48
@ PowerDeviceD2
Definition: ntpoapi.h:51
@ PowerDeviceD3
Definition: ntpoapi.h:52
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
@ PNPBus
Definition: restypes.h:137
EVT_WDFDEVICE_WDM_IRP_PREPROCESS UcxEvtRootHubPreprocessInternalIoctl
Definition: rhub.h:184
EVT_WDF_DEVICE_PREPARE_HARDWARE UcxEvtRootHubPrepareHardware
Definition: rhub.h:178
EVT_WDF_DEVICE_RELEASE_HARDWARE UcxEvtRootHubReleaseHardware
Definition: rhub.h:179
EVT_WDF_DEVICE_DISABLE_WAKE_AT_BUS UcxEvtRootHubDisableWakeAtBus
Definition: rhub.h:183
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL UcxEvtRootHubPdoIoDeviceControl
Definition: rhub.h:187
EVT_WDF_DEVICE_D0_ENTRY UcxEvtRootHubD0Entry
Definition: rhub.h:180
EVT_WDF_DEVICE_ENABLE_WAKE_AT_BUS UcxEvtRootHubEnableWakeAtBus
Definition: rhub.h:182
EVT_WDF_DEVICE_D0_EXIT UcxEvtRootHubD0Exit
Definition: rhub.h:181
EVT_WDFDEVICE_WDM_IRP_PREPROCESS UcxEvtRootHubPreprocessSetPower
Definition: rhub.h:186
EVT_WDFDEVICE_WDM_IRP_PREPROCESS UcxEvtRootHubPreprocessQueryInterface
Definition: rhub.h:185
DEVPROPTYPE SerialType
Definition: rhubpdo.cpp:334
size_t AttributesSize
Definition: rhubpdo.cpp:332
ULONG64 Serial
Definition: rhubpdo.cpp:335
static VOID NTAPI UcxSetCompletionRoutine(_In_ WDFDEVICE Device, _In_ PIRP Irp, _In_ PIO_COMPLETION_ROUTINE Routine, _In_ PVOID Context)
Definition: rhubpdo.cpp:670
PVOID AttributesData
Definition: rhubpdo.cpp:331
UcxStackSetup
Definition: rhubpdo.cpp:589
BOOLEAN Found
Definition: rhubpdo.cpp:337
ULONG Required
Definition: rhubpdo.cpp:336
static const SIZE_T UcxHardwareIdSeparators[]
Definition: rhubpdo.cpp:33
NTSTATUS Status
Definition: rhubpdo.cpp:338
#define UCX_HWID_SHORT_CHARS
Definition: rhubpdo.cpp:28
static const DEVPROPKEY UcxPciKeyUsb4PortAttributes
Definition: rhubpdo.cpp:315
#define UCX_ROOT_HUB_ID
Definition: rhubpdo.cpp:21
static NTSTATUS NTAPI UcxQueueAsyncPortReset(_In_ UcxController *Controller, _In_ PIRP Irp)
Definition: rhubpdo.cpp:692
static const DEVPROPKEY UcxPciKeyParentSerialNumber
Definition: rhubpdo.cpp:317
static WDFQUEUE NTAPI UcxRouteHubIoctl(_In_ UcxController *Controller, _In_ ULONG IoControlCode, _Out_ UcxStackSetup *Setup)
Definition: rhubpdo.cpp:599
static const WCHAR UcxRootHubDeviceIdText[]
Definition: rhubpdo.cpp:24
static IO_COMPLETION_ROUTINE UcxRootHubGetInfoCompletion
Definition: rhubpdo.cpp:19
static VOID NTAPI UcxBuildRootHubHardwareIds(_In_ const UCX_CONTROLLER_CONFIG *Config, _Out_writes_(BufferChars) PWCHAR Buffer, _In_ SIZE_T BufferChars, _Out_ PUNICODE_STRING Ids)
Definition: rhubpdo.cpp:44
#define UCX_HWID_FULL_CHARS
Definition: rhubpdo.cpp:27
#define UCX_HWID_BUFFER_CHARS
Definition: rhubpdo.cpp:30
WDFMEMORY Attributes
Definition: rhubpdo.cpp:330
static const DEVPROPKEY UcxPciKeySerialNumber
Definition: rhubpdo.cpp:313
#define UCX_HWID_PLAIN_CHARS
Definition: rhubpdo.cpp:29
static IO_COMPLETION_ROUTINE UcxDeviceMgmtCompletion
Definition: rhubpdo.cpp:18
WDF_DEVICE_PROPERTY_DATA_INIT & Property
Definition: rhubpdo.cpp:340
DEVPROPTYPE AttributesType
Definition: rhubpdo.cpp:333
static NTSTATUS NTAPI UcxCompleteIrpWithStatus(_In_ PIRP Irp, _In_ NTSTATUS Status)
Definition: rhubpdo.cpp:656
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
UcxController * Controller
Definition: rhub.h:42
UcxRootHub * RootHub
Definition: rhub.h:41
union _IO_STACK_LOCATION::@1823 Parameters
struct _IO_STACK_LOCATION::@1823::@1824 DeviceIoControl
INTERFACE_TYPE LegacyBusType
Definition: cmtypes.h:366
CHAR DeviceId[MAX_DEVICE_ID_STRING_LENGTH]
Definition: ucxcontroller.h:51
CHAR RevisionId[MAX_REVISION_ID_STRING_LENGTH]
Definition: ucxcontroller.h:52
CHAR VendorId[MAX_VENDOR_ID_STRING_LENGTH]
Definition: ucxcontroller.h:50
WDF_OBJECT_ATTRIBUTES WdfRequestAttributes
Definition: ucxroothub.h:204
DEVICE_POWER_STATE DeviceWake
Definition: wdfdevice.h:1590
SYSTEM_POWER_STATE SystemWake
Definition: wdfdevice.h:1591
DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]
Definition: wdfdevice.h:1584
PFN_WDF_IO_QUEUE_IO_DEVICE_CONTROL EvtIoDeviceControl
Definition: wdfio.h:405
PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS EvtDeviceEnableWakeAtBus
Definition: wdfpdo.h:181
PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS EvtDeviceDisableWakeAtBus
Definition: wdfpdo.h:187
PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
Definition: wdfdevice.h:1164
PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit
Definition: wdfdevice.h:1166
PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware
Definition: wdfdevice.h:1168
PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware
Definition: wdfdevice.h:1169
#define STATUS_PENDING
Definition: telnetd.h:14
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXCONTROLLER * Controller
@ UcxControllerParentBusTypePci
Definition: ucxcontroller.h:17
@ UcxControllerParentBusTypeAcpi
Definition: ucxcontroller.h:18
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
_In_ PGUID _In_ ULONG OutputBufferLength
Definition: ucxcontroller.h:81
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST Request
_Must_inspect_result_ _In_ UCXCONTROLLER _In_ PUCX_ROOTHUB_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXROOTHUB * RootHub
Definition: ucxroothub.h:299
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_OBJECT_NAME_COLLISION
Definition: udferr_usr.h:150
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IOCTL_INTERNAL_USB_SUBMIT_URB
Definition: usbioctl.h:32
#define IOCTL_INTERNAL_USB_REGISTER_COMPOSITE_DEVICE
Definition: usbioctl.h:760
#define IOCTL_INTERNAL_USB_REQUEST_REMOTE_WAKE_NOTIFICATION
Definition: usbioctl.h:766
#define IOCTL_INTERNAL_USB_UNREGISTER_COMPOSITE_DEVICE
Definition: usbioctl.h:763
WdfObjectDelete(String)
for(Attempt=0;Attempt< UCX_LEGACY_NAME_ATTEMPTS;Attempt++)
Definition: userreq.cpp:715
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
FORCEINLINE VOID WDF_DEVICE_PNP_CAPABILITIES_INIT(_Out_ PWDF_DEVICE_PNP_CAPABILITIES Caps)
Definition: wdfdevice.h:1545
_In_ WDF_POWER_DEVICE_STATE PreviousState
Definition: wdfdevice.h:829
@ WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP
Definition: wdfdevice.h:437
enum _WDF_POWER_DEVICE_STATE WDF_POWER_DEVICE_STATE
_In_ WDFCMRESLIST _In_ WDFCMRESLIST ResourcesTranslated
Definition: wdfdevice.h:891
@ WdfSpecialFileBoot
Definition: wdfdevice.h:445
@ WdfSpecialFileHibernation
Definition: wdfdevice.h:443
@ WdfSpecialFileDump
Definition: wdfdevice.h:444
@ WdfSpecialFilePaging
Definition: wdfdevice.h:442
FORCEINLINE VOID WDF_DEVICE_PROPERTY_DATA_INIT(_Out_ PWDF_DEVICE_PROPERTY_DATA PropertyData, _In_ const DEVPROPKEY *PropertyKey)
Definition: wdfdevice.h:1941
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2231
FORCEINLINE VOID WDF_PNPPOWER_EVENT_CALLBACKS_INIT(_Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks)
Definition: wdfdevice.h:1214
_In_ WDF_POWER_DEVICE_STATE TargetState
Definition: wdfdevice.h:859
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707
FORCEINLINE VOID WDF_DEVICE_POWER_CAPABILITIES_INIT(_Out_ PWDF_DEVICE_POWER_CAPABILITIES Caps)
Definition: wdfdevice.h:1612
_In_ WDFCMRESLIST ResourcesRaw
Definition: wdfdevice.h:888
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3040
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
FORCEINLINE VOID WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(_Out_ PWDF_IO_QUEUE_CONFIG Config, _In_ WDF_IO_QUEUE_DISPATCH_TYPE DispatchType)
Definition: wdfio.h:443
@ WdfIoQueueDispatchParallel
Definition: wdfio.h:79
FORCEINLINE VOID WDF_OBJECT_ATTRIBUTES_INIT(_Out_ PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: wdfobject.h:147
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
Definition: wdfobject.h:170
FORCEINLINE VOID WDF_PDO_EVENT_CALLBACKS_INIT(_Out_ PWDF_PDO_EVENT_CALLBACKS Callbacks)
Definition: wdfpdo.h:199
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
@ WdfTrue
Definition: wdftypes.h:88
@ WdfFalse
Definition: wdftypes.h:87
#define WDF_NO_HANDLE
Definition: wdftypes.h:107
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105
DEVICE_CAPABILITIES
Definition: iotypes.h:965
#define STATUS_CONTINUE_COMPLETION
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_QUERY_INTERFACE
IO_COMPLETION_ROUTINE * PIO_COMPLETION_ROUTINE
Definition: iotypes.h:2850
#define IRP_MN_SET_POWER
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MJ_POWER
_In_ SYSTEM_POWER_STATE SystemPowerState
Definition: iotypes.h:7535
@ Executive
Definition: ketypes.h:467
#define NT_ASSERT
Definition: rtlfuncs.h:3334