#include "precomp.h"
#include <debug.h>
Go to the source code of this file.
|
| NTSTATUS NTAPI | HidClassFDO_QueryCapabilitiesCompletionRoutine (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) |
| |
| NTSTATUS | HidClassFDO_QueryCapabilities (IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_CAPABILITIES Capabilities) |
| |
| NTSTATUS NTAPI | HidClassFDO_DispatchRequestSynchronousCompletion (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) |
| |
| NTSTATUS | HidClassFDO_DispatchRequestSynchronous (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
| NTSTATUS | HidClassFDO_DispatchRequest (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
| NTSTATUS | HidClassFDO_GetDescriptors (IN PDEVICE_OBJECT DeviceObject) |
| |
| NTSTATUS | HidClassFDO_StartDevice (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
| NTSTATUS | HidClassFDO_RemoveDevice (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
| NTSTATUS | HidClassFDO_CopyDeviceRelations (IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *OutRelations) |
| |
| NTSTATUS | HidClassFDO_DeviceRelations (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
| NTSTATUS | HidClassFDO_PnP (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) |
| |
◆ NDEBUG
Definition at line 13 of file fdo.c.
◆ HidClassFDO_CopyDeviceRelations()
Definition at line 518 of file fdo.c.
521{
525
526
527
528
531
532
533
534
538 if (!DeviceRelations)
539 {
540
541
542
543 *OutRelations =
NULL;
545 }
546
547
548
549
551 {
552
553
554
556
557
558
559
561 }
562
563
564
565
567
568
569
570
571 *OutRelations = DeviceRelations;
573}
#define ExAllocatePoolWithTag(hernya, size, tag)
PDEVICE_RELATIONS DeviceRelations
HIDCLASS_COMMON_DEVICE_EXTENSION Common
PDEVICE_OBJECT Objects[1]
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
#define ObReferenceObject
Referenced by HidClassFDO_DeviceRelations().
◆ HidClassFDO_DeviceRelations()
Definition at line 576 of file fdo.c.
579{
584
585
586
587
590
591
592
593
595
596
597
598
600 {
601
602
603
606 }
607
609 {
610
611
612
615 {
616
617
618
619 DPRINT1(
"[HIDCLASS] HidClassPDO_CreatePDO failed with %x\n",
Status);
623 }
624
625
626
628 }
629
630
631
632
634
635
636
639
641 {
642
643
644
647 }
648 else
649 {
650
651
652
655 }
656}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define NT_SUCCESS(StatCode)
NTSTATUS HidClassFDO_DispatchRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS HidClassFDO_CopyDeviceRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *OutRelations)
NTSTATUS HidClassPDO_CreatePDO(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *OutDeviceRelations)
#define IoSkipCurrentIrpStackLocation(Irp)
#define IoCopyCurrentIrpStackLocationToNext(Irp)
#define IoCompleteRequest
HID_DEVICE_EXTENSION HidDeviceExtension
PDEVICE_OBJECT NextDeviceObject
union _IO_STACK_LOCATION::@1823 Parameters
struct _IO_STACK_LOCATION::@5134::@5159 QueryDeviceRelations
Referenced by HidClassFDO_PnP().
◆ HidClassFDO_DispatchRequest()
Definition at line 217 of file fdo.c.
220{
224
225
226
227
229
231
232
233
234
236
237
238
239
241
242
243
244
246
247
248
249
251
252
253
254
256
257
258
259
261}
PHIDCLASS_DRIVER_EXTENSION DriverExtension
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
PDEVICE_OBJECT DeviceObject
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Referenced by HidClass_Power(), HidClassFDO_DeviceRelations(), and HidClassFDO_PnP().
◆ HidClassFDO_DispatchRequestSynchronous()
Definition at line 147 of file fdo.c.
150{
155
156
157
158
160
161
162
163
165
166
167
168
170
172
173
174
176
177
178
179
181
182
183
184
186
187
188
189
191
192
193
194
196
197
198
199
201 {
203
204
205
206
208 }
209
210
211
212
214}
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
NTSTATUS NTAPI HidClassFDO_DispatchRequestSynchronousCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Referenced by HidClassFDO_GetDescriptors(), HidClassFDO_RemoveDevice(), HidClassFDO_StartDevice(), HidClassPDO_HandleQueryDeviceId(), and HidClassPDO_HandleQueryHardwareId().
◆ HidClassFDO_DispatchRequestSynchronousCompletion()
Definition at line 129 of file fdo.c.
133{
134
135
136
138
139
140
141
143}
#define KeSetEvent(pEvt, foo, foo2)
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
#define STATUS_MORE_PROCESSING_REQUIRED
Referenced by HidClassFDO_DispatchRequestSynchronous().
◆ HidClassFDO_GetDescriptors()
Definition at line 264 of file fdo.c.
266{
271
272
273
274
277
278
279
280
283 {
284
285
286
288 }
289
290
291
292
294
295
296
297
304
305
306
307
310 {
311
312
313
314 DPRINT1(
"[HIDCLASS] IOCTL_HID_GET_DEVICE_DESCRIPTOR failed with %x\n",
Status);
317 }
318
319
320
321
325
326
327
328
331 {
332
333
334
335 DPRINT1(
"[HIDCLASS] IOCTL_HID_GET_DEVICE_ATTRIBUTES failed with %x\n",
Status);
338 }
339
340
341
342
347
348
349
350
355 {
356
357
358
361 }
362
363
364
365
369
370
371
372
375 {
376
377
378
379 DPRINT1(
"[HIDCLASS] IOCTL_HID_GET_REPORT_DESCRIPTOR failed with %x\n",
Status);
382 }
383
384
385
386
389}
NTSTATUS HidClassFDO_DispatchRequestSynchronous(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IOCTL_HID_GET_DEVICE_DESCRIPTOR
#define IOCTL_HID_GET_DEVICE_ATTRIBUTES
#define HID_REPORT_DESCRIPTOR_TYPE
struct _HID_DEVICE_ATTRIBUTES HID_DEVICE_ATTRIBUTES
#define IOCTL_HID_GET_REPORT_DESCRIPTOR
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
HID_DEVICE_ATTRIBUTES Attributes
HID_DESCRIPTOR HidDescriptor
struct _HID_DESCRIPTOR::_HID_DESCRIPTOR_DESC_LIST DescriptorList[1]
struct _IO_STACK_LOCATION::@1823::@1824 DeviceIoControl
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
Referenced by HidClassFDO_StartDevice().
◆ HidClassFDO_PnP()
Definition at line 659 of file fdo.c.
662{
666
667
668
669
672
673
674
675
678 {
680 {
682 }
684 {
686 }
688 {
690 }
695 {
696
697
698
700 }
701 default:
702 {
703
704
705
709 }
710 }
711}
NTSTATUS HidClassFDO_RemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS HidClassFDO_StartDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS HidClassFDO_DeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_QUERY_REMOVE_DEVICE
Referenced by HidClass_PnP().
◆ HidClassFDO_QueryCapabilities()
Definition at line 35 of file fdo.c.
38{
44
45
46
47
50
51
52
53
55
56
57
58
61 {
62
63
64
66 }
67
68
69
70
72
73
74
75
79
80
81
82
84
85
86
87
93
94
95
96
98
99
100
101
104 {
105
106
107
109 }
110
111
112
113
115
116
117
118
120
121
122
123
125}
#define STATUS_NOT_SUPPORTED
NTSTATUS NTAPI HidClassFDO_QueryCapabilitiesCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
struct _IO_STACK_LOCATION::@5134::@5161 DeviceCapabilities
#define RtlZeroMemory(Destination, Length)
#define IRP_MN_QUERY_CAPABILITIES
Referenced by HidClassFDO_StartDevice().
◆ HidClassFDO_QueryCapabilitiesCompletionRoutine()
◆ HidClassFDO_RemoveDevice()
Definition at line 481 of file fdo.c.
484{
487
488
489
490
493
494
495
496
497
498
501
502
503
504
507
508
509
510
513
515}
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Referenced by HidClassFDO_PnP().
◆ HidClassFDO_StartDevice()
Definition at line 393 of file fdo.c.
396{
400
401
402
403
406
407
408
409
412 {
413 DPRINT1(
"[HIDCLASS] Failed to retrieve capabilities %x\n",
Status);
417 }
418
419
420
421
425 {
426 DPRINT1(
"[HIDCLASS] Failed to start lower device with %x\n",
Status);
430 }
431
432
433
434
437 {
438 DPRINT1(
"[HIDCLASS] Failed to retrieve the descriptors %x\n",
Status);
442 }
443
444
445
446
449 {
450 DPRINT1(
"[HIDCLASS] Failed to retrieve the collection description %x\n",
Status);
454 }
455
456
457
458
461 {
465 }
467 {
468
470 }
471
472
473
474
478}
NTSTATUS HidClassFDO_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS HidClassFDO_QueryCapabilities(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_CAPABILITIES Capabilities)
NTSTATUS NTAPI HidP_GetCollectionDescription(IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, OUT PHIDP_DEVICE_DESC DeviceDescription)
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG _In_ PHIDP_PREPARSED_DATA _In_ ULONG ReportLength
HIDP_DEVICE_DESC DeviceDescription
DEVICE_CAPABILITIES Capabilities
PHIDP_COLLECTION_DESC CollectionDesc
ULONG CollectionDescLength
PHIDP_REPORT_IDS ReportIDs
Referenced by HidClassFDO_PnP().