#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 501 of file fdo.c.
504{
508
509
510
511
514
515
516
517
521 if (!DeviceRelations)
522 {
523
524
525
526 *OutRelations =
NULL;
528 }
529
530
531
532
534 {
535
536
537
539
540
541
542
544 }
545
546
547
548
550
551
552
553
554 *OutRelations = DeviceRelations;
556}
#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 559 of file fdo.c.
562{
567
568
569
570
573
574
575
576
578
579
580
581
583 {
584
585
586
589 }
590
592 {
593
594
595
598 {
599
600
601
602 DPRINT1(
"[HIDCLASS] HidClassPDO_CreatePDO failed with %x\n",
Status);
606 }
607
608
609
611 }
612
613
614
615
617
618
619
622
623
624
625
628}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define NT_SUCCESS(StatCode)
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 IoCompleteRequest
HID_DEVICE_EXTENSION HidDeviceExtension
PDEVICE_OBJECT NextDeviceObject
union _IO_STACK_LOCATION::@1581 Parameters
struct _IO_STACK_LOCATION::@3980::@4005 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(), 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}
#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()
◆ 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::@1581::@1582 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 631 of file fdo.c.
634{
638
639
640
641
644
645
646
647
650 {
652 {
654 }
656 {
658 }
660 {
662 }
667 {
668
669
670
672 }
673 default:
674 {
675
676
677
681 }
682 }
683}
NTSTATUS HidClassFDO_RemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS HidClassFDO_DispatchRequest(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 IoCopyCurrentIrpStackLocationToNext(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::@3980::@4007 DeviceCapabilities
#define RtlZeroMemory(Destination, Length)
#define IRP_MN_QUERY_CAPABILITIES
Referenced by HidClassFDO_StartDevice().
◆ HidClassFDO_QueryCapabilitiesCompletionRoutine()
◆ HidClassFDO_RemoveDevice()
Definition at line 464 of file fdo.c.
467{
470
471
472
473
476
477
478
479
480
481
484
485
486
487
490
491
492
493
496
498}
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{
399
400
401
402
405
406
407
408
411 {
412 DPRINT1(
"[HIDCLASS] Failed to retrieve capabilities %x\n",
Status);
416 }
417
418
419
420
424 {
425 DPRINT1(
"[HIDCLASS] Failed to start lower device with %x\n",
Status);
429 }
430
431
432
433
436 {
437 DPRINT1(
"[HIDCLASS] Failed to retrieve the descriptors %x\n",
Status);
441 }
442
443
444
445
448 {
449 DPRINT1(
"[HIDCLASS] Failed to retrieve the collection description %x\n",
Status);
453 }
454
455
456
457
461}
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)
HIDP_DEVICE_DESC DeviceDescription
DEVICE_CAPABILITIES Capabilities
Referenced by HidClassFDO_PnP().