ReactOS 0.4.17-dev-1281-g065abb3
devicemgmt.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: Device management IOCTLs from the hub and the operations they drive
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8/*
9 * The hub's own IRP reaches the HCD: UCX never builds a request here. Some
10 * operations first walk the device's endpoint machines; the request is then
11 * forwarded to the HCD or completed once every endpoint acknowledged.
12 */
13
14#include "ucx01000.h"
15
16#define NDEBUG
17#include <debug.h>
18
20static
24 _In_ WDFREQUEST Request,
26{
28
30 return UcxUsbDevice::FromHandle((UCXUSBDEVICE)((PURB)Arg1)->UrbHeader.UsbdDeviceHandle);
31
32 return UcxUsbDevice::FromHandle(((PUSBDEVICE_MGMT_HEADER)Arg1)->UsbDevice);
33}
34
35VOID
38 _In_ WDFQUEUE Queue,
39 _In_ WDFREQUEST Request,
43{
45 UcxController* Controller = Device->m_Controller;
46
50
51 if (!Controller->BlockReset())
52 {
53 DPRINT("UsbDevice %p IOCTL 0x%lx during controller reset\n", Device->m_Handle, IoControlCode);
54 Device->FailManagement(Request, IoControlCode);
55 return;
56 }
57
58 /* Only an enable may bring back a device the last controller reset deprogrammed */
59 if (Device->m_DeprogrammedByControllerReset)
60 {
62 {
63 DPRINT("UsbDevice %p IOCTL 0x%lx after a controller reset deprogrammed it\n",
64 Device->m_Handle, IoControlCode);
65 Device->FailManagement(Request, IoControlCode);
66 Controller->UnblockReset();
67 return;
68 }
69 DPRINT("UsbDevice %p enabled again after a controller reset\n", Device->m_Handle);
70 Device->m_DeprogrammedByControllerReset = FALSE;
71 }
72
73 Device->DispatchManagement(Request, IoControlCode);
74
75 /* The operation usually continues; it does not need the reference */
76 Controller->UnblockReset();
77}
78
79VOID
81 _In_ WDFREQUEST Request,
83{
84 UCXCONTROLLER Controller = m_Controller->m_Handle;
87 PURB Urb;
88
90
91 DPRINT("UsbDevice %p IOCTL 0x%lx request %p\n", m_Handle, IoControlCode, Request);
92
93 switch (IoControlCode)
94 {
96 HandleHubPurgeIo(Request, ((PUSBDEVICE_PURGEIO)Arg1)->OnSuspend);
97 break;
98
101 break;
102
105 break;
106
109 break;
110
112 Urb = (PURB)Arg1;
113 if (Urb->UrbHeader.Function == URB_FUNCTION_OPEN_STATIC_STREAMS)
114 UcxEndpoint::FromPipe(Urb->UrbOpenStaticStreams.PipeHandle)->HandleClientStreamsEnable(Request);
115 else if (Urb->UrbHeader.Function == URB_FUNCTION_CLOSE_STATIC_STREAMS)
116 UcxEndpoint::FromPipe(Urb->UrbPipeRequest.PipeHandle)->HandleClientStreamsDisable(Request);
117 else
118 {
119 DPRINT1("UsbDevice %p unexpected URB function 0x%x\n", m_Handle, Urb->UrbHeader.Function);
120 WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
121 }
122 break;
123
126 break;
127
130 break;
131
134 break;
135
138 break;
139
140 /* Goes to the device's default endpoint, not the one in the payload */
143 break;
144
146 UcxEndpoint::FromHandle(((PENDPOINT_RESET)Arg1)->Endpoint)->HandleHubReset(Request);
147 break;
148
151 break;
152
155 break;
156
159 break;
160
161 default:
162 DPRINT1("UsbDevice %p unexpected IOCTL 0x%lx\n", m_Handle, IoControlCode);
163 WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
164 break;
165 }
166}
167
168/* During a reset only operations that run through the endpoints still go ahead */
169VOID
171 _In_ WDFREQUEST Request,
173{
175 PURB Urb;
176
177 switch (IoControlCode)
178 {
179 /* The suspend hint is dropped on this path */
182 break;
183
186 break;
187
190 break;
191
193 Urb = (PURB)Arg1;
194 if (Urb->UrbHeader.Function == URB_FUNCTION_OPEN_STATIC_STREAMS)
195 {
196 UcxEndpoint* Endpoint = UcxEndpoint::FromPipe(Urb->UrbOpenStaticStreams.PipeHandle);
197
198 NT_ASSERT(!Endpoint->m_OpenFailedOnReset);
199 Endpoint->m_OpenFailedOnReset = TRUE;
200 DPRINT1("Endpoint %p static streams open failed by controller reset\n", Endpoint->m_Handle);
201 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
202 }
203 else if (Urb->UrbHeader.Function == URB_FUNCTION_CLOSE_STATIC_STREAMS)
204 {
205 UcxEndpoint::FromPipe(Urb->UrbPipeRequest.PipeHandle)->HandleClientStreamsDisable(Request);
206 }
207 else
208 {
209 DPRINT1("UsbDevice %p unexpected URB function 0x%x during reset\n", m_Handle, Urb->UrbHeader.Function);
210 WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
211 }
212 break;
213
218 break;
219
222 break;
223
226 break;
227
231 DPRINT1("UsbDevice %p endpoint reset failed by controller reset\n", m_Handle);
232 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
233 break;
234
235 default:
236 DPRINT1("UsbDevice %p IOCTL 0x%lx failed by controller reset\n", m_Handle, IoControlCode);
237 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
238 break;
239 }
240}
241
242/* Requests parked while a controller reset ran come back here when it is over */
243VOID
244NTAPI
246 _In_ WDFQUEUE Queue,
247 _In_ WDFREQUEST Request,
249 _In_ size_t InputBufferLength,
251{
255 PURB Urb;
256
260
261 switch (IoControlCode)
262 {
266 break;
267
269 Status = (((PENDPOINTS_CONFIGURE)Arg1)->EndpointsToEnableCount != 0) ? STATUS_NO_SUCH_DEVICE
271 break;
272
274 Urb = (PURB)Arg1;
275 if (Urb->UrbHeader.Function != URB_FUNCTION_CLOSE_STATIC_STREAMS)
276 {
277 DPRINT1("Parked request %p has unexpected URB function 0x%x\n", Request, Urb->UrbHeader.Function);
280 break;
281 }
282
283 Device = UcxUsbDevice::FromHandle((UCXUSBDEVICE)Urb->UrbHeader.UsbdDeviceHandle);
284 if (Device->m_FailNextStreamClose)
285 {
286 Device->m_FailNextStreamClose = FALSE;
288 }
289 else
290 {
292 }
293 break;
294
295 default:
296 DPRINT1("Parked request %p has unexpected IOCTL 0x%lx\n", Request, IoControlCode);
299 break;
300 }
301
302 DPRINT("Parked request %p IOCTL 0x%lx released 0x%lx\n", Request, IoControlCode, Status);
303 WdfRequestComplete(Request, Status);
304}
305
306/* One tree purge at a time: the sequential queue stays stopped until it is done */
307VOID
308NTAPI
310 _In_ WDFQUEUE Queue,
311 _In_ WDFREQUEST Request,
313 _In_ size_t InputBufferLength,
315{
316 UcxController* Controller = UcxController::FromFdo(WdfIoQueueGetDevice(Queue));
318
321
323 {
324 DPRINT1("Tree purge queue got unexpected IOCTL 0x%lx\n", IoControlCode);
325 WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
326 return;
327 }
328
329 WdfIoQueueStop(Queue, NULL, NULL);
330
331 /* This IOCTL must not fail */
332 Status = WdfRequestForwardToIoQueue(Request, Controller->m_DeviceMgmtQueue);
333 if (!NT_SUCCESS(Status))
334 {
335 DPRINT1("Tree purge request %p forward failed 0x%lx, completed anyway\n", Request, Status);
336 WdfRequestComplete(Request, STATUS_SUCCESS);
337 WdfIoQueueStart(Queue);
338 }
339}
340
341/* Pending operations */
342
343/* The count is set by the caller or the fan out, always before the first post */
344VOID
347 _In_ PFN_UCX_OPERATION_DONE Done,
349{
351
355}
356
357VOID
359{
361
363 return;
364
367 (this->*Done)();
368}
369
370/* With no endpoints nothing is posted and the hub's request never completes */
371VOID
374{
375 LIST_ENTRY Endpoints;
378 LONG Count = 0;
379
380 InitializeListHead(&Endpoints);
381
382 {
384
386 {
388
389 WdfObjectReference(Endpoint->m_Handle);
390 InsertTailList(&Endpoints, &Endpoint->m_OperationLink);
391 Count++;
392 }
393 }
394
396
397 while (!IsListEmpty(&Endpoints))
398 {
399 Entry = RemoveHeadList(&Endpoints);
401 Endpoint = CONTAINING_RECORD(Entry, UcxEndpoint, m_OperationLink);
402
403 Endpoint->Post(Event);
405 }
406}
407
408VOID
410 _In_ WDFREQUEST Request,
411 _In_ BOOLEAN OnSuspend)
412{
413 if (OnSuspend && m_Callbacks.Public.EvtUsbDeviceSuspend != NULL)
415
417 FanOutToEndpoints(EpEvent::HubPurge);
418}
419
420/* The hub only sends STARTIO on resume from suspend */
421VOID
423 _In_ WDFREQUEST Request)
424{
427
429 FanOutToEndpoints(EpEvent::HubStartRequest);
430}
431
432VOID
434 _In_ WDFREQUEST Request)
435{
437 FanOutToEndpoints(EpEvent::HubAbort);
438}
439
440/* Disconnected devices are included: their endpoints may not have reached purge yet */
441static
442VOID
443NTAPI
447{
448 PLIST_ENTRY Endpoints = (PLIST_ENTRY)Context;
451
452 Device->m_ChildrenMayLeavePurge = FALSE;
453 Device->m_EndpointsMayLeavePurge = FALSE;
454
455 for (Entry = Device->m_EndpointList.Flink; Entry != &Device->m_EndpointList; Entry = Entry->Flink)
456 {
458
459 WdfObjectReference(Endpoint->m_Handle);
460 InsertTailList(Endpoints, &Endpoint->m_TreePurgeLink);
461 }
462}
463
464VOID
466 _In_ WDFREQUEST Request)
467{
469 LIST_ENTRY Endpoints;
472 LONG Count = 0;
473
474 InitializeListHead(&Endpoints);
475
476 {
477 SpinLockGuard Guard(&Controller->m_TopologyLock);
478
480 }
481
482 for (Entry = Endpoints.Flink; Entry != &Endpoints; Entry = Entry->Flink)
483 Count++;
484
485 NT_ASSERT(Controller->m_PendingTreePurge == NULL && Controller->m_PendingTreePurgeEndpoints == 0);
486 Controller->m_PendingTreePurge = Request;
487 Controller->m_PendingTreePurgeEndpoints = Count;
488
489 while (!IsListEmpty(&Endpoints))
490 {
491 Entry = RemoveHeadList(&Endpoints);
493 Endpoint = CONTAINING_RECORD(Entry, UcxEndpoint, m_TreePurgeLink);
494
495 Endpoint->Post(EpEvent::HubTreePurge);
497 }
498}
499
500VOID
502 _In_ WDFREQUEST Request,
503 _In_ BOOLEAN AfterReset)
504{
506 ULONG Count = Reset->EndpointsToDisableCount;
507 UCXENDPOINT* ToDisable = Reset->EndpointsToDisable;
508 UCXENDPOINT DefaultEndpoint = Reset->DefaultEndpoint;
509 ULONG Index;
510
511 {
513
514 /* A tree purged device may leave tree purge once its parent has */
517 }
518
521 Count + 1);
522
523 /* The payload may be gone once the last post finishes the operation */
524 for (Index = 0; Index < Count; Index++)
525 UcxEndpoint::FromHandle(ToDisable[Index])->Post(EpEvent::HubDeviceReset);
526
527 UcxEndpoint::FromHandle(DefaultEndpoint)->Post(EpEvent::HubDeviceReset);
528}
529
530/* Only the default endpoint is told; configure disabled the others first */
531VOID
533 _In_ WDFREQUEST Request,
534 _In_ BOOLEAN AfterReset)
535{
537 UCXENDPOINT DefaultEndpoint = Disable->DefaultEndpoint;
538
542 1);
543
544 UcxEndpoint::FromHandle(DefaultEndpoint)->Post(EpEvent::HubDisable);
545}
546
547VOID
549 _In_ WDFREQUEST Request,
550 _In_ BOOLEAN AfterReset)
551{
553 ULONG Count = Configure->EndpointsToDisableCount;
554 UCXENDPOINT* ToDisable = Configure->EndpointsToDisable;
555 ULONG Index;
556
557 if (Count == 0)
558 {
559 /* Unlike the parked path, nothing to disable after a reset is a failure here */
560 if (AfterReset)
561 {
562 DPRINT1("UsbDevice %p endpoints configure failed by controller reset\n", m_Handle);
563 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
564 }
565 else
566 {
568 }
569 return;
570 }
571
575 Count);
576
577 for (Index = 0; Index < Count; Index++)
578 UcxEndpoint::FromHandle(ToDisable[Index])->Post(EpEvent::HubDisable);
579}
580
581/* Applied before the HCD sees the request, whatever it then answers */
582VOID
584 _In_ WDFREQUEST Request)
585{
587
588 if (Update->Flags.UpdateIsHub && Update->IsHub)
590
591 if (Update->Flags.UpdateAllowIoOnInvalidPipeHandles)
593
594 if (Update->Flags.UpdateDeviceDescriptor)
595 m_BcdUsb = Update->DeviceDescriptor->bcdUSB;
596
598}
599
600/* Completions run when the last endpoint acknowledged */
601
602VOID
604{
606}
607
608VOID
610{
612}
613
614VOID
616{
618}
619
620/* The parked request completes once the controller reset machine releases it */
621static
622VOID
623NTAPI
626 _In_ WDFREQUEST Request)
627{
629
630 Status = WdfRequestForwardToIoQueue(Request, Device->m_Controller->m_PendDuringResetQueue);
631 if (!NT_SUCCESS(Status))
632 DPRINT1("UsbDevice %p could not park request %p 0x%lx\n", Device->m_Handle, Request, Status);
633}
634
635VOID
637{
638 UcxParkDuringReset(this, (WDFREQUEST)TakeOperation());
639}
640
641VOID
643{
644 UcxParkDuringReset(this, (WDFREQUEST)TakeOperation());
645}
646
647VOID
649{
650 UcxParkDuringReset(this, (WDFREQUEST)TakeOperation());
651}
652
653VOID
655{
656 WdfRequestComplete((WDFREQUEST)TakeOperation(), STATUS_SUCCESS);
657}
658
659static
660VOID
661NTAPI
663 _In_ PIRP Irp,
665{
666 Irp->IoStatus.Status = Status;
667 Irp->IoStatus.Information = 0;
669}
670
671/* A controller reset that hit while the default endpoint finished still fails the enable */
672VOID
674{
676
678 DPRINT1("UsbDevice %p enable failed by controller reset\n", m_Handle);
679
681}
682
683VOID
685{
687}
688
689/* A reset device lets its own children leave tree purge again; the HCD's status is not used */
690VOID
692{
693 PIRP Irp;
694
695 {
697
700 }
701
704}
705
706/* Up paths from the device management completion routine */
707
710 _In_ PIRP Irp,
712{
713 /* Completed again right here; the hub's routine runs nested */
714 if (!NT_SUCCESS(Irp->IoStatus.Status))
715 {
716 DPRINT1("UsbDevice %p HCD enable failed 0x%lx\n", m_Handle, Irp->IoStatus.Status);
719 }
720
722 m_Enabled = TRUE;
723 UcxEndpoint::FromHandle(Enable->DefaultEndpoint)->Post(EpEvent::ConfigureDone);
724
726}
727
728/* The endpoints that were disabled stay disabled until a later configure */
731 _In_ PIRP Irp,
733{
734 NT_ASSERT(NT_SUCCESS(Irp->IoStatus.Status));
735
737 UcxEndpoint::FromHandle(Reset->DefaultEndpoint)->Post(EpEvent::DeviceResetDone);
738
740}
741
744 _In_ PIRP Irp,
746{
747 ULONG Count = Configure->EndpointsToEnableCount;
748 UCXENDPOINT* ToEnable = Configure->EndpointsToEnable;
749 ULONG Index;
750
751 if (!NT_SUCCESS(Irp->IoStatus.Status))
752 {
753 DPRINT1("UsbDevice %p HCD endpoints configure failed 0x%lx\n", m_Handle, Irp->IoStatus.Status);
756 }
757
758 if (Count == 0)
759 {
762 }
763
765
766 for (Index = 0; Index < Count; Index++)
767 UcxEndpoint::FromHandle(ToEnable[Index])->Post(EpEvent::ConfigureDone);
768
770}
struct _IRP * PIRP
static T & Reset(T &sei, UINT flags=SEE_MASK_FLAG_NO_UI)
unsigned char BOOLEAN
Definition: actypes.h:127
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
@ Update
Definition: registry.c:565
static UcxController * FromFdo(_In_ WDFDEVICE Fdo)
Definition: hostctl.cpp:21
KSPIN_LOCK m_TopologyLock
Definition: hostctl.h:310
UCXCONTROLLER m_Handle
Definition: hostctl.h:287
VOID HandleHubReset(_In_ WDFREQUEST Request)
Definition: pipeio.cpp:16
UcxEndpointCallbacks m_Callbacks
Definition: pipe.h:289
BOOLEAN Post(_In_ EpEvent Event)
Definition: pipe.h:255
VOID HandleClientStreamsDisable(_In_ WDFREQUEST Request)
Definition: pipeio.cpp:298
VOID HandleClientStreamsEnable(_In_ WDFREQUEST Request)
Definition: pipeio.cpp:290
PFN_UCX_OPERATION_DONE m_PendingOperationDone
Definition: devobj.h:254
UcxController * m_Controller
Definition: devobj.h:216
BOOLEAN m_EndpointResetFailedByControllerReset
Definition: devobj.h:249
VOID HandleHubStartIo(_In_ WDFREQUEST Request)
Definition: devicemgmt.cpp:422
VOID HandleHubTreePurge(_In_ WDFREQUEST Request)
Definition: devicemgmt.cpp:465
VOID HandleHubEndpointsConfigure(_In_ WDFREQUEST Request, _In_ BOOLEAN AfterReset)
Definition: devicemgmt.cpp:548
VOID DispatchManagement(_In_ WDFREQUEST Request, _In_ ULONG IoControlCode)
Definition: devicemgmt.cpp:80
BOOLEAN m_ChildrenMayLeavePurge
Definition: devobj.h:232
VOID HandleHubAbortIo(_In_ WDFREQUEST Request)
Definition: devicemgmt.cpp:433
LIST_ENTRY m_EndpointList
Definition: devobj.h:229
VOID SendEndpointsConfigureToController()
Definition: devicemgmt.cpp:615
UcxEndpoint * m_DefaultEndpoint
Definition: devobj.h:240
VOID WalkSubtree(_In_ PFN_UCX_DEVICE_VISITOR Visitor, _In_opt_ PVOID Context, _In_ BOOLEAN IncludeDisconnected)
Definition: devobj.cpp:396
NTSTATUS OnHcdEnableDone(_In_ PIRP Irp, _In_ PUSBDEVICE_ENABLE Enable)
Definition: devicemgmt.cpp:709
VOID TrackStaleHandles()
Definition: devobj.cpp:500
USHORT m_BcdUsb
Definition: devobj.h:220
VOID CompleteHubRequest()
Definition: devicemgmt.cpp:654
VOID CompleteHubOperation()
Definition: devicemgmt.cpp:358
BOOLEAN m_DeprogrammedByControllerReset
Definition: devobj.h:244
BOOLEAN m_ResetFailedByControllerReset
Definition: devobj.h:248
VOID CompleteEnableIrp()
Definition: devicemgmt.cpp:673
VOID CompleteEndpointsConfigureIrp()
Definition: devicemgmt.cpp:684
VOID HandleHubReset(_In_ WDFREQUEST Request, _In_ BOOLEAN AfterReset)
Definition: devicemgmt.cpp:501
VOID FanOutToEndpoints(_In_ EpEvent Event)
Definition: devicemgmt.cpp:372
BOOLEAN m_Enabled
Definition: devobj.h:243
PVOID m_PendingOperation
Definition: devobj.h:253
VOID(UcxUsbDevice::* PFN_UCX_OPERATION_DONE)()
Definition: devobj.h:53
VOID UpdateFromHub(_In_ WDFREQUEST Request)
Definition: devicemgmt.cpp:583
BOOLEAN m_EndpointsMayLeavePurge
Definition: devobj.h:233
UCXUSBDEVICE m_Handle
Definition: devobj.h:215
VOID StartOperation(_In_ PVOID Pending, _In_ PFN_UCX_OPERATION_DONE Done, _In_ LONG Count)
Definition: devicemgmt.cpp:345
VOID FinishEndpointResetRequest()
Definition: devicemgmt.cpp:691
VOID PendEndpointsConfigure()
Definition: devicemgmt.cpp:648
PVOID TakeOperation()
Definition: devobj.h:290
VOID FailManagement(_In_ WDFREQUEST Request, _In_ ULONG IoControlCode)
Definition: devicemgmt.cpp:170
NTSTATUS OnHcdEndpointsConfigureDone(_In_ PIRP Irp, _In_ PENDPOINTS_CONFIGURE Configure)
Definition: devicemgmt.cpp:743
UcxUsbDeviceCallbacks m_Callbacks
Definition: devobj.h:222
VOID SendResetToController()
Definition: devicemgmt.cpp:603
ULONG64 m_Timestamp
Definition: devobj.h:224
VOID SendDisableToController()
Definition: devicemgmt.cpp:609
VOID PendDisable()
Definition: devicemgmt.cpp:642
VOID PendReset()
Definition: devicemgmt.cpp:636
NTSTATUS OnHcdResetDone(_In_ PIRP Irp, _In_ PUSBDEVICE_RESET Reset)
Definition: devicemgmt.cpp:730
VOID HandleHubDisable(_In_ WDFREQUEST Request, _In_ BOOLEAN AfterReset)
Definition: devicemgmt.cpp:532
VOID HandleHubPurgeIo(_In_ WDFREQUEST Request, _In_ BOOLEAN OnSuspend)
Definition: devicemgmt.cpp:409
ULONG m_Type
Definition: devobj.h:219
LONG m_PendingOperationCount
Definition: devobj.h:255
UcxUsbDevice * m_ParentHub
Definition: devobj.h:217
PLIST_ENTRY Entry
Definition: devhcd.cpp:1262
static VOID NTAPI UcxParkDuringReset(_In_ UcxUsbDevice *Device, _In_ WDFREQUEST Request)
Definition: devicemgmt.cpp:624
static VOID NTAPI UcxResumeIrpCompletion(_In_ PIRP Irp, _In_ NTSTATUS Status)
Definition: devicemgmt.cpp:662
static UcxUsbDevice *NTAPI UcxDeviceFromManagementRequest(_In_ WDFREQUEST Request, _In_ ULONG IoControlCode)
Definition: devicemgmt.cpp:23
static VOID NTAPI UcxTreePurgeVisitor(_In_ UcxUsbDevice *Device, _In_opt_ PVOID Context)
Definition: devicemgmt.cpp:444
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL UcxEvtTreePurgeIoInternalDeviceControl
Definition: devobj.h:362
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL UcxEvtDeviceMgmtIoInternalDeviceControl
Definition: devobj.h:361
#define UCX_DEVICE_TYPE_HUB
Definition: devobj.h:11
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL UcxEvtPendDuringResetIoInternalDeviceControl
Definition: devobj.h:363
KEVENT Done
Definition: devreq.cpp:1162
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
Definition: dispmprt.h:1287
#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 InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
EpEvent
Definition: epsm.h:15
@ Pending
Definition: fs_rec.h:186
Status
Definition: gdiplustypes.h:24
_In_ UCXUSBDEVICE UsbDevice
Definition: hostctl.h:31
#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_DEVICE_TREE_PURGE_IO
Definition: hubucx.h:67
#define IOCTL_UCXHUB_DEVICE_START_IO
Definition: hubucx.h:60
#define IOCTL_UCXHUB_ENDPOINT_RESET
Definition: hubucx.h:63
#define IOCTL_UCXHUB_DEVICE_UPDATE
Definition: hubucx.h:56
#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_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_ PIRP Irp
Definition: kse.h:79
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
static LRESULT Configure(const CodecInfo *pi, HWND hWnd)
Definition: msrle32.c:1192
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define IoCompleteRequest
Definition: irp.c:1272
long LONG
Definition: pedump.c:60
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PFN_UCX_DEFAULT_ENDPOINT_UPDATE DefaultEndpointUpdate
Definition: pipe.h:85
PVOID Arg1
Definition: ucxutil.h:103
UCX_USBDEVICE_EVENT_CALLBACKS Public
Definition: devobj.h:17
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
PFN_UCX_USBDEVICE_ADDRESS EvtUsbDeviceAddress
Definition: ucxusbdevice.h:350
PFN_UCX_USBDEVICE_DISABLE EvtUsbDeviceDisable
Definition: ucxusbdevice.h:348
PFN_UCX_USBDEVICE_ENDPOINTS_CONFIGURE EvtUsbDeviceEndpointsConfigure
Definition: ucxusbdevice.h:346
PFN_UCX_USBDEVICE_ENABLE EvtUsbDeviceEnable
Definition: ucxusbdevice.h:347
PFN_UCX_USBDEVICE_UPDATE EvtUsbDeviceUpdate
Definition: ucxusbdevice.h:351
PFN_UCX_USBDEVICE_SUSPEND EvtUsbDeviceSuspend
Definition: ucxusbdevice.h:355
PFN_UCX_USBDEVICE_RESUME EvtUsbDeviceResume
Definition: ucxusbdevice.h:356
PFN_UCX_USBDEVICE_HUB_INFO EvtUsbDeviceHubInfo
Definition: ucxusbdevice.h:352
PFN_UCX_USBDEVICE_RESET EvtUsbDeviceReset
Definition: ucxusbdevice.h:349
Definition: usb.h:565
struct _LIST_ENTRY * PLIST_ENTRY
#define NTAPI
Definition: typedefs.h:36
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
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
_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
struct _ENDPOINTS_CONFIGURE * PENDPOINTS_CONFIGURE
struct _USBDEVICE_DISABLE * PUSBDEVICE_DISABLE
struct _USBDEVICE_RESET * PUSBDEVICE_RESET
struct _USBDEVICE_UPDATE * PUSBDEVICE_UPDATE
FORCEINLINE VOID NTAPI UcxClearListEntry(_Out_ PLIST_ENTRY Entry)
Definition: ucxutil.h:84
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
struct _URB * PURB
#define URB_FUNCTION_OPEN_STATIC_STREAMS
Definition: usb.h:152
#define URB_FUNCTION_CLOSE_STATIC_STREAMS
Definition: usb.h:153
_In_opt_ PUSB_CONFIGURATION_DESCRIPTOR _Inout_ PUSBD_INTERFACE_LIST_ENTRY _Outptr_ PURB * Urb
Definition: usbdlib.h:333
#define IOCTL_INTERNAL_USB_SUBMIT_URB
Definition: usbioctl.h:32
USHORT Count
Definition: userreq.cpp:200
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2231
#define WdfObjectReference(Handle)
Definition: wdfobject.h:803
#define WdfObjectDereference(Handle)
Definition: wdfobject.h:826
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define NT_ASSERT
Definition: rtlfuncs.h:3334