ReactOS 0.4.15-dev-7906-g1b85a5f
fxdeviceinitapi.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxDeviceInitApi.cpp
8
9Abstract:
10
11 This module exposes the "C" interface to the FxDevice object.
12
13Author:
14
15
16
17Environment:
18
19 Both kernel and user mode
20
21Revision History:
22
23--*/
24
25#include "coreprivshared.hpp"
26
27extern "C" {
28// #include "FxDeviceInitApi.tmh"
29}
30
32 //
33 // Size of this structure in bytes
34 //
35 ULONG Size;
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
71
73 //
74 // Size of this structure in bytes
75 //
76 ULONG Size;
77
79
81
83
85
87
89
91
92typedef struct _WDF_PDO_EVENT_CALLBACKS_V1_9 {
93 //
94 // The size of this structure in bytes
95 //
96 ULONG Size;
97
98 //
99 // Called in response to IRP_MN_QUERY_RESOURCES
100 //
102
103 //
104 // Called in response to IRP_MN_QUERY_RESOURCE_REQUIREMENTS
105 //
107
108 //
109 // Called in response to IRP_MN_EJECT
110 //
112
113 //
114 // Called in response to IRP_MN_SET_LOCK
115 //
117
118 //
119 // Called in response to the power policy owner sending a wait wake to the
120 // PDO. Bus generic arming shoulding occur here.
121 //
123
124 //
125 // Called in response to the power policy owner sending a wait wake to the
126 // PDO. Bus generic disarming shoulding occur here.
127 //
129
131
132
133//
134// Extern "C" the entire file
135//
136extern "C" {
137
139VOID
141WDFEXPORT(WdfDeviceInitFree)(
142 __in
144 __in
146 )
147{
148 DDI_ENTRY();
149
151
152 if (DeviceInit->CreatedOnStack == FALSE) {
153 delete DeviceInit;
154 }
155}
156
158VOID
160WDFEXPORT(WdfDeviceInitSetIoType)(
161 __in
163 __in
165 __in
167 )
168{
169 DDI_ENTRY();
170
172
174
177
179}
180
182WDFAPI
183VOID
185WDFEXPORT(WdfDeviceInitSetIoTypeEx)(
186 _In_
188 _In_
190 _In_
192 )
193{
194 DDI_ENTRY();
195
198
200
202
203 if (IoTypeConfig->Size != sizeof(WDF_IO_TYPE_CONFIG)) {
206 "IoTypeConfig size (%d) incorrect, expected %d, %!STATUS!",
207 IoTypeConfig->Size,
208 sizeof(WDF_IO_TYPE_CONFIG), status);
209 return;
210 }
211
212 DeviceInit->AssignIoType(IoTypeConfig);
213}
214
216VOID
218WDFEXPORT(WdfDeviceInitSetExclusive)(
219 __in
221 __in
223 __in
225 )
226{
227 DDI_ENTRY();
228
230
231 DeviceInit->Exclusive = Exclusive;
232}
233
235VOID
237WDFEXPORT(WdfDeviceInitSetDeviceType)(
238 __in
240 __in
242 __in
244 )
245{
246 DDI_ENTRY();
247
249
250 DeviceInit->DeviceType = DeviceType;
251}
252
254VOID
256WDFEXPORT(WdfDeviceInitSetPowerNotPageable)(
257 __in
259 __in
261 )
262{
263 DDI_ENTRY();
264
266
267 DeviceInit->PowerPageable = FALSE;
268}
269
271VOID
273WDFEXPORT(WdfDeviceInitSetPowerPageable)(
274 __in
276 __in
278 )
279{
280 DDI_ENTRY();
281
283
284 DeviceInit->PowerPageable = TRUE;
285}
286
288VOID
290WDFEXPORT(WdfDeviceInitSetPowerInrush)(
291 __in
293 __in
295 )
296{
297 DDI_ENTRY();
298
300
301 //
302 // If you are inrush, there is no way you can be power pageable
303 //
304 DeviceInit->Inrush = TRUE;
305 DeviceInit->PowerPageable = FALSE;
306}
307
312WDFEXPORT(WdfDeviceInitAssignName)(
313 __in
315 __in
319 )
320{
321 DDI_ENTRY();
322
324
326
330 return status;
331 }
332
333 if (DeviceName != NULL) {
335 DeviceName);
336 if (!NT_SUCCESS(status)) {
337 return status;
338 }
339 }
340
341 if (DeviceName == NULL) {
342 if (DeviceInit->DeviceName != NULL) {
343 DeviceInit->DeviceName->RELEASE(NULL);
344 DeviceInit->DeviceName = NULL;
345 }
346
347 if (DeviceInit->IsPdoInit()) {
348 //
349 // Make sure a PDO has a name
350 //
351 DeviceInit->Characteristics |= FILE_AUTOGENERATED_DEVICE_NAME;
352 }
353
354 return STATUS_SUCCESS;
355 }
356
357 return DeviceInit->AssignName(DeviceInit->DriverGlobals, DeviceName);
358
359}
360
362VOID
364WDFEXPORT(WdfDeviceInitSetCharacteristics)(
365 __in
367 __in
369 __in
371 __in
373 )
374{
375 DDI_ENTRY();
376
378
381 }
382 else {
384 }
385
386 //
387 // If the autogenerate flag is on, clear out the device name
388 //
390 DeviceInit->DeviceName != NULL) {
391 DeviceInit->DeviceName->RELEASE(NULL);
392 DeviceInit->DeviceName = NULL;
393 }
394}
395
397VOID
399WDFEXPORT(WdfDeviceInitSetFileObjectConfig)(
400 __in
402 __in
404 __in
408 )
409
410/*++
411
412Routine Description:
413
414 Registers callbacks for file object support.
415
416 Defaults to WdfDeviceFileObjectNoFsContext.
417
418Arguments:
419
420Returns:
421
422--*/
423
424{
425 DDI_ENTRY();
426
431
433 pFxDriverGlobals = DeviceInit->DriverGlobals;
434
436
440 "Invalid FileObjectConfig Size %d, expected %d",
442
444 return;
445 }
446
453 );
454
455 if (!NT_SUCCESS(status)) {
457 return;
458 }
459
460 //
461 // Validate AutoForwardCleanupClose
462 //
463 switch (FileObjectConfig->AutoForwardCleanupClose) {
464 case WdfTrue:
465 case WdfFalse:
466 case WdfUseDefault:
467 break;
468
469 default:
472 "Invalid FileObjectConfig->AutoForwardCleanupClose value 0x%x, "
473 "expected WDF_TRI_STATE value", FileObjectConfig->AutoForwardCleanupClose);
474
476 return;
477 }
478
479 DeviceInit->FileObject.Set = TRUE;
480
481 DeviceInit->FileObject.AutoForwardCleanupClose =
482 FileObjectConfig->AutoForwardCleanupClose;
483
484 fileClass = FileObjectConfig->FileObjectClass;
485
486 //
487 // Remove bit flags and validate file object class value.
488 //
490
495 "Out of range FileObjectConfig->FileObjectClass %d",
496 fileClass);
498 return;
499 }
500
501 //
502 // UMDF doesn't support storing object handle at FsContext or FxContxt2.
503 // Update the class to WdfFileObjectWdfCannotUseFsContexts for UMDF.
504 //
508
509 //
510 // update the FileObjectClass value
511 //
512 BOOLEAN canBeOptional =
514
516 if (canBeOptional) {
519 }
520
523 "FileObjectConfig->FileObjectClass value (%d) has been updated"
524 " to a UMDF-supported value %d", normalizedFileClass,
526
527 //
528 // re-obtain the normalized class
529 //
531 }
532
533 //
534 // The optional flag can only be combined with a subset of values.
535 //
537 switch(normalizedFileClass) {
541 break;
542
543 default:
546 "Invalid FileObjectConfig->FileObjectClass %d",
547 fileClass);
549 return;
550 break; // just in case static verification tools complain.
551 }
552 }
553
554 DeviceInit->FileObject.Class = fileClass;
555
556 RtlCopyMemory(&DeviceInit->FileObject.Callbacks,
558 sizeof(DeviceInit->FileObject.Callbacks));
559
561 RtlCopyMemory(&DeviceInit->FileObject.Attributes,
563 sizeof(DeviceInit->FileObject.Attributes));
564 }
565}
566
568VOID
570WDFEXPORT(WdfDeviceInitSetRequestAttributes)(
571 __in
573 __in
575 __in
577 )
578{
579 DDI_ENTRY();
580
583
585 pFxDriverGlobals = DeviceInit->DriverGlobals;
586
588
589 //
590 // Parent of all requests created from WDFDEVICE are parented by the
591 // WDFDEVICE.
592 //
596
597 if (!NT_SUCCESS(status)) {
599 return;
600 }
601
602 RtlCopyMemory(&DeviceInit->RequestAttributes,
604 sizeof(WDF_OBJECT_ATTRIBUTES));
605}
606
611WDFEXPORT(WdfDeviceInitAssignSDDLString)(
612 __in
614 __in
618 )
619{
620 DDI_ENTRY();
621
624
626 pFxDriverGlobals = DeviceInit->DriverGlobals;
627
629 if (!NT_SUCCESS(status)) {
630 return status;
631 }
632
633 if (SDDLString == NULL) {
634 //
635 // Since we require the SDDL on control device creation, you can't
636 // clear it!
637 //
638 if (DeviceInit->IsControlDeviceInit()) {
640 }
641
642 if (DeviceInit->Security.Sddl != NULL) {
643 DeviceInit->Security.Sddl->RELEASE(NULL);
644 DeviceInit->Security.Sddl = NULL;
645 }
646
647 return STATUS_SUCCESS;
648 }
649
651 if (!NT_SUCCESS(status)) {
652 return status;
653 }
654
655 if (DeviceInit->Security.Sddl == NULL) {
656 DeviceInit->Security.Sddl = new(pFxDriverGlobals,
659
660 if (DeviceInit->Security.Sddl == NULL) {
663 "Couldn't create Security descriptor"
664 " STATUS_INSUFFICIENT_RESOURCES ");
665
667 }
668 }
669
670 return DeviceInit->Security.Sddl->Assign(SDDLString);
671}
672
674VOID
676WDFEXPORT(WdfDeviceInitSetDeviceClass)(
677 __in
679 __in
681 __in
683 )
684{
685 DDI_ENTRY();
686
688
690 pFxDriverGlobals = DeviceInit->DriverGlobals;
691
693
694 DeviceInit->Security.DeviceClassSet = TRUE;
695 RtlCopyMemory(&DeviceInit->Security.DeviceClass,
697 sizeof(GUID));
698}
699
701VOID
703WDFEXPORT(WdfDeviceInitSetPnpPowerEventCallbacks)(
704 __in
706 __in
708 __in
710 )
711{
712 DDI_ENTRY();
713
715
717 pFxDriverGlobals = DeviceInit->DriverGlobals;
718
720
723
726 "PnpPowerEventCallbacks size %d is invalid, exptected %d",
728 );
729
731
732 return;
733 }
734
735 //
736 // Make sure only one of the callbacks EvtDeviceUsageNotification or
737 // EvtDeviceUsageNotificationEx is provided by driver for >V1.9.
738 //
740 PnpPowerEventCallbacks->EvtDeviceUsageNotification != NULL &&
741 PnpPowerEventCallbacks->EvtDeviceUsageNotificationEx != NULL) {
742
745 "Driver can provide either EvtDeviceUsageNotification or "
746 "EvtDeviceUsageNotificationEx callback but not both");
747
749
750 return;
751 }
752
753 //
754 // Driver's PnpPowerEventCallbacks structure may be from a previous
755 // version and therefore may be different in size than the current version
756 // that framework is using. Therefore, copy only PnpPowerEventCallbacks->Size
757 // bytes and not sizeof(PnpPowerEventCallbacks) bytes.
758 //
759 RtlCopyMemory(&DeviceInit->PnpPower.PnpPowerEventCallbacks,
762}
763
765VOID
767WDFEXPORT(WdfDeviceInitSetPowerPolicyEventCallbacks)(
768 __in
770 __in
772 __in
774 )
775{
776 DDI_ENTRY();
777
779
781 pFxDriverGlobals = DeviceInit->DriverGlobals;
782
784
785 //
786 // The WDF_POWER_POLICY_EVENT_CALLBACKS structure size increased after v1.5.
787 // Since this api is backwards compatible, it can accept either the current
788 // structure or the older version. Validate the size of the structure here
789 // so that it is one of the two supported sizes.
790 //
795 "PowerPolicyEventCallbacks size %d is invalid, expected %d",
797 );
798
800 return;
801 }
802
803 //
804 // Only one of EvtDeviceArmWakeFromSx and EvtDeviceArmWakeFromSxWithReason
805 // callbacks should be specified if the given power policy callbacks structure
806 // is from a version after v1.5
807 //
809 PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSx != NULL &&
810 PowerPolicyEventCallbacks->EvtDeviceArmWakeFromSxWithReason != NULL) {
813 "PowerPolicyEventCallbacks can have either EvtDeviceArmWakeFromSx "
814 "or EvtDeviceArmWakeFromSxWithReason callback pointer, but not both"
815 );
816
818 return;
819 }
820
821 RtlCopyMemory(&DeviceInit->PnpPower.PolicyEventCallbacks,
824}
825
827VOID
829WDFEXPORT(WdfDeviceInitSetPowerPolicyOwnership)(
830 __in
832 __in
834 __in
836 )
837{
838 DDI_ENTRY();
839
841
842 DeviceInit->PnpPower.PowerPolicyOwner = IsPowerPolicyOwner ? WdfTrue : WdfFalse;
843}
844
849WDFEXPORT(WdfDeviceInitRegisterPnpStateChangeCallback)(
850 __in
852 __in
854 __in
856 __in
858 __in
860 )
861{
862 DDI_ENTRY();
863
868
870 pFxDriverGlobals = DeviceInit->DriverGlobals;
871
873
875
877 if (!NT_SUCCESS(status)) {
878 return status;
879 }
880
881 if (normalizedState < WdfDevStatePnpObjectCreated || normalizedState > WdfDevStatePnpNull) {
883
885 "Pnp State is invalid %!STATUS!", status);
886
887 return status;
888 }
889
891 CallbackTypes == 0x0) {
893
895 "CallbackTypes is invalid %!STATUS!", status);
896
897 return status;
898 }
899
900 if (DeviceInit->PnpPower.PnpStateCallbacks == NULL) {
901
902 DeviceInit->PnpPower.PnpStateCallbacks =
904
905 if (DeviceInit->PnpPower.PnpStateCallbacks == NULL) {
907
910 "Couldn't create object PnpStateCallbacks %!STATUS!", status);
911
912 return status;
913 }
914 }
915
916 pCallback = &DeviceInit->PnpPower.PnpStateCallbacks->m_Methods[
918
921
923}
924
929WDFEXPORT(WdfDeviceInitRegisterPowerStateChangeCallback)(
930 __in
932 __in
934 __in
936 __in
938 __in
940 )
941{
942 DDI_ENTRY();
943
948
950 pFxDriverGlobals = DeviceInit->DriverGlobals;
951
953
955
957 if (!NT_SUCCESS(status)) {
958 return status;
959 }
960
964
966 "PowerState State is invalid %!STATUS!", status);
967
968 return status;
969 }
970
972 CallbackTypes == 0x0) {
974
976 "CallbackTypes is invalid %!STATUS!"
977 "STATUS_INVALID_PARAMETER", status);
978
979 return status;
980 }
981
982 if (DeviceInit->PnpPower.PowerStateCallbacks == NULL) {
983 DeviceInit->PnpPower.PowerStateCallbacks =
985
986 if (DeviceInit->PnpPower.PowerStateCallbacks == NULL) {
988
991 "Couldn't create object PowerStateCallbacks %!STATUS!", status);
992
993 return status;
994 }
995 }
996
997 pCallback = &DeviceInit->PnpPower.PowerStateCallbacks->m_Methods[
999
1002
1003 return STATUS_SUCCESS;
1004}
1005
1009STDCALL
1010WDFEXPORT(WdfDeviceInitRegisterPowerPolicyStateChangeCallback)(
1011 __in
1013 __in
1015 __in
1017 __in
1019 __in
1021 )
1022{
1023 DDI_ENTRY();
1024
1029
1031 pFxDriverGlobals = DeviceInit->DriverGlobals;
1032
1034
1036
1038 if (!NT_SUCCESS(status)) {
1039 return status;
1040 }
1041
1045
1048 "PowerPolicyState State is invalid %!STATUS!", status);
1049
1050 return status;
1051 }
1052
1054 CallbackTypes == 0x0) {
1056
1058 "CallbackTypes is invalid %!STATUS!", status);
1059
1060 return status;
1061 }
1062
1063 if (DeviceInit->PnpPower.PowerPolicyStateCallbacks == NULL) {
1064 DeviceInit->PnpPower.PowerPolicyStateCallbacks =
1066
1067 if (DeviceInit->PnpPower.PowerPolicyStateCallbacks == NULL) {
1069
1072 "Couldn't create object PowerPolicyStateCallbacks %!STATUS!", status);
1073
1074 return status;
1075 }
1076 }
1077
1078 pCallback = &DeviceInit->PnpPower.PowerPolicyStateCallbacks->m_Methods[
1080
1083
1084 return STATUS_SUCCESS;
1085}
1086
1089WDFAPI
1091STDCALL
1092WDFEXPORT(WdfDeviceInitAssignWdmIrpPreprocessCallback)(
1093 __in
1095 __in
1097 __in
1099 __in
1104 __in
1106 )
1107{
1108 DDI_ENTRY();
1109
1111
1113 pFxDriverGlobals = DeviceInit->DriverGlobals;
1114
1116
1119 }
1120
1121 //
1122 // ARRAY_SIZE(DeviceInit->PreprocessInfo->Dispatch) just returns a constant
1123 // size, it does not actually deref PreprocessInfo (which could be NULL)
1124 //
1125 if (MajorFunction >= ARRAY_SIZE(DeviceInit->PreprocessInfo->Dispatch)) {
1127 "MajorFunction is invalid"
1128 "STATUS_INVALID_PARAMETER"
1129 );
1130
1132 }
1133
1134 if (DeviceInit->PreprocessInfo == NULL) {
1135 DeviceInit->PreprocessInfo = new(pFxDriverGlobals) FxIrpPreprocessInfo();
1136
1137 if (DeviceInit->PreprocessInfo == NULL) {
1139 "Couldn't create object PreprocessInfo"
1140 "STATUS_INSUFFICIENT_RESOURCES"
1141 );
1142
1143
1145 }
1146 }
1147
1148 if (NumMinorFunctions > 0) {
1149 if (DeviceInit->PreprocessInfo->Dispatch[MajorFunction].NumMinorFunctions != 0) {
1150
1152 "Already assigned Minorfunctions"
1153 "STATUS_INVALID_DEVICE_REQUEST"
1154 );
1156 }
1157
1158 DeviceInit->PreprocessInfo->Dispatch[MajorFunction].MinorFunctions =
1159 (PUCHAR) FxPoolAllocate(pFxDriverGlobals,
1161 sizeof(UCHAR) * NumMinorFunctions);
1162
1163 if (DeviceInit->PreprocessInfo->Dispatch[MajorFunction].MinorFunctions == NULL) {
1164
1166 "Couldn't create object MinorFunctions"
1167 "STATUS_INSUFFICIENT_RESOURCES"
1168 );
1169
1171 }
1172
1174 &DeviceInit->PreprocessInfo->Dispatch[MajorFunction].MinorFunctions[0],
1175 &MinorFunctions[0],
1177 );
1178
1179 DeviceInit->PreprocessInfo->Dispatch[MajorFunction].NumMinorFunctions =
1181 }
1182
1185
1186 return STATUS_SUCCESS;
1187}
1188
1189
1191VOID
1192STDCALL
1193WDFEXPORT(WdfDeviceInitSetIoInCallerContextCallback)(
1194 __in
1196 __in
1198 __in
1200 )
1201
1202/*++
1203
1204Routine Description:
1205
1206 Registers an I/O pre-processing callback for the device.
1207
1208 If registered, any I/O for the device is first presented to this
1209 callback function before being placed in any I/O Queue's.
1210
1211 The callback is invoked in the thread and/or DPC context of the
1212 original WDM caller as presented to the I/O package. No framework
1213 threading, locking, synchronization, or queuing occurs, and
1214 responsibility for synchronization is up to the device driver.
1215
1216 This API is intended to support METHOD_NEITHER IRP_MJ_DEVICE_CONTROL's
1217 which must access the user buffer in the original callers context. The
1218 driver would probe and lock the buffer pages from within this event
1219 handler using the functions supplied on the WDFREQUEST object, storing
1220 any required mapped buffers and/or pointers on the WDFREQUEST context
1221 whose size is set by the RequestContextSize of the WDF_DRIVER_CONFIG structure.
1222
1223 It is the responsibility of this routine to either complete the request, or
1224 pass it on to the I/O package through WdfDeviceEnqueueRequest(Device, Request).
1225
1226Arguments:
1227 DeviceInit - Device initialization structure
1228
1229 EvtIoInCallerContext - Pointer to driver supplied callback function
1230
1231Return Value:
1232
1233--*/
1234{
1235 DDI_ENTRY();
1236
1239
1240 DeviceInit->IoInCallerContextCallback = EvtIoInCallerContext;
1241
1242 return;
1243}
1244
1246VOID
1247STDCALL
1248WDFEXPORT(WdfDeviceInitSetRemoveLockOptions)(
1249 __in
1251 __in
1253 __in
1255 )
1256{
1257 DDI_ENTRY();
1258
1261
1263
1265
1267 //
1268 // Size is wrong, bail out
1269 //
1271 "RemoveLockOptions %p Size incorrect, expected %d, "
1272 "got %d",
1274 RemoveLockOptions->Size);
1275
1277 goto Done;
1278 }
1279
1280 if ((RemoveLockOptions->Flags & ~validFlags) != 0) {
1281 //
1282 // Invalid flag
1283 //
1285 "RemoveLockOptions %p Flags 0x%x invalid, "
1286 "valid mask is 0x%x",
1288 validFlags);
1289
1291 goto Done;
1292 }
1293
1295 //
1296 // At this time this feature is not supported on control-devices.
1297 //
1299 "WdfDeviceInitSetRemoveLockOptions is not "
1300 "supported on control devices");
1301
1303 goto Done;
1304 }
1305
1306 DeviceInit->RemoveLockOptionFlags = RemoveLockOptions->Flags;
1307Done:
1308 return;
1309}
1310
1312VOID
1313STDCALL
1314WDFEXPORT(WdfDeviceInitSetReleaseHardwareOrderOnFailure)(
1315 __in
1317 __in
1319 __in
1321 )
1322{
1323 DDI_ENTRY();
1324
1326
1333 "Out of range WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE %d",
1335 FxVerifierDbgBreakPoint(DeviceInit->DriverGlobals);
1336 return;
1337 }
1338
1339 DeviceInit->ReleaseHardwareOrderOnFailure = ReleaseHardwareOrderOnFailure;
1340}
1341
1343VOID
1344STDCALL
1345WDFEXPORT(WdfDeviceInitAllowSelfIoTarget)(
1346 _In_
1348 _In_
1350 )
1351/*++
1352
1353Routine Description:
1354
1355 A client or Cx calls this API to indicate that it would like to leverage an
1356 Self IO target.
1357
1358 For now the Self targets are not supported for PDOs, Miniport Device,
1359 or non pnp Devices.
1360
1361Arguments:
1362
1363 DeviceInit - Pointer to the WDFDEVICE_INIT structure
1364
1365Returns:
1366
1367 VOID
1368
1369--*/
1370{
1371 DDI_ENTRY();
1372
1374
1375 DeviceInit->RequiresSelfIoTarget = TRUE;
1376}
1377
1378
1379
1380//
1381// BEGIN FDO specific functions
1382//
1383
1386STDCALL
1387WDFEXPORT(WdfFdoInitWdmGetPhysicalDevice)(
1388 __in
1390 __in
1392 )
1393{
1394 DDI_ENTRY();
1395
1397
1398 if (DeviceInit->IsNotFdoInit()) {
1401 "Not a PWDFDEVICE_INIT for an FDO"
1402 );
1403
1404 return NULL;
1405 }
1406
1407 return reinterpret_cast<PDEVICE_OBJECT>(DeviceInit->Fdo.PhysicalDevice);
1408}
1409
1413STDCALL
1414WDFEXPORT(WdfFdoInitOpenRegistryKey)(
1415 __in
1417 __in
1419 __in
1421 __in
1423 __in_opt
1425 __out
1426 WDFKEY* Key
1427 )
1428{
1429 DDI_ENTRY();
1430
1433
1435 pFxDriverGlobals = DeviceInit->DriverGlobals;
1436
1438
1439 *Key = NULL;
1440
1441 if (DeviceInit->IsNotFdoInit()) {
1444 "Not a PWDFDEVICE_INIT for an FDO, %!STATUS!",
1445 status);
1446 return status;
1447 }
1448
1450 if (!NT_SUCCESS(status)) {
1451 return status;
1452 }
1453
1455 DeviceInit,
1456 NULL,
1460 Key);
1461}
1462
1464VOID
1465STDCALL
1466WDFEXPORT(WdfFdoInitSetFilter)(
1467 __in
1469 __in
1471 )
1472{
1473 DDI_ENTRY();
1474
1476
1478 pFxDriverGlobals = DeviceInit->DriverGlobals;
1479
1481 PASSIVE_LEVEL))) {
1482 return;
1483 }
1484 if (DeviceInit->IsNotFdoInit()) {
1487 "Not a PWDFDEVICE_INIT for an FDO");
1488
1490 return;
1491 }
1492
1493 DeviceInit->Fdo.Filter = TRUE;
1494}
1495
1499STDCALL
1500WDFEXPORT(WdfFdoInitQueryProperty)(
1501 __in
1503 __in
1505 __in
1507 __in
1511 __out
1513 )
1514/*++
1515
1516Routine Description:
1517 Retrieves the requested device property for the given device
1518
1519Arguments:
1520 DeviceInit - Device initialization structure
1521
1522 DeviceProperty - the property being queried
1523
1524 BufferLength - length of PropertyBuffer in bytes
1525
1526 PropertyBuffer - Buffer which will receive the property being queried
1527
1528 ResultLength - if STATUS_BUFFER_TOO_SMALL is returned, then this will contain
1529 the required length
1530
1531Return Value:
1532 NTSTATUS
1533
1534 --*/
1535{
1536 DDI_ENTRY();
1537
1540
1542 pFxDriverGlobals = DeviceInit->DriverGlobals;
1543
1545 if (BufferLength > 0) {
1547 }
1548
1550 if (!NT_SUCCESS(status)) {
1551 return status;
1552 }
1553
1554 if (DeviceInit->IsNotFdoInit()) {
1557 "Not a PWDFDEVICE_INIT for an FDO, %!STATUS!",
1558 status);
1559 return status;
1560 }
1561
1563 DeviceInit,
1564 NULL,
1565 NULL,
1569 ResultLength);
1570 return status;
1571}
1572
1576STDCALL
1577WDFEXPORT(WdfFdoInitAllocAndQueryProperty)(
1578 __in
1580 __in
1582 __in
1584 __in
1587 __in_opt
1589 __out
1591 )
1592/*++
1593
1594Routine Description:
1595 Allocates and retrieves the requested device property for the given device init
1596
1597Arguments:
1598 DeviceInit - Device initialization structure
1599
1600 DeviceProperty - the property being queried
1601
1602 PoolType - what type of pool to allocate
1603
1604 PropertyMemoryAttributes - attributes to associate with PropertyMemory
1605
1606 PropertyMemory - handle which will receive the property buffer
1607
1608Return Value:
1609 NTSTATUS
1610
1611 --*/
1612{
1613 DDI_ENTRY();
1614
1617
1619 pFxDriverGlobals = DeviceInit->DriverGlobals;
1620
1622
1624
1626 if (!NT_SUCCESS(status)) {
1627 return status;
1628 }
1629
1631
1633 if (!NT_SUCCESS(status)) {
1634 return status;
1635 }
1636
1637 if (DeviceInit->IsNotFdoInit()) {
1639
1641 "Not a PWDFDEVICE_INIT for an FDO, %!STATUS!",
1642 status);
1643
1644 return status;
1645 }
1646
1648 DeviceInit,
1649 NULL,
1650 NULL,
1652 PoolType,
1655 return status;
1656}
1657
1659VOID
1660STDCALL
1661WDFEXPORT(WdfFdoInitSetEventCallbacks)(
1662 __in
1664 __in
1666 __in
1668 )
1669{
1670 DDI_ENTRY();
1671
1673
1675 pFxDriverGlobals = DeviceInit->DriverGlobals;
1676
1678
1680 return;
1681 }
1682
1683 if (DeviceInit->IsNotFdoInit()) {
1685 "Not a PWDFDEVICE_INIT for an FDO");
1687 return;
1688 }
1689
1693 "FdoEventCallbacks size %d is invalid, expected %d",
1695 );
1697 return;
1698 }
1699
1700 if (FdoEventCallbacks->EvtDeviceFilterAddResourceRequirements != NULL &&
1701 FdoEventCallbacks->EvtDeviceRemoveAddedResources == NULL) {
1702 //
1703 // Not allowed to add resources without filtering them out later
1704 //
1707 "Must set EvtDeviceRemoveAddedResources if "
1708 "EvtDeviceFilterAddResourceRequirements (%p) is set",
1709 FdoEventCallbacks->EvtDeviceFilterAddResourceRequirements);
1710
1712 return;
1713 }
1714
1715 RtlCopyMemory(&DeviceInit->Fdo.EventCallbacks,
1717 sizeof(DeviceInit->Fdo.EventCallbacks));
1718}
1719
1721VOID
1722STDCALL
1723WDFEXPORT(WdfFdoInitSetDefaultChildListConfig)(
1724 __in
1726 __inout
1728 __in
1730 __in_opt
1732 )
1733{
1734 DDI_ENTRY();
1735
1739
1741 pFxDriverGlobals = DeviceInit->DriverGlobals;
1743
1745
1747 if (!NT_SUCCESS(status)) {
1748 return;
1749 }
1750
1751 if (DeviceInit->IsNotFdoInit()) {
1753 "Not a PWDFDEVICE_INIT for an FDO");
1755 return;
1756 }
1757
1759 Config,
1761 if (!NT_SUCCESS(status)) {
1763 return;
1764 }
1765
1770 if (!NT_SUCCESS(status)) {
1772 return;
1773 }
1774
1775 RtlCopyMemory(&DeviceInit->Fdo.ListConfigAttributes,
1777 sizeof(DeviceInit->Fdo.ListConfigAttributes));
1778 }
1779
1780 RtlCopyMemory(&DeviceInit->Fdo.ListConfig,
1781 Config,
1782 sizeof(WDF_CHILD_LIST_CONFIG));
1783}
1784
1787WDFAPI
1789STDCALL
1790WDFEXPORT(WdfFdoInitQueryPropertyEx)(
1791 _In_
1793 _In_
1795 _In_
1797 _In_
1799 _Out_
1801 _Out_
1803 _Out_
1805 )
1806/*++
1807
1808Routine Description:
1809
1810 This routine queries device property.
1811
1812Arguments:
1813
1814 DriverGlobals - DriverGlobals pointer
1815
1816 DeviceInit - WDF DeviceInit structure pointer.
1817
1818 DeviceProperty - A pointer to WDF_DEVICE_PROPERTY_DATA structure.
1819
1820 BufferLength - The size, in bytes, of the buffer that is pointed to by
1821 PropertyBuffer.
1822
1823 PropertyBuffer - A caller-supplied pointer to a caller-allocated buffer that
1824 receives the requested information. The pointer can be NULL
1825 if the BufferLength parameter is zero.
1826
1827 ResultLength - A caller-supplied location that, on return, contains the
1828 size, in bytes, of the information that the method stored in
1829 PropertyBuffer. If the function's return value is
1830 STATUS_BUFFER_TOO_SMALL, this location receives the required
1831 buffer size.
1832
1833 Type - A pointer to a DEVPROPTYPE variable. If method successfully retrieves
1834 the property data, the routine writes the property type value
1835 to this variable. This value indicates the type of property
1836 data that is in the Data buffer.
1837
1838Return Value:
1839
1840 Method returns an NTSTATUS value. This routine might return one of the
1841 following values.
1842
1843 STATUS_BUFFER_TOO_SMALL - The supplied buffer is too small to receive the
1844 information. The ResultLength member receives the
1845 size of buffer required.
1846 STATUS_SUCCESS - The operation succeeded.
1847 STATUS_INVALID_PARAMETER - One of the parameters is incorrect.
1848
1849 The method might return other NTSTATUS values.
1850
1851--*/
1852
1853{
1854 DDI_ENTRY();
1855
1858
1860 pFxDriverGlobals = DeviceInit->DriverGlobals;
1861
1863
1867 "PropertyData size (%d) incorrect, expected %d, %!STATUS!",
1868 DeviceProperty->Size,
1870 return status;
1871 }
1872
1874 if (BufferLength > 0) {
1876 }
1877
1879 if (!NT_SUCCESS(status)) {
1880 return status;
1881 }
1882
1883 if (DeviceInit->IsNotFdoInit()) {
1886 "Not a PWDFDEVICE_INIT for an FDO, %!STATUS!",
1887 status);
1888 return status;
1889 }
1890
1892 DeviceInit,
1893 NULL,
1899 Type);
1900 return status;
1901}
1902
1905WDFAPI
1907STDCALL
1908WDFEXPORT(WdfFdoInitAllocAndQueryPropertyEx)(
1909 _In_
1911 _In_
1913 _In_
1915 _In_
1918 _In_opt_
1920 _Out_
1921 WDFMEMORY* PropertyMemory,
1922 _Out_
1924 )
1925/*++
1926
1927Routine Description:
1928
1929 This routine queries device property.
1930
1931Arguments:
1932
1933 DriverGlobals - DriverGlobals pointer
1934
1935 DeviceInit - WDF DeviceInit pointer.
1936
1937 PropertyData - A pointer to WDF_DEVICE_PROPERTY_ DATA structure.
1938
1939 PoolType - A POOL_TYPE-typed enumerator that specifies the type of memory
1940 to be allocated.
1941
1942 PropertyMemoryAttributes - optional, A pointer to a caller-allocated
1943 WDF_OBJECT_ATTRIBUTES structure that describes object attributes
1944 for the memory object that the function will allocate. This
1945 parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.
1946
1947 PropertyMemory - A pointer to a WDFMEMORY-typed location that receives a
1948 handle to a framework memory object.
1949
1950 Type - A pointer to a DEVPROPTYPE variable. If method successfully retrieves
1951 the property data, the routine writes the property type value to
1952 this variable. This value indicates the type of property data
1953 that is in the Data buffer.
1954
1955Return Value:
1956
1957 Method returns an NTSTATUS value. This routine might return one of the
1958 following values. It might return other NTSTATUS-codes as well.
1959
1960 STATUS_SUCCESS The operation succeeded.
1961 STATUS_INVALID_PARAMETER One of the parameters is incorrect.
1962
1963--*/
1964{
1965 DDI_ENTRY();
1966
1969
1971 pFxDriverGlobals = DeviceInit->DriverGlobals;
1972
1974
1975 if (DeviceProperty->Size != sizeof(WDF_DEVICE_PROPERTY_DATA)) {
1978 "PropertyData size (%d) incorrect, expected %d, %!STATUS!",
1979 DeviceProperty->Size,
1981 return status;
1982 }
1983
1985
1987
1989 if (!NT_SUCCESS(status)) {
1990 return status;
1991 }
1992
1994
1996 if (!NT_SUCCESS(status)) {
1997 return status;
1998 }
1999
2000 if (DeviceInit->IsNotFdoInit()) {
2002
2004 "Not a PWDFDEVICE_INIT for an FDO, %!STATUS!",
2005 status);
2006
2007 return status;
2008 }
2009
2011 DeviceInit,
2012 NULL,
2015 PoolType,
2018 Type);
2019 return status;
2020}
2021
2022//
2023// END FDO specific functions
2024//
2025
2026//
2027// BEGIN PDO specific functions
2028//
2032STDCALL
2033WDFEXPORT(WdfPdoInitAllocate)(
2034 __in
2036 __in
2038 )
2039{
2040 DDI_ENTRY();
2041
2046
2050 (PVOID*) &pDevice,
2052
2054 if (!NT_SUCCESS(status)) {
2055 return NULL;
2056 }
2057
2058 if (pDevice->IsFdo() == FALSE) {
2061 "Parent device is not a FDO (must use WDFCHILDLIST to use a PDO as a parent)"
2062 );
2063
2064 return NULL;
2065 }
2066
2068 if (pInit == NULL) {
2070 "Couldn't create WDFDEVICE_INIT object");
2071
2072 return NULL;
2073 }
2074
2076
2077 //
2078 // Dynamically created PDOs are not created with this API, rather they go
2079 // through WDFCHILDLIST's callback.
2080 //
2082
2083 return pInit;
2084}
2085
2087VOID
2088STDCALL
2089WDFEXPORT(WdfPdoInitSetEventCallbacks)(
2090 __in
2092 __in
2094 __in
2096 )
2097{
2098 DDI_ENTRY();
2099
2101
2103 pFxDriverGlobals = DeviceInit->DriverGlobals;
2104
2106
2108 return;
2109 }
2110
2111 if (DeviceInit->IsNotPdoInit()) {
2113 "Not a PWDFDEVICE_INIT for a PDO");
2115 return;
2116 }
2117
2121 "DispatchTable size %d is invalid, expected %d",
2122 DispatchTable->Size, sizeof(WDF_PDO_EVENT_CALLBACKS));
2124 return; // STATUS_INFO_LENGTH_MISMATCH;
2125 }
2126
2127 RtlCopyMemory(&DeviceInit->Pdo.EventCallbacks,
2129 sizeof(WDF_PDO_EVENT_CALLBACKS));
2130}
2131
2135STDCALL
2136WDFEXPORT(WdfPdoInitAssignDeviceID)(
2137 __in
2139 __in
2141 __in
2143 )
2144{
2145 DDI_ENTRY();
2146
2149
2151 pFxDriverGlobals = DeviceInit->DriverGlobals;
2152
2154
2156 if (!NT_SUCCESS(status)) {
2157 return status;
2158 }
2159
2161 if (!NT_SUCCESS(status)) {
2162 return status;
2163 }
2164
2165 if (DeviceInit->IsNotPdoInit()) {
2168 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2169 status);
2170 return status;
2171 }
2172
2173 if (DeviceInit->Pdo.DeviceID == NULL) {
2176
2177 if (DeviceInit->Pdo.DeviceID == NULL) {
2180 "Couldn't allocate DeviceID object, %!STATUS!",
2181 status);
2182 return status;
2183 }
2184 }
2185
2186 status = DeviceInit->Pdo.DeviceID->Assign(DeviceID);
2187
2188 return status;
2189}
2190
2194STDCALL
2195WDFEXPORT(WdfPdoInitAssignInstanceID)(
2196 __in
2198 __in
2200 __in
2202 )
2203{
2204 DDI_ENTRY();
2205
2208
2210 pFxDriverGlobals = DeviceInit->DriverGlobals;
2211
2213
2215 if (!NT_SUCCESS(status)) {
2216 return status;
2217 }
2218
2220 if (!NT_SUCCESS(status)) {
2221 return status;
2222 }
2223
2224 if (DeviceInit->IsNotPdoInit()) {
2227 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2228 status);
2229 return status;
2230 }
2231
2232 if (DeviceInit->Pdo.InstanceID == NULL) {
2235
2236 if (DeviceInit->Pdo.InstanceID == NULL) {
2239 "Couldn't allocate InstanceID object, %!STATUS!",
2240 status);
2241 return status;
2242 }
2243 }
2244
2245 status = DeviceInit->Pdo.InstanceID->Assign(InstanceID);
2246
2247 return status;
2248}
2249
2253STDCALL
2254WDFEXPORT(WdfPdoInitAddHardwareID)(
2255 __in
2257 __in
2259 __in
2261 )
2262{
2263 DDI_ENTRY();
2264
2268
2270 pFxDriverGlobals = DeviceInit->DriverGlobals;
2271
2273
2275 if (!NT_SUCCESS(status)) {
2276 return status;
2277 }
2278
2280 if (!NT_SUCCESS(status)) {
2281 return status;
2282 }
2283
2284 if (DeviceInit->IsNotPdoInit()) {
2287 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2288 status);
2289 return status;
2290 }
2291
2293 if (pID == NULL) {
2297 "Couldn't allocate String object %!STATUS!", status);
2298 return status;
2299 }
2300
2303 status = (DeviceInit->Pdo.HardwareIDs.Add(pFxDriverGlobals, pID)) ?
2305 }
2306
2307 //
2308 // Upon success, the FxCollection will have taken a reference.
2309 // Upon failure, this is object cleanup.
2310 //
2311 pID->Release();
2312
2313 return status;
2314}
2315
2319STDCALL
2320WDFEXPORT(WdfPdoInitAddCompatibleID)(
2321 __in
2323 __in
2325 __in
2327 )
2328{
2329 DDI_ENTRY();
2330
2332 FxString* pID;
2334
2336 pFxDriverGlobals = DeviceInit->DriverGlobals;
2337
2339
2341 if (!NT_SUCCESS(status)) {
2342 return status;
2343 }
2344
2346 if (!NT_SUCCESS(status)) {
2347 return status;
2348 }
2349
2350 if (DeviceInit->IsNotPdoInit()) {
2353 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2354 status);
2355 return status;
2356 }
2357
2359 if (pID == NULL) {
2361 "Couldn't allocate String object"
2362 "STATUS_INSUFFICIENT_RESOURCES "
2363 );
2365 }
2366
2368 if (NT_SUCCESS(status)) {
2369 status = (DeviceInit->Pdo.CompatibleIDs.Add(pFxDriverGlobals, pID)) ?
2371 }
2372
2373 //
2374 // Upon success, the FxCollection will have taken a reference. Upon failure,
2375 // this is object cleanup.
2376 //
2377 pID->Release();
2378
2379 return status;
2380}
2381
2385STDCALL
2386WDFEXPORT(WdfPdoInitAssignContainerID)(
2387 __in
2389 __in
2391 __in
2393 )
2394{
2395 DDI_ENTRY();
2396
2399
2401 pFxDriverGlobals = DeviceInit->DriverGlobals;
2402
2404
2406 if (!NT_SUCCESS(status)) {
2407 return status;
2408 }
2409
2411 if (!NT_SUCCESS(status)) {
2412 return status;
2413 }
2414
2415 if (DeviceInit->IsNotPdoInit()) {
2418 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2419 status);
2420 return status;
2421 }
2422
2423 if (DeviceInit->Pdo.ContainerID == NULL) {
2424 DeviceInit->Pdo.ContainerID = new(pFxDriverGlobals,
2427
2428 if (DeviceInit->Pdo.ContainerID == NULL) {
2431 "Couldn't allocate ContainerID object, %!STATUS!",
2432 status);
2433
2434 return status;
2435 }
2436 }
2437
2438 status = DeviceInit->Pdo.ContainerID->Assign(ContainerID);
2439
2440 return status;
2441}
2442
2446STDCALL
2447WDFEXPORT(WdfPdoInitAddDeviceText)(
2448 __in
2450 __in
2452 __in
2454 __in
2456 __in
2458 )
2459{
2460 DDI_ENTRY();
2461
2465
2467 pFxDriverGlobals = DeviceInit->DriverGlobals;
2468
2471
2473 if (!NT_SUCCESS(status)) {
2474 return status;
2475 }
2476
2478 if (!NT_SUCCESS(status)) {
2479 return status;
2480 }
2481
2483 if (!NT_SUCCESS(status)) {
2484 return status;
2485 }
2486
2487 if (DeviceInit->IsNotPdoInit()) {
2490 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!", status);
2491 return status;
2492 }
2493
2495
2498
2501 "Couldn't allocate DeviceText object, %!STATUS!", status);
2502
2503 return status;
2504 }
2505
2507
2510
2513
2516 "Couldn't allocate DeviceDescription string, %!STATUS!", status);
2517
2518 goto Done;
2519 }
2520
2523
2526
2529 "Couldn't allocate DeviceLocation string, %!STATUS!", status);
2530
2531 goto Done;
2532 }
2533
2534 //
2535 // Insert at the end of the list and update end of the list
2536 //
2537 *DeviceInit->Pdo.LastDeviceTextEntry = &pDeviceText->m_Entry;
2538 DeviceInit->Pdo.LastDeviceTextEntry = &pDeviceText->m_Entry.Next;
2539
2540Done:
2541 if (!NT_SUCCESS(status)) {
2542 delete pDeviceText;
2543 }
2544
2545 return status;
2546}
2547
2549VOID
2550STDCALL
2551WDFEXPORT(WdfPdoInitSetDefaultLocale)(
2552 __in
2554 __in
2556 __in
2558 )
2559{
2560 DDI_ENTRY();
2561
2563
2565 pFxDriverGlobals = DeviceInit->DriverGlobals;
2566
2568 PASSIVE_LEVEL))) {
2569 return;
2570 }
2571
2572 if (DeviceInit->IsNotPdoInit()) {
2575 "Not a PWDFDEVICE_INIT for a PDO");
2577 return;
2578 }
2579
2580 DeviceInit->Pdo.DefaultLocale = LocaleId;
2581}
2582
2586STDCALL
2587WDFEXPORT(WdfPdoInitAssignRawDevice)(
2588 __in
2590 __in
2592 __in
2594 )
2595{
2596 DDI_ENTRY();
2597
2600
2602 pFxDriverGlobals = DeviceInit->DriverGlobals;
2603
2605
2607 if (!NT_SUCCESS(status)) {
2608 return status;
2609 }
2610
2611 if (DeviceInit->IsNotPdoInit()) {
2614 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2615 status);
2616 return status;
2617 }
2618
2619 DeviceInit->Pdo.Raw = TRUE;
2620 DeviceInit->Security.DeviceClassSet = TRUE;
2621 RtlCopyMemory(&DeviceInit->Security.DeviceClass,
2623 sizeof(GUID));
2624
2625 return STATUS_SUCCESS;
2626}
2627
2629VOID
2630STDCALL
2631WDFEXPORT(WdfPdoInitAllowForwardingRequestToParent)(
2632 __in
2634 __in
2636 )
2637{
2638 DDI_ENTRY();
2639
2642
2644 pFxDriverGlobals = DeviceInit->DriverGlobals;
2645
2647 if (!NT_SUCCESS(status)) {
2648 return;
2649 }
2650
2651 if (DeviceInit->IsNotPdoInit()) {
2653 "Not a PWDFDEVICE_INIT for a PDO, %!STATUS!",
2654 status);
2656 return;
2657 }
2658
2659 DeviceInit->Pdo.ForwardRequestToParent = TRUE;
2660 return ;
2661}
2662
2663
2664
2665//
2666// END PDO specific functions
2667//
2668
2669//
2670// BEGIN CONTROL DEVICE specific functions
2671//
2672
2676STDCALL
2677WDFEXPORT(WdfControlDeviceInitAllocate)(
2678 __in
2680 __in
2681 WDFDRIVER Driver,
2682 __in
2684 )
2685{
2686 DDI_ENTRY();
2687
2691
2693 Driver,
2695 (PVOID*) &pDriver,
2697
2699
2701 if (!NT_SUCCESS(status)) {
2702 return NULL;
2703 }
2704
2706 if (!NT_SUCCESS(status)) {
2707 return NULL;
2708 }
2709
2711}
2712
2714VOID
2715STDCALL
2716WDFEXPORT(WdfControlDeviceInitSetShutdownNotification)(
2717 __in
2719 __in
2721 __in
2723 __in
2725 )
2726{
2727 DDI_ENTRY();
2728
2730
2732 pFxDriverGlobals = DeviceInit->DriverGlobals;
2733
2735
2736 if (DeviceInit->IsNotControlDeviceInit()) {
2738 "Not a PWDFDEVICE_INIT for a control device");
2740 return;
2741 }
2742
2745 "WdfDeviceShutdown Flags 0x%x are invalid", Flags);
2747 return;
2748 }
2749
2750 DeviceInit->Control.ShutdownNotification = Notification;
2752}
2753
2754//
2755// END CONTROL DEVICE specific functions
2756//
2757
2758} // extern "C"
unsigned char BOOLEAN
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
#define ARRAY_SIZE(A)
Definition: main.h:33
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
static _Must_inspect_result_ NTSTATUS _ValidateConfig(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_CHILD_LIST_CONFIG Config, __in size_t *TotalDescriptionSize)
__inline FxDriver * GetDriver(VOID)
Definition: fxdevice.hpp:164
static _Must_inspect_result_ NTSTATUS _QueryProperty(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_opt_ MdDeviceObject RemotePdo, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _In_ ULONG BufferLength, _Out_opt_ PVOID PropertyBuffer, _Out_opt_ PULONG ResultLength)
Definition: fxdevicekm.cpp:939
static _Must_inspect_result_ NTSTATUS _QueryPropertyEx(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_ PVOID PropertyData, _In_ FxPropertyType FxPropertyType, _In_ ULONG BufferLength, _Out_ PVOID PropertyBuffer, _Out_ PULONG ResultLength, _Out_ PDEVPROPTYPE PropertyType)
Definition: fxdevicekm.cpp:859
static _Must_inspect_result_ NTSTATUS _AllocAndQueryProperty(_In_ PFX_DRIVER_GLOBALS Globals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_opt_ MdDeviceObject RemotePdo, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _In_ POOL_TYPE PoolType, _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, _Out_ WDFMEMORY *PropertyMemory)
Definition: fxdevice.cpp:1988
static _Must_inspect_result_ NTSTATUS _AllocAndQueryPropertyEx(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_ PVOID PropertyData, _In_ FxPropertyType FxPropertyType, _In_ POOL_TYPE PoolType, _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, _Out_ WDFMEMORY *PropertyMemory, _Out_ PDEVPROPTYPE PropertyType)
Definition: fxdevice.cpp:2063
static _Must_inspect_result_ NTSTATUS _OpenKey(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_ ULONG DeviceInstanceKeyType, _In_ ACCESS_MASK DesiredAccess, _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes, _Out_ WDFKEY *Key)
Definition: fxdevicekm.cpp:731
__inline BOOLEAN IsFdo(VOID)
Definition: fxdevice.hpp:1227
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxobject.hpp:853
_Must_inspect_result_ NTSTATUS Assign(__in PCWSTR SourceString)
Definition: fxstring.cpp:57
#define __in
Definition: dbghelp.h:35
#define __in_bcount(x)
Definition: dbghelp.h:41
#define __inout
Definition: dbghelp.h:50
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define TRACINGPNP
Definition: dbgtrace.h:67
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
ULONG * PDEVPROPTYPE
Definition: devpropdef.h:24
#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:32
#define DEVICE_TYPE
Definition: guid.c:10
#define __drv_when(cond, annotes)
Definition: driverspecs.h:335
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define __drv_strictTypeMatch(mode)
Definition: driverspecs.h:330
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define NonPagedPool
Definition: env_spec_w32.h:307
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define PagedPool
Definition: env_spec_w32.h:308
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
@ FxDeviceProperty
Definition: fxdevice.hpp:86
BOOLEAN __inline FxIsFileObjectOptional(__in WDF_FILEOBJECT_CLASS FileObjectClass)
Definition: fxdevice.hpp:112
WDF_FILEOBJECT_CLASS __inline FxFileObjectClassNormalize(__in WDF_FILEOBJECT_CLASS FileObjectClass)
Definition: fxdevice.hpp:103
@ FxDeviceInitTypeControlDevice
NTSTATUS status
__in PWDFDEVICE_INIT __in CONST GUID * DeviceClassGuid
__in PWDFDEVICE_INIT __in PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
ULONG normalizedState
size_t totalDescriptionSize
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ _Strict_type_match_ POOL_TYPE PoolType
struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5 * PWDF_POWER_POLICY_EVENT_CALLBACKS_V1_5
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in ULONG __out PULONG ResultLength
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState
ULONG validFlags
WDF_FILEOBJECT_CLASS fileClass
__in PWDFDEVICE_INIT __in PWDF_FDO_EVENT_CALLBACKS FdoEventCallbacks
__in PWDFDEVICE_INIT __in PWDF_OBJECT_ATTRIBUTES RequestAttributes
__in PWDFDEVICE_INIT __in PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
__in PWDFDEVICE_INIT __in PWDF_PDO_EVENT_CALLBACKS DispatchTable
FxDevice * pDevice
__in PWDFDEVICE_INIT __in BOOLEAN IsPowerPolicyOwner
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING DeviceDescription
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING HardwareID
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG _Out_ PDEVPROPTYPE Type
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING CompatibleID
__in PWDFDEVICE_INIT __in PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
_Must_inspect_result_ __in PWDFDEVICE_INIT __in_opt PCUNICODE_STRING SDDLString
__in PWDFDEVICE_INIT __in PWDF_FILEOBJECT_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_STATE __in PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange
_Must_inspect_result_ __in WDFDRIVER Driver
struct _WDF_PDO_EVENT_CALLBACKS_V1_9 WDF_PDO_EVENT_CALLBACKS_V1_9
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), ParentDevice, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
__inout PWDFDEVICE_INIT __in PWDF_CHILD_LIST_CONFIG __in_opt PWDF_OBJECT_ATTRIBUTES DefaultDeviceListAttributes
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_STATE PowerState
__in PWDFDEVICE_INIT __in DEVICE_TYPE DeviceType
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
return STATUS_SUCCESS
__in PWDFDEVICE_INIT DeviceInit
FxPnpStateCallbackInfo * pCallback
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_POWER_POLICY_STATE __in PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION EvtDevicePowerPolicyStateChange
__in PWDFDEVICE_INIT __in WDF_DEVICE_IO_TYPE IoType
_Must_inspect_result_ __in PWDFDEVICE_INIT __in_opt PCUNICODE_STRING DeviceName
struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 WDF_PNPPOWER_EVENT_CALLBACKS_V1_9
FxDriver * pDriver
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
__in PWDFDEVICE_INIT __in PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
__in PWDFDEVICE_INIT __in PWDF_REMOVE_LOCK_OPTIONS RemoveLockOptions
PFX_DRIVER_GLOBALS fxDriverGlobals
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY DeviceProperty
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG DeviceInstanceKeyType
struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 * PWDF_PNPPOWER_EVENT_CALLBACKS_V1_9
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING ContainerID
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING DeviceID
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFKEY * Key
PWDFDEVICE_INIT pInit
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING __in PCUNICODE_STRING DeviceLocation
__inout PWDFDEVICE_INIT __in PWDF_CHILD_LIST_CONFIG Config
WDF_FILEOBJECT_CLASS normalizedFileClass
__in PWDFDEVICE_INIT __in PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION __in UCHAR Flags
_In_ PWDFDEVICE_INIT _In_ PWDF_IO_TYPE_CONFIG IoTypeConfig
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in ULONG BufferLength
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR MajorFunction
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE __in PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION __in ULONG CallbackTypes
FxVerifierCheckNxPoolType(pFxDriverGlobals, PoolType, pFxDriverGlobals->Tag)
__in PWDFDEVICE_INIT __in ULONG DeviceCharacteristics
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES KeyAttributes
_Must_inspect_result_ __in PWDFDEVICE_INIT __in ULONG __in ACCESS_MASK DesiredAccess
_Must_inspect_result_ __in WDFDEVICE ParentDevice
__in PWDFDEVICE_INIT __in PWDF_FILEOBJECT_CONFIG FileObjectConfig
struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5 WDF_POWER_POLICY_EVENT_CALLBACKS_V1_5
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PFN_WDFDEVICE_WDM_IRP_PREPROCESS __in UCHAR __in_opt PUCHAR __in ULONG NumMinorFunctions
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING __in PCUNICODE_STRING __in LCID LocaleId
__in PWDFDEVICE_INIT __in ULONG __in BOOLEAN OrInValues
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE PnpState
struct _WDF_PDO_EVENT_CALLBACKS_V1_9 * PWDF_PDO_EVENT_CALLBACKS_V1_9
WDF_IO_TYPE_CONFIG ioTypeConfig
FxString * pID
_Must_inspect_result_ __in PWDFDEVICE_INIT __in PCUNICODE_STRING InstanceID
__in PWDFDEVICE_INIT __in WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
PFX_DRIVER_GLOBALS pFxDriverGlobals
_Must_inspect_result_ __in PWDFDEVICE_INIT __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFMEMORY * PropertyMemory
_Must_inspect_result_ __in PWDFDEVICE_INIT __in WDF_DEVICE_PNP_STATE __in PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION EvtDevicePnpStateChange
FxDeviceText * pDeviceText
FxVerifierDbgBreakPoint(pFxDriverGlobals)
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
@ FX_TYPE_DEVICE
Definition: fxtypes.h:47
@ FX_TYPE_DRIVER
Definition: fxtypes.h:46
@ FX_VALIDATE_OPTION_SYNCHRONIZATION_SCOPE_ALLOWED
@ FX_VALIDATE_OPTION_EXECUTION_LEVEL_ALLOWED
@ FX_VALIDATE_OPTION_PARENT_NOT_ALLOWED
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _Strict_type_match_
Definition: ms_sal.h:2954
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define __out_bcount_full_opt(size)
Definition: ms_sal.h:2728
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define CONST
Definition: pedump.c:81
DWORD LCID
Definition: nls.h:13
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_Must_inspect_result_ PWCHAR FxDuplicateUnicodeStringToString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source)
Definition: stringutil.cpp:287
PWCHAR m_LocationInformation
SINGLE_LIST_ENTRY m_Entry
PWCHAR m_Description
PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDevicePreprocess
Info Dispatch[IRP_MJ_MAXIMUM_FUNCTION+1]
PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION Callback
ControlInit Control
VOID SetPdo(__in FxDevice *Parent)
VOID AssignIoType(_In_ PWDF_IO_TYPE_CONFIG IoTypeConfig)
FxIrpPreprocessInfo * PreprocessInfo
static _Must_inspect_result_ PWDFDEVICE_INIT _AllocateControlDeviceInit(__in FxDriver *Driver, __in const UNICODE_STRING *SDDLString)
BOOLEAN IsUserModeDriver
Definition: fxglobals.h:488
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
WDF_DEVICE_IO_TYPE ReadWriteIoType
Definition: wdfdevice.h:1856
PFN_WDF_DEVICE_EJECT EvtDeviceEject
Definition: wdf19.h:1595
PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS EvtDeviceDisableWakeAtBus
Definition: wdf19.h:1612
PFN_WDF_DEVICE_SET_LOCK EvtDeviceSetLock
Definition: wdf19.h:1600
PFN_WDF_DEVICE_RESOURCES_QUERY EvtDeviceResourcesQuery
Definition: wdf19.h:1585
PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS EvtDeviceEnableWakeAtBus
Definition: wdf19.h:1606
PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY EvtDeviceResourceRequirementsQuery
Definition: wdf19.h:1590
PFN_WDF_DEVICE_QUERY_REMOVE EvtDeviceQueryRemove
Definition: wdf19.h:727
PFN_WDF_DEVICE_QUERY_STOP EvtDeviceQueryStop
Definition: wdf19.h:729
PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH EvtDeviceSelfManagedIoFlush
Definition: wdf19.h:717
PFN_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval
Definition: wdf19.h:725
PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND EvtDeviceSelfManagedIoSuspend
Definition: wdf19.h:721
PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled
Definition: wdf19.h:705
PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit
Definition: wdf19.h:707
PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware
Definition: wdf19.h:711
PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware
Definition: wdf19.h:713
PFN_WDF_DEVICE_USAGE_NOTIFICATION EvtDeviceUsageNotification
Definition: wdf19.h:731
PFN_WDF_DEVICE_RELATIONS_QUERY EvtDeviceRelationsQuery
Definition: wdf19.h:733
PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
Definition: wdf19.h:703
PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED EvtDeviceD0ExitPreInterruptsDisabled
Definition: wdf19.h:709
PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP EvtDeviceSelfManagedIoCleanup
Definition: wdf19.h:715
PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART EvtDeviceSelfManagedIoRestart
Definition: wdf19.h:723
PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit
Definition: wdf19.h:719
PFN_WDF_DEVICE_ARM_WAKE_FROM_S0 EvtDeviceArmWakeFromS0
Definition: wdf15.h:632
PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED EvtDeviceWakeFromS0Triggered
Definition: wdf15.h:636
PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX EvtDeviceDisarmWakeFromSx
Definition: wdf15.h:640
PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0 EvtDeviceDisarmWakeFromS0
Definition: wdf15.h:634
PFN_WDF_DEVICE_ARM_WAKE_FROM_SX EvtDeviceArmWakeFromSx
Definition: wdf15.h:638
PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED EvtDeviceWakeFromSxTriggered
Definition: wdf15.h:642
Definition: ps.c:97
uint32_t * PULONG
Definition: typedefs.h:59
INT POOL_TYPE
Definition: typedefs.h:78
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STDCALL
Definition: wdf.h:45
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
_Must_inspect_result_ _In_ WDFDRIVER _In_ CONST UNICODE_STRING * SDDLString
Definition: wdfcontrol.h:86
@ WdfDeviceLastChanceShutdown
Definition: wdfcontrol.h:66
@ WdfDeviceShutdown
Definition: wdfcontrol.h:65
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION * PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION
Definition: wdfcontrol.h:62
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_In_ PWDFDEVICE_INIT _In_ PWDF_FILEOBJECT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
Definition: wdfdevice.h:3400
EVT_WDF_DEVICE_QUERY_STOP * PFN_WDF_DEVICE_QUERY_STOP
Definition: wdfdevice.h:986
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes
Definition: wdfdevice.h:2660
@ WdfDevStatePnpNull
Definition: wdfdevice.h:122
@ WdfDevStatePnpObjectCreated
Definition: wdfdevice.h:64
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
Definition: wdfdevice.h:3817
_In_ PWDFDEVICE_INIT _In_ BOOLEAN IsPowerPolicyOwner
Definition: wdfdevice.h:2966
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFMEMORY * PropertyMemory
Definition: wdfdevice.h:3820
_In_ PWDFDEVICE_INIT _In_ PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
Definition: wdfdevice.h:2908
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
FORCEINLINE ULONG WdfDevStateNormalize(_In_ ULONG State)
Definition: wdfdevice.h:1225
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext
Definition: wdfdevice.h:3505
_In_ PWDFDEVICE_INIT _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes
Definition: wdfdevice.h:3431
@ WdfReleaseHardwareOrderOnFailureAfterDescendants
Definition: wdfdevice.h:476
@ WdfReleaseHardwareOrderOnFailureInvalid
Definition: wdfdevice.h:474
EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND * PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND
Definition: wdfdevice.h:960
EVT_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION * PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION
Definition: wdfdevice.h:784
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG DeviceInstanceKeyType
Definition: wdfdevice.h:2656
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
EVT_WDF_DEVICE_PREPARE_HARDWARE * PFN_WDF_DEVICE_PREPARE_HARDWARE
Definition: wdfdevice.h:893
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_PNP_STATE PnpState
Definition: wdfdevice.h:2995
enum _WDF_DEVICE_POWER_STATE WDF_DEVICE_POWER_STATE
EVT_WDF_DEVICE_ARM_WAKE_FROM_SX * PFN_WDF_DEVICE_ARM_WAKE_FROM_SX
Definition: wdfdevice.h:1087
enum _WDF_FILEOBJECT_CLASS WDF_FILEOBJECT_CLASS
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_PNP_STATE _In_ PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION _In_ ULONG CallbackTypes
Definition: wdfdevice.h:3000
EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0 * PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0
Definition: wdfdevice.h:1117
@ StateNotificationAllStates
Definition: wdfdevice.h:395
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PFN_WDFDEVICE_WDM_IRP_PREPROCESS EvtDeviceWdmIrpPreprocess
Definition: wdfdevice.h:3460
EVT_WDF_DEVICE_ARM_WAKE_FROM_S0 * PFN_WDF_DEVICE_ARM_WAKE_FROM_S0
Definition: wdfdevice.h:1074
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState
Definition: wdfdevice.h:3073
EVT_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED * PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED
Definition: wdfdevice.h:1156
EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED * PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED
Definition: wdfdevice.h:876
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT * PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT
Definition: wdfdevice.h:947
@ WDF_REMOVE_LOCK_OPTION_ACQUIRE_FOR_IO
Definition: wdfdevice.h:1639
EVT_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION * PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION
Definition: wdfdevice.h:814
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PFN_WDFDEVICE_WDM_IRP_PREPROCESS _In_ UCHAR _In_opt_ PUCHAR _In_ ULONG NumMinorFunctions
Definition: wdfdevice.h:3468
_In_ PWDFDEVICE_INIT _In_ PWDF_FILEOBJECT_CONFIG FileObjectConfig
Definition: wdfdevice.h:3397
EVT_WDF_DEVICE_RELATIONS_QUERY * PFN_WDF_DEVICE_RELATIONS_QUERY
Definition: wdfdevice.h:1061
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4437
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_POLICY_STATE _In_ PFN_WDF_DEVICE_POWER_POLICY_STATE_CHANGE_NOTIFICATION EvtDevicePowerPolicyStateChange
Definition: wdfdevice.h:3075
EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED * PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED
Definition: wdfdevice.h:846
EVT_WDF_DEVICE_SELF_MANAGED_IO_RESTART * PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART
Definition: wdfdevice.h:973
enum _WDF_DEVICE_POWER_POLICY_STATE WDF_DEVICE_POWER_POLICY_STATE
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3769
EVT_WDF_DEVICE_D0_ENTRY * PFN_WDF_DEVICE_D0_ENTRY
Definition: wdfdevice.h:831
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PFN_WDFDEVICE_WDM_IRP_PREPROCESS _In_ UCHAR _In_opt_ PUCHAR MinorFunctions
Definition: wdfdevice.h:3465
_In_ PWDFDEVICE_INIT _In_ PWDF_IO_TYPE_CONFIG IoTypeConfig
Definition: wdfdevice.h:4394
EVT_WDF_DEVICE_SELF_MANAGED_IO_FLUSH * PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH
Definition: wdfdevice.h:934
EVT_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED * PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED
Definition: wdfdevice.h:1143
EVT_WDF_IO_IN_CALLER_CONTEXT * PFN_WDF_IO_IN_CALLER_CONTEXT
Definition: wdfdevice.h:1728
EVT_WDF_DEVICE_DISARM_WAKE_FROM_SX * PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX
Definition: wdfdevice.h:1130
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
EVT_WDFDEVICE_WDM_IRP_PREPROCESS * PFN_WDFDEVICE_WDM_IRP_PREPROCESS
Definition: wdfdevice.h:1685
enum _WDF_DEVICE_PNP_STATE WDF_DEVICE_PNP_STATE
EVT_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION * PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION
Definition: wdfdevice.h:799
@ WdfFileObjectWdfCanUseFsContext
Definition: wdfdevice.h:461
@ WdfFileObjectInvalid
Definition: wdfdevice.h:459
@ WdfFileObjectWdfCanUseFsContext2
Definition: wdfdevice.h:462
@ WdfFileObjectWdfCannotUseFsContexts
Definition: wdfdevice.h:463
@ WdfFileObjectCanBeOptional
Definition: wdfdevice.h:464
EVT_WDF_DEVICE_USAGE_NOTIFICATION * PFN_WDF_DEVICE_USAGE_NOTIFICATION
Definition: wdfdevice.h:1029
EVT_WDF_DEVICE_RELEASE_HARDWARE * PFN_WDF_DEVICE_RELEASE_HARDWARE
Definition: wdfdevice.h:908
_In_ PWDFDEVICE_INIT _In_ PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
Definition: wdfdevice.h:2937
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
Definition: wdfdevice.h:3336
EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP * PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP
Definition: wdfdevice.h:921
EVT_WDF_DEVICE_QUERY_REMOVE * PFN_WDF_DEVICE_QUERY_REMOVE
Definition: wdfdevice.h:999
enum _WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3034
EVT_WDF_DEVICE_D0_EXIT * PFN_WDF_DEVICE_D0_EXIT
Definition: wdfdevice.h:861
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
@ WdfDevStatePwrPolNull
Definition: wdfdevice.h:385
@ WdfDevStatePwrPolObjectCreated
Definition: wdfdevice.h:232
_In_ PWDFDEVICE_INIT _In_ ULONG _In_ BOOLEAN OrInValues
Definition: wdfdevice.h:3367
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE _In_ PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange
Definition: wdfdevice.h:3036
@ WdfDevStatePowerNull
Definition: wdfdevice.h:223
@ WdfDevStatePowerObjectCreated
Definition: wdfdevice.h:130
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2775
_In_ PWDFDEVICE_INIT _In_ WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
Definition: wdfdevice.h:4365
EVT_WDF_DEVICE_SURPRISE_REMOVAL * PFN_WDF_DEVICE_SURPRISE_REMOVAL
Definition: wdfdevice.h:1012
FORCEINLINE VOID WDF_IO_TYPE_CONFIG_INIT(_Out_ PWDF_IO_TYPE_CONFIG IoTypeConfig)
Definition: wdfdevice.h:1888
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_PNP_STATE _In_ PFN_WDF_DEVICE_PNP_STATE_CHANGE_NOTIFICATION EvtDevicePnpStateChange
Definition: wdfdevice.h:2997
_In_ PWDFDEVICE_INIT _In_ PWDF_FDO_EVENT_CALLBACKS FdoEventCallbacks
Definition: wdffdo.h:376
EVT_WDF_DEVICE_SET_LOCK * PFN_WDF_DEVICE_SET_LOCK
Definition: wdfpdo.h:108
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Definition: wdfpdo.h:248
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING HardwareID
Definition: wdfpdo.h:340
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING ContainerID
Definition: wdfpdo.h:402
EVT_WDF_DEVICE_DISABLE_WAKE_AT_BUS * PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS
Definition: wdfpdo.h:136
EVT_WDF_DEVICE_RESOURCES_QUERY * PFN_WDF_DEVICE_RESOURCES_QUERY
Definition: wdfpdo.h:65
EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY * PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY
Definition: wdfpdo.h:80
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING InstanceID
Definition: wdfpdo.h:309
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING DeviceLocation
Definition: wdfpdo.h:434
EVT_WDF_DEVICE_EJECT * PFN_WDF_DEVICE_EJECT
Definition: wdfpdo.h:93
EVT_WDF_DEVICE_ENABLE_WAKE_AT_BUS * PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS
Definition: wdfpdo.h:123
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING CompatibleID
Definition: wdfpdo.h:371
_Must_inspect_result_ _In_ WDFDEVICE ParentDevice
Definition: wdfpdo.h:220
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:278
@ WdfTrue
Definition: wdftypes.h:88
@ WdfUseDefault
Definition: wdftypes.h:89
@ WdfFalse
Definition: wdftypes.h:87
#define WDFAPI
Definition: wdftypes.h:53
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
DEVICE_REGISTRY_PROPERTY
Definition: iotypes.h:1194
unsigned char UCHAR
Definition: xmlstorage.h:181