ReactOS  0.4.15-dev-3441-g67ad4e7
globals.cpp
Go to the documentation of this file.
1 
2 /*++
3 
4 Copyright (c) Microsoft Corporation
5 
6 Module Name:
7 
8  globals.cpp
9 
10 Abstract:
11 
12  This contains all Driver Frameworks configuration globals.
13 
14 Author:
15 
16 
17 
18 
19 Environment:
20 
21  Both kernel and user mode
22 
23 Revision History:
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 --*/
38 
39 
40 #include "fxobjectpch.hpp"
41 
42 // Tracing support
43 extern "C" {
44 #if defined(EVENT_TRACING)
45 #include "globals.tmh"
46 #endif
47 }
48 
49 extern "C" {
50 
51 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
52 VOID
54  VOID
55  );
56 #ifdef ALLOC_PRAGMA
57 #pragma alloc_text(WDF_FX_VF_SECTION_NAME, VerifierPageLockHandle)
58 #endif
59 #endif
60 
61 //
62 // Private methods.
63 //
64 
65 VOID
67  VOID
68  );
69 
70 VOID
72  __inout PFX_DRIVER_GLOBALS FxDriverGlobals,
74  __in BOOLEAN WindowsVerifierOn
75  );
76 
80  __in HANDLE Key,
81  __in PFX_DRIVER_GLOBALS FxDriverGlobals
82  );
83 
84 VOID
86  __in HANDLE Key,
87  __out FxTrackPowerOption* TrackPower
88  );
89 
90 //
91 // Global allocation tracker
92 //
94 
96 
97 //
98 // These are defined in FxObjectInfo.cpp to account for the facts that
99 // 1. FxObjectInfo array is different for UMDF and KMDF,
100 // 2. and not all the types are available in the common code
101 //
102 extern const FX_OBJECT_INFO FxObjectsInfo[];
104 
105 //
106 // Prevent compiler/linker/BBT from optimizing the global variable away
107 //
108 #if defined(_M_IX86)
109 #pragma comment(linker, "/include:_FxObjectsInfoCount")
110 #else
111 #pragma comment(linker, "/include:FxObjectsInfoCount")
112 #endif
113 
114 
116 BOOLEAN
119  )
120 {
121  ULONG i;
122 
123  for (i = 0; i < FxObjectsInfoCount; i++) {
125  return TRUE;
126  }
127  else if (ObjectType > FxObjectsInfo[i].ObjectType) {
128  continue;
129  }
130 
131  return FALSE;
132  }
133 
134  return FALSE;
135 }
136 
140  __in LPWSTR HandleNameList,
141  __in PFX_DRIVER_GLOBALS FxDriverGlobals
142  )
143 
144 /*++
145 
146 Routine Description:
147  Allocates an array of FxObjectDebugInfo's. The length of this array is the
148  same length as FxObjectsInfo. The array is sorted the same as
149  FxObjectDebugInfo, ObjectInfo is ascending in the list.
150 
151  If HandleNameList's first string is "*", we treat this as a wildcard and
152  track all external handles.
153 
154 Arguments:
155  HandleNameList - a multi-sz of handle names. It is assumed the multi sz is
156  well formed.
157 
158 Return Value:
159  a pointer allocated by ExAllocatePoolWithTag. The caller is responsible for
160  eventually freeing the pointer by calling ExFreePool.
161 
162 --*/
163 
164 {
165  FxObjectDebugInfo* pInfo;
166  PWCHAR pCur;
167  ULONG i, length;
168  BOOLEAN all;
169 
170  //
171  // check to see if the multi sz is empty
172  //
173  if (*HandleNameList == NULL) {
174  return NULL;
175  }
176 
178 
179  //
180  // Freed with ExFreePool in FxFreeDriverGlobals. Must be non paged because
181  // objects can be allocated at IRQL > PASSIVE_LEVEL.
182  //
184  length,
185  FxDriverGlobals->Tag);
186 
187  if (pInfo == NULL) {
188  return NULL;
189  }
190 
191  all = *HandleNameList == L'*' ? TRUE : FALSE;
192 
193  RtlZeroMemory(pInfo, length);
194 
195  //
196  // Iterate over all of the objects in our internal array. We iterate over
197  // this array instead of the multi sz list b/c this way we only convert
198  // each ANSI string to UNICODE once.
199  //
200  for (i = 0; i < FxObjectsInfoCount; i++) {
201  UNICODE_STRING objectName;
202  WCHAR ubuffer[40];
203  STRING string;
204 
206 
207  //
208  // If this is an internal object, just continue past it
209  //
210  if (FxObjectsInfo[i].HandleName == NULL) {
211  continue;
212  }
213 
214  //
215  // Short circuit if we are wildcarding
216  //
217  if (all) {
219  continue;
220  }
221 
222  RtlInitAnsiString(&string, FxObjectsInfo[i].HandleName);
223 
224  RtlZeroMemory(ubuffer, sizeof(ubuffer));
225  objectName.Buffer = ubuffer;
226  objectName.Length = 0;
227  objectName.MaximumLength = sizeof(ubuffer);
228 
229  //
230  // Conversion failed, just continue. Failure is not critical to
231  // returning the list.
232  //
233  if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&objectName,
234  &string,
235  FALSE))) {
236  continue;
237  }
238 
239  //
240  // Now iterate over the multi sz list, comparing handle strings in the
241  // list against the current object name.
242  //
243  pCur = HandleNameList;
244 
245  while (*pCur != UNICODE_NULL) {
246  UNICODE_STRING handleName;
247 
248  RtlInitUnicodeString(&handleName, pCur);
249 
250  //
251  // Increment to the next string now. Add one so that we skip past
252  // terminating null for this sz as well.
253  // Length is the number of bytes, not the number of characters.
254  //
255  pCur += handleName.Length / sizeof(WCHAR) + 1;
256 
257  //
258  // Case insensitive compare
259  //
260  if (RtlCompareUnicodeString(&handleName, &objectName, TRUE) == 0) {
262  break;
263  }
264  }
265  }
266 
267  return pInfo;
268 }
269 
270 VOID
272  __inout PFX_DRIVER_GLOBALS FxDriverGlobals,
274  )
275 {
276  FxDriverGlobalsDebugExtension* pExtension;
277 
278  //
279  // The wdf subkey may not be present for inbox drivers that do not use inf.
280  // Since Mdl tracking doen't need regsitry info we go ahead and allocate
281  // debug extension for use in Mdl tracking. Tag tracker depends on registry
282  // info and it won't be available if registry info is not present.
283  //
284 
286  NonPagedPool, sizeof(FxDriverGlobalsDebugExtension), FxDriverGlobals->Tag);
287 
288  if (pExtension == NULL) {
289  return;
290  }
291 
292  *pExtension = {};
293 
294  pExtension->AllocatedTagTrackersLock.Initialize();
295 
297 
298  pExtension->TrackPower = FxTrackPowerNone;
299 
300  FxDriverGlobals->DebugExtension = pExtension;
301 
302  if (Key != NULL) {
304  Key,
305  FxDriverGlobals
306  );
308  }
309 
310 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
312 #endif
313 }
314 
315 PCSTR
318  )
319 {
320  ULONG i;
321 
322  for (i = 0; i < FxObjectsInfoCount; i++) {
324  return FxObjectsInfo[i].HandleName;
325  }
326  else if (ObjectType > FxObjectsInfo[i].ObjectType) {
327  continue;
328  }
329 
330  return NULL;
331  }
332 
333  return NULL;
334 }
335 
337 BOOLEAN
339  __in FxObjectDebugInfo* DebugInfo,
341  )
342 
343 /*++
344 
345 Routine Description:
346  For a given object type, returns to the caller if it should track references
347  to the object.
348 
349 Arguments:
350  DebugInfo - array of object debug info to search through
351  ObjectType - the type of the object to check
352 
353 Return Value:
354  TRUE if references should be tracked, FALSE otherwise
355 
356 --*/
357 
358 {
359  ULONG i;
360 
361  //
362  // Array size of DebugInfo is the same size as FxObjectsInfo
363  //
364  for (i = 0; i < FxObjectsInfoCount; i++) {
365  if (ObjectType == DebugInfo[i].ObjectType) {
366  return FLAG_TO_BOOL(DebugInfo[i].u.DebugFlags,
368  }
369  else if (ObjectType > FxObjectsInfo[i].ObjectType) {
370  continue;
371  }
372 
373  return FALSE;
374  }
375 
376  return FALSE;
377 }
378 
379 
380 VOID
382  VOID
383  )
384 {
385  ULONG i;
386  USHORT prevType;
387 
388  prevType = FxObjectsInfo[0].ObjectType;
389 
390  for (i = 1; i < FxObjectsInfoCount; i++) {
391  if (prevType >= FxObjectsInfo[i].ObjectType) {
392  ASSERTMSG("FxObjectsInfo table is not in sorted order\n",
393  prevType < FxObjectsInfo[i].ObjectType);
394  }
395 
396  prevType = FxObjectsInfo[i].ObjectType;
397  }
398 }
399 
400 typedef
401 NTSTATUS
403  __out PRTL_OSVERSIONINFOW VersionInformation
404  );
405 
406 typedef
407 NTSTATUS
412  );
413 
414 typedef
415 ULONGLONG
420  );
421 
422 VOID
424  VOID
425  )
426 {
428  PFN_RTL_VERIFY_VERSION_INFO pRtlVerifyVersionInfo;
429  PFN_VER_SET_CONDITION_MASK pVerSetConditionMask;
432 
433  pRtlVerifyVersionInfo = (PFN_RTL_VERIFY_VERSION_INFO)
434  Mx::MxGetSystemRoutineAddress(MAKE_MX_FUNC_NAME("RtlVerifyVersionInfo"));
435 
436  if (pRtlVerifyVersionInfo == NULL) {
437  return;
438  }
439 
440  pVerSetConditionMask = (PFN_VER_SET_CONDITION_MASK)
441  Mx::MxGetSystemRoutineAddress(MAKE_MX_FUNC_NAME("VerSetConditionMask"));
442 
443  //
444  // Check for Win8 (6.2) and later for passive-level interrupt support.
445  //
446  RtlZeroMemory(&info, sizeof(info));
447  info.dwOSVersionInfoSize = sizeof(info);
448  info.dwMajorVersion = 6;
449  info.dwMinorVersion = 2;
450 
451  condition = 0;
452  condition = pVerSetConditionMask(condition, VER_MAJORVERSION, VER_GREATER_EQUAL);
453  condition = pVerSetConditionMask(condition, VER_MINORVERSION, VER_GREATER_EQUAL);
454 
455  status = pRtlVerifyVersionInfo(&info,
457  condition);
458  if (NT_SUCCESS(status)) {
460  }
461 }
462 
463 VOID
465  VOID
466  )
467 {
468  FxAutoRegKey hWdf;
472  ULONG ifrDisabled = 0;
473 
474  status = FxRegKey::_OpenKey(NULL, &path, &hWdf.m_Key, KEY_READ);
475  if (!NT_SUCCESS(status)) {
476  goto exit;
477  }
478 
479  status = FxRegKey::_QueryULong(hWdf.m_Key, &ifrDisabledName, &ifrDisabled);
480  if (!NT_SUCCESS(status)) {
481  goto exit;
482  }
483 
484  if (ifrDisabled == 1) {
486  }
487 
488 exit:
489  return;
490 }
491 
493 NTSTATUS
495  VOID
496  )
497 {
498  PFN_RTL_GET_VERSION pRtlGetVersion;
500 
501  //
502  // Global initialization for mode-agnostic primitives library
503  //
505 
506 
507 
508 
509 
510 
511 
512 
513 
514 
515 
516 
517 
518 
519 
520 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
522 #else
524 #endif
525 
526  //
527  // IFR is enabled by default
528  //
530 
531  //
532  // Query global WDF settings (both KMDF and UMDF).
533  //
535 
536 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
537  UNICODE_STRING funcName;
538 
539  // For DSF support.
540  RtlInitUnicodeString(&funcName, L"IoConnectInterruptEx");
542  MmGetSystemRoutineAddress(&funcName);
543 
544  RtlInitUnicodeString(&funcName, L"IoDisconnectInterruptEx");
546  MmGetSystemRoutineAddress(&funcName);
547 
548  // 32 bit: W2k and forward.
549  // 64 bit: W2k -> Windows Server 2008 (obsolete otherwise).
550  RtlInitUnicodeString(&funcName, L"KeQueryActiveProcessors");
552  MmGetSystemRoutineAddress(&funcName);
553 
554  RtlInitUnicodeString(&funcName, L"KeSetTargetProcessorDpc");
556  MmGetSystemRoutineAddress(&funcName);
557 
558  // These should always be there (obsolete in 64 bit Win 7 and forward).
561 
562  // Win 7 and forward.
563  RtlInitUnicodeString(&funcName, L"KeQueryActiveGroupCount");
564  if (MmGetSystemRoutineAddress(&funcName) != NULL) {
566  }
567 
568  // Win 7 and forward.
569  RtlInitUnicodeString(&funcName, L"KeSetCoalescableTimer");
571  MmGetSystemRoutineAddress(&funcName);
572 
573  // Win 7 and forward.
574  RtlInitUnicodeString(&funcName, L"IoUnregisterPlugPlayNotificationEx");
576  MmGetSystemRoutineAddress(&funcName);
577 
578  // Win 8 and forward
579  RtlInitUnicodeString(&funcName, L"PoFxRegisterDevice");
582 
583  // Win 8 and forward
584  RtlInitUnicodeString(&funcName, L"PoFxStartDevicePowerManagement");
587  MmGetSystemRoutineAddress(&funcName);
588 
589  // Win 8 and forward
590  RtlInitUnicodeString(&funcName, L"PoFxUnregisterDevice");
593  MmGetSystemRoutineAddress(&funcName);
594 
595  // Win 8 and forward
596  RtlInitUnicodeString(&funcName, L"PoFxActivateComponent");
598  MmGetSystemRoutineAddress(&funcName);
599 
600  // Win 8 and forward
601  RtlInitUnicodeString(&funcName, L"PoFxIdleComponent");
603  MmGetSystemRoutineAddress(&funcName);
604 
605  // Win 8 and forward
606  RtlInitUnicodeString(&funcName, L"PoFxReportDevicePoweredOn");
609 
610  // Win 8 and forward
611  RtlInitUnicodeString(&funcName, L"PoFxCompleteIdleState");
614 
615  // Win 8 and forward
616  RtlInitUnicodeString(&funcName, L"PoFxCompleteIdleCondition");
619 
620  // Win 8 and forward
621  RtlInitUnicodeString(&funcName, L"PoFxCompleteDevicePowerNotRequired");
624 
625  // Win 8 and forward
626  RtlInitUnicodeString(&funcName, L"PoFxSetDeviceIdleTimeout");
629 
630  // Win 8 and forward
631  RtlInitUnicodeString(&funcName, L"IoReportInterruptActive");
634 
635  // Win 8 and forward
636  RtlInitUnicodeString(&funcName, L"IoReportInterruptInactive");
639 
640  // Win 8.2 and forward
641  RtlInitUnicodeString(&funcName, L"VfCheckNxPoolType");
644 
645 #endif //((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
646 
648 
649  // User/Kernel agnostic.
650 
651  pRtlGetVersion = (PFN_RTL_GET_VERSION)
653 
654  ASSERT(pRtlGetVersion != NULL);
657 
658  //
659  // Initialize power management-related stuff.
660  //
663 
664  //
665  // Insure that the FxObject is layed-up correctly.
666  //
668 
669  //
670  // Initialize the list of FxDriverGlobals.
671  // This is essentially the list of drivers on this WDF version.
672  //
675 
676 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
677  //
678  // Register for the global (library) bugcheck callbacks.
679  //
681 #ifdef EVENT_TRACING // __REACTOS__
682  //
683  // Init driver usage tracker. This tracker is used by the debug dump
684  // callback routines for finding the driver's dump log file to write
685  // in the minidump. Ignore any tracker's errors.
686  //
688 
689  //
690  // Initialize enhanced-verifier section handle
691  //
694 
695  //
696  // Retrieve a pointer to the data structure that cotains trace routines
697  // corresponding to WdfNotifyRoutinesClass from the SystemTraceProvider
698  // that we'll use for perf tracing of WDF operations. The trace
699  // routines inside the structuyre are present only when tracing is enabled
700  // by some trace client (e.g. tracelog or xperf) for WDF specific perf
701  // groups. Note that no unregistration is necessary.
702  //
703  status = WmiQueryTraceInformation(WdfNotifyRoutinesClass,
705  sizeof(PWMI_WDF_NOTIFY_ROUTINES),
706  NULL,
707  NULL);
708 
709  if (!NT_SUCCESS(status)) {
710  //
711  // WDF trace routines are available only on win8+, so failure is
712  // expected on pre-Win8 OS. Use the dummy routines on failure.
713  //
715  sizeof(WMI_WDF_NOTIFY_ROUTINES));
717  sizeof(WMI_WDF_NOTIFY_ROUTINES);
721  }
722 
723  //
724  // The Size member of WMI_WDF_NOTIFY_ROUTINES allows versioning. When
725  // the WMI_WDF_NOTIFY_ROUTINES structure is revised with additional
726  // members in future OS versions, the Size member will allow validating
727  // the various versions, and initializeing the structure correctly.
728  //
730  sizeof(WMI_WDF_NOTIFY_ROUTINES));
731 #else
732  status = STATUS_SUCCESS; // __REACTOS__
733 #endif // EVENT_TRACING
734 #else
736 #endif
737 
738  return status;
739 }
740 
741 VOID
743  VOID
744  )
745 {
746  //
747  // Assure the all driver's FxDriverGlobals have been freed.
748  //
750 
751 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
752  //
753  // Cleanup for the driver usage tracker.
754  //
756 
757  //
758  // Deregister from the global (library) bugcheck callbacks.
759  //
761 #endif
762 
764 
765  return;
766 }
767 
768 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
769 //
770 // This function is only used to lock down verifier section code in memory.
771 // It uses the #pragma alloc_text(...) style for paging.
772 //
773 VOID
775  VOID
776  )
777 {
779  DO_NOTHING();
780 }
781 
782 VOID
784  _In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
786  )
787 {
788  LONG count;
789 
790  //
791  // This asserts makes sure the struct is not pack(1) and the counter
792  // is correctly aligned on a 32 bit boundary.
793  //
794  C_ASSERT((FIELD_OFFSET(FxLibraryGlobalsType, VerifierSectionHandleRefCount)
795  % __alignof(LONG)) == 0);
796 
798  ASSERT(count > 0);
799 
800  //
801  // If verifier section is unlocked, lock it in.
802  //
804  //
805  //First time verifier section is being locked.
806  //
808  "First time Locking (%d) in Verifier Paged Memory "
809  "from %!wZ! from driver globals %p",
810  count, RegistryPath, FxDriverGlobals);
811  //
812  // VerifierLockHandle is a function that we use to lock in all the code from it's section
813  // since all the verifier code is in the same section as VerifierLockHandle.
814  //
816  }
817  else {
818  MmLockPagableSectionByHandle(FxLibraryGlobals.VerifierSectionHandle);
820  "Increment Lock counter (%d) for Verifier Paged Memory "
821  "from %!wZ! from driver globals %p",
822  count, RegistryPath, FxDriverGlobals);
823  }
824 }
825 
826 VOID
828  _In_ PFX_DRIVER_GLOBALS FxDriverGlobals
829  )
830 {
832  LONG count;
833 
835  ASSERT(count >= 0);
836 
837  MmUnlockPagableImageSection(FxLibraryGlobals.VerifierSectionHandle);
839  "Decrement UnLock counter (%d) for Verifier Paged Memory "
840  "with driver globals %p",
841  count, FxDriverGlobals);
842  }
843 }
844 #endif
845 
847 NTSTATUS
849  __inout PFX_DRIVER_GLOBALS FxDriverGlobals,
853  )
854 
855 /*++
856 
857 Routine Description:
858 
859  This is the global framework initialization routine.
860 
861  This is called when the framework is loaded, and by
862  any drivers that use the framework.
863 
864  It is safe to call if already initialized, to handle
865  cases where multiple drivers are sharing a common
866  kernel DLL.
867 
868  This method is used instead of relying on C++ static class
869  constructors in kernel mode.
870 
871 Arguments:
872 
873 
874 Returns:
875 
876  NTSTATUS
877 
878 --*/
879 
880 {
882  BOOLEAN windowsVerifierOn = FALSE;
883 
885 
886  //
887  // Check if windows driver verifier is on for this driver
888  // We need this when initializing wdf verifier
889  //
890  windowsVerifierOn = IsWindowsVerifierOn(DriverObject);
891 
892  //
893  // Get registry values first since these effect the
894  // rest of initialization
895  //
896  FxRegistrySettingsInitialize(FxDriverGlobals,
897  RegistryPath,
898  windowsVerifierOn);
899 
900  //
901  // Initialize IFR logging
902  //
903  // FxIFRStart(FxDriverGlobals, RegistryPath, DriverObject); __REACTOS__
904 
906  "Initialize globals for %!wZ!", RegistryPath);
907 
908  //
909  // Only first one initializes the frameworks globals
910  //
911  status = FxPoolPackageInitialize(FxDriverGlobals);
912  if (!NT_SUCCESS(status)) {
913  //
914  // FxPoolPackageInitialize logs a message in case of failure so
915  // we don't need to log failure here.
916  //
917  // FxIFRStop(FxDriverGlobals); __REACTOS__
918  return status;
919  }
920 
921  //
922  // Lock verifier package
923  //
924  FxVerifierLockInitialize(FxDriverGlobals);
925 
926 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
927  //
928  // Cache driver info for bugcheck callback.
929  //
930  FxCacheBugCheckDriverInfo(FxDriverGlobals);
931 
932  //
933  // Register for bugcheck callbacks.
934  //
935  FxRegisterBugCheckCallback(FxDriverGlobals, DriverObject);
936 #endif
937 
938  if (NULL != RegistryPath) {
939  if (FALSE == FxDriverGlobals->IsCorrectVersionRegistered(RegistryPath))
940  FxDriverGlobals->RegisterClientVersion(RegistryPath);
941  }
942 
943 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
944  if(FxDriverGlobals->FxVerifierOn){
945  LockVerifierSection(FxDriverGlobals, RegistryPath);
946  }
947 #endif
948 
949  return STATUS_SUCCESS;
950 }
951 
952 BOOLEAN
955  )
956 {
957  BOOLEAN windowsVerifierOn = FALSE;
958 
959 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
960  //
961  // Check if windows driver verifier is on for this driver
962  // We need this when initializing wdf verifier
963  //
964  windowsVerifierOn = MmIsDriverVerifying(DriverObject) ? TRUE: FALSE;
965 
966 #else
968 
969  //
970  // For user-mode we check if app verifier's verifier.dll is loaded in this
971  // process (since app verifier doesn't provide any other way to detect its
972  // presence).
973  //
974  windowsVerifierOn = (GetModuleHandleW(L"verifier.dll") == NULL ? FALSE : TRUE);
975 #endif
976 
977  return windowsVerifierOn;
978 }
979 
980 VOID
982  __in PFX_DRIVER_GLOBALS FxDriverGlobals
983  )
984 
985 /*++
986 
987 Routine Description:
988 
989  This is the global framework uninitialization routine.
990 
991  It is here for symmetry, and to allow a shared DLL based frameworks
992  to unload safely.
993 
994 Arguments:
995 
996 
997 Returns:
998 
999  NTSTATUS
1000 
1001 --*/
1002 
1003 {
1004  //
1005  // Release the last reference.
1006  //
1007  FxDriverGlobals->RELEASE((PVOID)FxDestroy);
1008 
1009  //
1010  // Wait for everyone else to be done.
1011  //
1012  Mx::MxEnterCriticalRegion();
1013  FxDriverGlobals->DestroyEvent.WaitFor(Executive, KernelMode, FALSE, NULL);
1014  Mx::MxLeaveCriticalRegion();
1015 
1016  //
1017  // Lock verifier package
1018  //
1019  FxVerifierLockDestroy(FxDriverGlobals);
1020 
1021  //
1022  // Cleanup frameworks structures
1023  //
1024  FxPoolPackageDestroy(FxDriverGlobals);
1025 
1026 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
1027  //
1028  // Deregister from the bugcheck callbacks.
1029  //
1030  FxUnregisterBugCheckCallback(FxDriverGlobals);
1031 
1032  //
1033  // Purge driver info from bugcheck data.
1034  //
1035  FxPurgeBugCheckDriverInfo(FxDriverGlobals);
1036 #endif
1037 
1038 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
1039  //
1040  // unlock verifier image sections
1041  //
1042  if(FxDriverGlobals->FxVerifierOn){
1043  UnlockVerifierSection(FxDriverGlobals);
1044  }
1045 #endif
1046 
1047  return;
1048 }
1049 
1053  VOID
1054  )
1055 {
1057  // KIRQL irql;
1058  NTSTATUS status;
1059 
1062 
1063  if (pFxDriverGlobals == NULL) {
1064  return NULL;
1065  }
1066 
1067  *pFxDriverGlobals = {};
1068 
1069  pFxDriverGlobals->Refcnt = 1;
1070 
1072 #if (FX_CORE_MODE==FX_CORE_USER_MODE)
1073  if (!NT_SUCCESS(status)) {
1075  return NULL;
1076  }
1077 #else
1079 #endif
1080 
1081  //
1082  // Initialize this new FxDriverGlobals structure.
1083  //
1084 #ifndef __REACTOS__
1089 #endif
1090 
1097 
1098  //
1099  // Verifier settings. Off by default.
1100  //
1102 
1103  //
1104  // By default don't apply latest-version restricted verifier checks
1105  // to downlevel version drivers.
1106  //
1108 
1109  //
1110  // Verbose is separate knob
1111  //
1113 
1114  //
1115  // Do not parent queue presented requests.
1116  // This performance optimization is on by default.
1117  //
1119 
1120  //
1121  // Enhanced verifier options. Off by default
1122  //
1124 
1125  //
1126  // If FxVerifierDbgBreakOnError is true, WaitForSignal interrupts the
1127  // execution of the system after waiting for the specified number
1128  // of seconds. Developer will have an opportunity to validate the state
1129  // of the driver when breakpoint is hit. Developer can continue to wait
1130  // by entering 'g' in the debugger.
1131  //
1133 
1134  //
1135  // Timeout used by the wake interrupt ISR in WaitForSignal to catch
1136  // scenarios where the interrupt ISR is blocked because the device stack
1137  // is taking too long to power up
1138  //
1140 
1141  //
1142  // Minidump log related settings.
1143  //
1145 
1146 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1147  // pFxDriverGlobals->FxTrackDriverForMiniDumpLog = TRUE;
1150 #else
1153 #endif
1154 
1155 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1156  //
1157  // Minidump driver info related settings.
1158  //
1160 #endif
1161 
1162  //
1163  // By default disable the support for device simulation framework (DSF).
1164  //
1166 
1167  //
1168  // Allocate a telemetry context if a telemetry client is enabled, for any level/keyword.
1169  //
1171 #ifdef EVENT_TRACING // __REACTOS__
1172  if (TraceLoggingProviderEnabled(g_TelemetryProvider, 0 ,0)) {
1174  }
1175 #endif
1176 
1177  return &pFxDriverGlobals->Public;
1178 }
1179 
1180 VOID
1183  )
1184 {
1186  KIRQL irql;
1187 
1189 
1194 
1196 
1198 
1202  }
1203 
1205 
1208  }
1209 
1210  //
1211  // Cleanup event b/c d'tor is not called for MxAllocatePoolWithTag.
1212  //
1214 
1218  }
1219 
1221 }
1222 
1226  __in HANDLE Key,
1227  __in PFX_DRIVER_GLOBALS FxDriverGlobals
1228  )
1229 
1230 /*++
1231 
1232 Routine Description:
1233  Attempts to open a value under the passed in key and create an array of
1234  FxObjectDebugInfo.
1235 
1236 Arguments:
1237  Key - Registry key to query the value for
1238 
1239 Return Value:
1240  NULL or a pointer which should be freed by the caller using ExFreePool
1241 
1242 --*/
1243 
1244 {
1245  FxObjectDebugInfo* pInfo;
1246  PVOID dataBuffer;
1247  NTSTATUS status;
1248  ULONG length, type;
1249  DECLARE_CONST_UNICODE_STRING(valueName, L"TrackHandles");
1250 
1251  pInfo = NULL;
1252  type = REG_MULTI_SZ;
1253  length = 0;
1254 
1255  //
1256  // Find out how big a buffer we need to allocate if the value is present
1257  //
1258  status = FxRegKey::_QueryValue(FxDriverGlobals,
1259  Key,
1260  &valueName,
1261  length,
1262  NULL,
1263  &length,
1264  &type);
1265 
1266  //
1267  // We expect the list to be bigger then a standard partial, so if it is
1268  // not, just bail now.
1269  //
1271  return NULL;
1272  }
1273 
1274  //
1275  // Pool can be paged b/c we are running at PASSIVE_LEVEL and we are going
1276  // to free it at the end of this function.
1277  //
1278  dataBuffer = MxMemory::MxAllocatePoolWithTag(PagedPool, length, FxDriverGlobals->Tag);
1279  if (dataBuffer == NULL) {
1280  return NULL;
1281  }
1282 
1283  //
1284  // Requery now that we have a big enough buffer
1285  //
1286  status = FxRegKey::_QueryValue(FxDriverGlobals,
1287  Key,
1288  &valueName,
1289  length,
1290  dataBuffer,
1291  &length,
1292  &type);
1293  if (NT_SUCCESS(status)) {
1294  //
1295  // Verify that the data from the registry is a valid multi-sz string.
1296  //
1297  status = FxRegKey::_VerifyMultiSzString(FxDriverGlobals,
1298  &valueName,
1299  (PWCHAR) dataBuffer,
1300  length);
1301  }
1302 
1303  if (NT_SUCCESS(status)) {
1304 #pragma prefast(push)
1305 #pragma prefast(suppress:__WARNING_PRECONDITION_NULLTERMINATION_VIOLATION, "FxRegKey::_VerifyMultiSzString makes sure the string is NULL-terminated")
1306  pInfo = FxVerifyAllocateDebugInfo((LPWSTR) dataBuffer, FxDriverGlobals);
1307 #pragma prefast(pop)
1308 
1309  }
1310 
1312 
1313  return pInfo;
1314 }
1315 
1316 VOID
1318  __in HANDLE Key,
1319  __out FxTrackPowerOption* TrackPower
1320  )
1321 {
1322  NTSTATUS status;
1323  ULONG value = 0;
1324  DECLARE_CONST_UNICODE_STRING(valueName, L"TrackPower");
1325 
1326  status = FxRegKey::_QueryULong(Key, &valueName, &value);
1328  *TrackPower = (FxTrackPowerOption)value;
1329  }
1330  else {
1331  *TrackPower = FxTrackPowerNone;
1332  }
1333 }
1334 
1335 VOID
1337  __in HANDLE Key,
1338  __in LPWSTR Name,
1339  __out PBOOLEAN OverrideValue
1340  )
1341 {
1342  UNICODE_STRING valueName;
1343  ULONG value = 0;
1344 
1345  RtlInitUnicodeString(&valueName, Name);
1346 
1347  if (NT_SUCCESS(FxRegKey::_QueryULong(Key,
1348  (PCUNICODE_STRING)&valueName,
1349  &value))) {
1350  if (value) {
1351  *OverrideValue = TRUE;
1352  } else {
1353  *OverrideValue = FALSE;
1354  }
1355  }
1356 
1357 }
1358 
1359 
1360 VOID
1362  __inout PFX_DRIVER_GLOBALS FxDriverGlobals,
1364  __in BOOLEAN WindowsVerifierOn
1365  )
1366 
1367 /*++
1368 
1369 Routine Description:
1370 
1371  Initialize Driver Framework settings from the driver
1372  specific registry settings under
1373 
1374  \REGISTRY\MACHINE\SYSTEM\ControlSetxxx\Services<driver>\Parameters\Wdf
1375 
1376 Arguments:
1377 
1378  RegistryPath - Registry path passed to DriverEntry
1379 
1380 --*/
1381 
1382 {
1383  NTSTATUS status;
1384  RTL_QUERY_REGISTRY_TABLE paramTable[10];
1385  ULONG verifierOnValue;
1386  ULONG verifyDownlevelValue;
1387  ULONG verboseValue;
1388  ULONG allocateFailValue;
1389  ULONG forceLogsInMiniDump;
1390  ULONG trackDriverForMiniDumpLog;
1391  ULONG requestParentOptimizationOn;
1392  ULONG dsfValue;
1393  ULONG removeLockOptionFlags;
1394  ULONG zero = 0;
1395  ULONG max = 0xFFFFFFFF;
1396  ULONG defaultTrue = (ULONG) TRUE;
1397  ULONG i;
1398  ULONG timeoutValue = 0;
1399  FxAutoRegKey hDriver, hWdf;
1400  DECLARE_CONST_UNICODE_STRING(parametersPath, L"Parameters\\Wdf");
1401 
1402  typedef NTSTATUS NTAPI QUERYFN(
1404 
1405  QUERYFN* queryFn;
1406 
1407 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1409 #endif
1410 
1411  //
1412  // UMDF may not provide this registry path
1413  //
1414  if (NULL == RegistryPath) {
1415  return;
1416  }
1417 
1418  status = FxRegKey::_OpenKey(NULL, RegistryPath, &hDriver.m_Key, KEY_READ);
1419  if (!NT_SUCCESS(status)) {
1420  return;
1421  }
1422 
1423  status = FxRegKey::_OpenKey(hDriver.m_Key, &parametersPath, &hWdf.m_Key, KEY_READ);
1424  if (!NT_SUCCESS(status)) {
1425  //
1426  // For version >= 1.9 we enable WDF verifier automatically when driver
1427  // verifier or app verifier is enabled. Since inbox drivers may not have
1428  // WDF subkey populated as they may not use INF, we need to enable
1429  // verifier even if we fail to open wdf subkey (if DriverVerifier is on).
1430  //
1431  if (FxDriverGlobals->IsVersionGreaterThanOrEqualTo(1,9)) {
1432  //
1433  // Verifier settings are all or nothing. We currently do not support
1434  // turning on individual sub-verifiers.
1435  //
1436  FxDriverGlobals->SetVerifierState(WindowsVerifierOn);
1437  if (FxDriverGlobals->FxVerifierOn) {
1439  }
1440  }
1441 
1442  return;
1443  }
1444 
1445  RtlZeroMemory (&paramTable[0], sizeof(paramTable));
1446  i = 0;
1447 
1448  verboseValue = 0;
1449 
1450  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1451  paramTable[i].Name = L"VerboseOn";
1452  paramTable[i].EntryContext = &verboseValue;
1453  paramTable[i].DefaultType = REG_DWORD;
1454  paramTable[i].DefaultData = &zero;
1455  paramTable[i].DefaultLength = sizeof(ULONG);
1456 
1457  allocateFailValue = (ULONG) -1;
1458  i++;
1459 
1460  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1461  paramTable[i].Name = L"VerifierAllocateFailCount";
1462  paramTable[i].EntryContext = &allocateFailValue;
1463  paramTable[i].DefaultType = REG_DWORD;
1464  paramTable[i].DefaultData = &max;
1465  paramTable[i].DefaultLength = sizeof(ULONG);
1466 
1467  verifierOnValue = 0;
1468 
1469  //
1470  // If the client version is 1.9 or above, the defaut (i.e when
1471  // the key is not present) VerifierOn state is tied to the
1472  // driver verifier.
1473  //
1474  if (FxDriverGlobals->IsVersionGreaterThanOrEqualTo(1,9)) {
1475  verifierOnValue = WindowsVerifierOn;
1476  }
1477 
1478  i++;
1479 
1480  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1481  paramTable[i].Name = L"VerifierOn";
1482  paramTable[i].EntryContext = &verifierOnValue;
1483  paramTable[i].DefaultType = REG_DWORD;
1484  paramTable[i].DefaultData = &verifierOnValue;
1485  paramTable[i].DefaultLength = sizeof(ULONG);
1486 
1487  verifyDownlevelValue = 0;
1488  i++;
1489 
1490  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1491  paramTable[i].Name = L"VerifyDownLevel";
1492  paramTable[i].EntryContext = &verifyDownlevelValue;
1493  paramTable[i].DefaultType = REG_DWORD;
1494  paramTable[i].DefaultData = &zero;
1495  paramTable[i].DefaultLength = sizeof(ULONG);
1496 
1497  forceLogsInMiniDump = 0;
1498  i++;
1499 
1500  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1501  paramTable[i].Name = L"ForceLogsInMiniDump";
1502  paramTable[i].EntryContext = &forceLogsInMiniDump;
1503  paramTable[i].DefaultType = REG_DWORD;
1504  paramTable[i].DefaultData = &zero;
1505  paramTable[i].DefaultLength = sizeof(ULONG);
1506 
1507  //
1508  // Track driver for minidump log:
1509  // Default for KMDF is on.
1510  // Default for UMDF is off.
1511  //
1512 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1513  trackDriverForMiniDumpLog = (ULONG) TRUE;
1514 #else
1515  trackDriverForMiniDumpLog = 0;
1516 #endif
1517  i++;
1518 
1519  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1520  paramTable[i].Name = L"TrackDriverForMiniDumpLog";
1521  paramTable[i].EntryContext = &trackDriverForMiniDumpLog;
1522  paramTable[i].DefaultType = REG_DWORD;
1523 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1524  paramTable[i].DefaultData = &defaultTrue;
1525 #else
1526  paramTable[i].DefaultData = &zero;
1527 #endif
1528  paramTable[i].DefaultLength = sizeof(ULONG);
1529 
1530  requestParentOptimizationOn = (ULONG) TRUE;
1531  i++;
1532 
1533  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1534  paramTable[i].Name = L"RequestParentOptimizationOn";
1535  paramTable[i].EntryContext = &requestParentOptimizationOn;
1536  paramTable[i].DefaultType = REG_DWORD;
1537  paramTable[i].DefaultData = &defaultTrue;
1538  paramTable[i].DefaultLength = sizeof(ULONG);
1539 
1540  dsfValue = 0;
1541  i++;
1542 
1543  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1544  paramTable[i].Name = L"DsfOn";
1545  paramTable[i].EntryContext = &dsfValue;
1546  paramTable[i].DefaultType = REG_DWORD;
1547  paramTable[i].DefaultData = &zero;
1548  paramTable[i].DefaultLength = sizeof(ULONG);
1549 
1550  removeLockOptionFlags = 0;
1551  i++;
1552 
1553  paramTable[i].Flags = RTL_QUERY_REGISTRY_DIRECT;
1554  paramTable[i].Name = L"RemoveLockOptionFlags";
1555  paramTable[i].EntryContext = &removeLockOptionFlags;
1556  paramTable[i].DefaultType = REG_DWORD;
1557  paramTable[i].DefaultData = &zero;
1558  paramTable[i].DefaultLength = sizeof(ULONG);
1559 
1560  ASSERT(i < sizeof(paramTable) / sizeof(paramTable[0]));
1561 
1562 #if (FX_CORE_MODE==FX_CORE_USER_MODE)
1563 
1564  queryFn = (QUERYFN*) GetProcAddress(
1565  GetModuleHandle(TEXT("ntdll.dll")),
1566  "RtlQueryRegistryValuesEx"
1567  );
1568 
1569 #else
1570 
1571  RtlInitUnicodeString(&FunctionName, L"RtlQueryRegistryValuesEx");
1572 
1573 #pragma warning(push)
1574 #pragma warning(disable: 4055)
1575 
1576  queryFn = (QUERYFN*)MmGetSystemRoutineAddress(&FunctionName);
1577 
1578 #pragma warning(pop)
1579 
1580 #endif
1581 
1582  if (queryFn == NULL) {
1583  queryFn = &RtlQueryRegistryValues;
1584  }
1585 
1586  status = queryFn(
1588  (PWSTR) hWdf.m_Key,
1589  &paramTable[0],
1590  NULL,
1591  NULL
1592  );
1593 
1594  //
1595  // Only examine key values on success
1596  //
1597  if (NT_SUCCESS(status)) {
1598 
1599  if (verboseValue) {
1600  FxDriverGlobals->FxVerboseOn = TRUE;
1601  }
1602  else {
1603  FxDriverGlobals->FxVerboseOn = FALSE;
1604  }
1605 
1606  if (allocateFailValue != (ULONG) -1) {
1607  FxDriverGlobals->WdfVerifierAllocateFailCount = (LONG) allocateFailValue;
1608  }
1609  else {
1610  FxDriverGlobals->WdfVerifierAllocateFailCount = -1;
1611  }
1612 
1613  //
1614  // Verifier settings are all or nothing. We currently do not support
1615  // turning on individual sub-verifiers.
1616  //
1617  FxDriverGlobals->SetVerifierState(verifierOnValue ? TRUE : FALSE);
1618 
1619  if (FxDriverGlobals->FxVerifierOn) {
1620  FxDriverGlobalsInitializeDebugExtension(FxDriverGlobals, hWdf.m_Key);
1621  }
1622 
1623  //
1624  // Update FxVerifyDownLevel independent of FxVerifyOn because for UMDF
1625  // verifer is always on so it does not consume FxVerifyOn value
1626  //
1627  if (verifyDownlevelValue) {
1628  FxDriverGlobals->FxVerifyDownlevel = TRUE;
1629  }
1630  else {
1631  FxDriverGlobals->FxVerifyDownlevel = FALSE;
1632  }
1633 
1634  //
1635  // See if there exists an override in the registry for WDFVERIFY state.
1636  // We query for this separately so that we can establish a default state
1637  // based on verifierOnValue, and then know if the value was present in
1638  // the registry to override the default.
1639  //
1641  L"VerifyOn",
1642  &FxDriverGlobals->FxVerifyOn);
1643 
1644  if (FxDriverGlobals->FxVerifyOn) {
1645  FxDriverGlobals->Public.DriverFlags |= WdfVerifyOn;
1646  }
1647 
1649  L"DbgBreakOnError",
1650  &FxDriverGlobals->FxVerifierDbgBreakOnError);
1651 
1653  L"DbgBreakOnDeviceStateError",
1654  &FxDriverGlobals->FxVerifierDbgBreakOnDeviceStateError);
1655 
1656  if (FxDriverGlobals->FxVerifierDbgBreakOnError) {
1657  timeoutValue = 0;
1658  DECLARE_CONST_UNICODE_STRING(timeoutName, L"DbgWaitForSignalTimeoutInSec");
1659 
1660  //
1661  // Get the override value for the WaitForSignal's timeout if present.
1662  //
1663  if (NT_SUCCESS(FxRegKey::_QueryULong(hWdf.m_Key,
1664  &timeoutName,
1665  &timeoutValue))) {
1666 
1667  FxDriverGlobals->FxVerifierDbgWaitForSignalTimeoutInSec = timeoutValue;
1668  }
1669  }
1670 
1671  timeoutValue = 0;
1672  DECLARE_CONST_UNICODE_STRING(timeoutName, L"DbgWaitForWakeInterruptIsrTimeoutInSec");
1673 
1674  //
1675  // Get the override value for the Wake Interrupt ISR timeout if present.
1676  // Since the wake interrupt feature is only supported for 1.13 and higher,
1677  // avoid querying the reg key for older versions
1678  //
1679  if (FxDriverGlobals->IsVersionGreaterThanOrEqualTo(1,13) &&
1680  NT_SUCCESS(FxRegKey::_QueryULong(hWdf.m_Key,
1681  &timeoutName,
1682  &timeoutValue))) {
1683 
1684  FxDriverGlobals->DbgWaitForWakeInterruptIsrTimeoutInSec = timeoutValue;
1685  }
1686 
1687  FxDriverGlobals->FxForceLogsInMiniDump =
1688  (forceLogsInMiniDump) ? TRUE : FALSE;
1689 
1690  FxDriverGlobals->FxTrackDriverForMiniDumpLog =
1691  (trackDriverForMiniDumpLog) ? TRUE : FALSE;
1692 
1693  FxDriverGlobals->FxRequestParentOptimizationOn =
1694  (requestParentOptimizationOn) ? TRUE : FALSE;
1695 
1696  FxDriverGlobals->FxDsfOn = (dsfValue) ? TRUE : FALSE;
1697 
1698  FxDriverGlobals->RemoveLockOptionFlags = removeLockOptionFlags;
1699  }
1700 
1701  return;
1702 }
1703 
1704 VOID
1706  __in MxEvent* Event,
1707  __in PCSTR ReasonForWaiting,
1709  __in ULONG WarningTimeoutInSec,
1711  )
1712 {
1713  LARGE_INTEGER timeOut;
1714  NTSTATUS status;
1715 
1717 
1718  timeOut.QuadPart = WDF_REL_TIMEOUT_IN_SEC(((ULONGLONG)WarningTimeoutInSec));
1719 
1720  do {
1721  status = Event->WaitFor(Executive,
1722  KernelMode,
1723  FALSE, // Non alertable
1724  timeOut.QuadPart ? &timeOut : NULL);
1725 
1726  if(status == STATUS_TIMEOUT) {
1727  DbgPrint("Thread 0x%p is %s 0x%p\n",
1729  ReasonForWaiting,
1730  Handle);
1731 
1736  IsDebuggerAttached())) {
1737 
1738  DbgBreakPoint();
1739  }
1740  } else {
1742  break;
1743  }
1744  } WHILE(TRUE);
1745 }
1746 
1747 } // extern "C"
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
Definition: globals.cpp:783
__inline VOID Uninitialize()
Definition: mxeventkm.h:146
#define VER_MINORVERSION
Definition: rtltypes.h:226
PFN_KE_SET_COALESCABLE_TIMER KeSetCoalescableTimer
Definition: fxglobals.h:738
ObjectType
Definition: metafile.c:80
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
VOID(STDCALL * PFN_VF_CHECK_NX_POOL_TYPE)(_In_ POOL_TYPE PoolType, _In_ PVOID CallingAddress, _In_ ULONG PoolTag)
Definition: fxglobalskm.h:315
_In_ ULONG TypeMask
Definition: rtlfuncs.h:4622
PFN_POX_UNREGISTER_DEVICE PoxUnregisterDevice
Definition: fxglobals.h:746
_Must_inspect_result_ PWDF_DRIVER_GLOBALS FxAllocateDriverGlobals(VOID)
Definition: globals.cpp:1052
BOOLEAN FxTrackDriverForMiniDumpLog
Definition: fxglobals.h:483
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define max(a, b)
Definition: svc.c:63
#define FLAG_TO_BOOL(_Flags, _FlagMask)
Definition: fxobject.hpp:125
Definition: pdh_main.c:93
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
MxEvent DestroyEvent
Definition: fxglobals.h:351
FxObjectDebugInfo * ObjectDebugInfo
Definition: fxglobals.h:118
BOOLEAN FxRequestParentOptimizationOn
Definition: fxglobals.h:467
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:827
#define DbgPrint
Definition: hal.h:12
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
VOID(STDCALL * PFN_POX_START_DEVICE_POWER_MANAGEMENT)(__in POHANDLE Handle)
Definition: fxglobalskm.h:242
BOOLEAN FxVerboseOn
Definition: fxglobals.h:462
USHORT MaximumLength
Definition: env_spec_w32.h:370
const FX_OBJECT_INFO FxObjectsInfo[]
#define __in_opt
Definition: dbghelp.h:38
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
PFN_POX_REGISTER_DEVICE PoxRegisterDevice
Definition: fxglobals.h:742
uint16_t * PWSTR
Definition: typedefs.h:56
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WDF_GLOBAL_VALUE_IFRDISABLED
Definition: objectpriv.hpp:36
VOID SetVerifierState(__in BOOLEAN State)
Definition: fxglobals.h:236
BOOLEAN IsWindowsVerifierOn(_In_ MdDriverObject DriverObject)
Definition: globals.cpp:953
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
USHORT ObjectType
Definition: fxglobals.h:94
VOID(STDCALL * PFN_POX_REPORT_DEVICE_POWERED_ON)(__in POHANDLE Handle)
Definition: fxglobalskm.h:270
VOID FxFreeAllocatedMdlsDebugInfo(__in FxDriverGlobalsDebugExtension *DebugExtension)
Definition: globalskm.cpp:20
LONG WdfVerifierAllocateFailCount
Definition: fxglobals.h:362
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
ULONG DbgWaitForWakeInterruptIsrTimeoutInSec
Definition: fxglobals.h:534
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:981
BOOLEAN IsUserModeFramework
Definition: fxglobals.h:825
#define TRACINGDRIVER
Definition: dbgtrace.h:68
KIRQL irql
Definition: wave.h:1
FxDriverGlobalsDebugExtension * DebugExtension
Definition: fxglobals.h:376
VOID WaitForSignal(__in MxEvent *Event, __in PCSTR ReasonForWaiting, __in PVOID Handle, __in ULONG WarningTimeoutInSec, __in ULONG WaitSignalFlags)
Definition: globals.cpp:1705
DriverGlobals
uint16_t * PWCHAR
Definition: typedefs.h:56
VOID FxInitializeBugCheckDriverInfo()
RTL_OSVERSIONINFOEXW OsVersionInfo
Definition: fxglobals.h:770
LIST_ENTRY AllocatedTagTrackersListHead
Definition: fxglobals.h:134
PFN_POX_SET_DEVICE_IDLE_TIMEOUT PoxSetDeviceIdleTimeout
Definition: fxglobals.h:760
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED PoxCompleteDevicePowerNotRequired
Definition: fxglobals.h:758
BOOLEAN IsUserModeDriver
Definition: fxglobals.h:488
VOID(STDCALL * PFN_POX_UNREGISTER_DEVICE)(__in POHANDLE Handle)
Definition: fxglobalskm.h:248
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
BOOLEAN PassiveLevelInterruptSupport
Definition: fxglobals.h:820
PVOID dataBuffer
FxTrackPowerOption TrackPower
Definition: fxglobals.h:145
VOID FxPurgeBugCheckDriverInfo(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
KAFFINITY(STDCALL * PFN_KE_QUERY_ACTIVE_PROCESSORS)(VOID)
Definition: fxglobalskm.h:169
OSVERSIONINFOW VersionInfo
Definition: wkssvc.c:40
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
static __inline VOID MxFreePool(__in PVOID Ptr)
Definition: mxmemorykm.h:41
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
FX_DRIVER_TRACKER_CACHE_AWARE DriverTracker
Definition: fxglobals.h:812
VOID FxLibraryGlobalsVerifyVersion(VOID)
Definition: globals.cpp:423
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID FxFreeDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: globals.cpp:1181
#define L(x)
Definition: ntvdm.h:50
PVOID VerifierSectionHandle
Definition: fxglobals.h:842
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
LIST_ENTRY Linkage
Definition: fxglobals.h:339
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
Definition: fxpool.h:63
VOID NTAPI DbgBreakPoint(VOID)
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
_Must_inspect_result_ BOOLEAN FxVerifierGetTrackReferences(__in FxObjectDebugInfo *DebugInfo, __in WDFTYPE ObjectType)
Definition: globals.cpp:338
PFN_POX_ACTIVATE_COMPONENT PoxActivateComponent
Definition: fxglobals.h:748
PFN_POX_COMPLETE_IDLE_STATE PoxCompleteIdleState
Definition: fxglobals.h:754
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3514
static __inline PVOID MxAllocatePoolWithTag(__in POOL_TYPE PoolType, __in SIZE_T NumberOfBytes, __in ULONG Tag)
Definition: mxmemorykm.h:30
long LONG
Definition: pedump.c:60
PFN_POX_REPORT_DEVICE_POWERED_ON PoxReportDevicePoweredOn
Definition: fxglobals.h:752
VOID(STDCALL * PFN_IO_REPORT_INTERRUPT_INACTIVE)(_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters)
Definition: fxglobalskm.h:309
VOID(STDCALL * PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED)(__in POHANDLE Handle)
Definition: fxglobalskm.h:290
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define REG_MULTI_SZ
Definition: nt_native.h:1501
FxDriver * Driver
Definition: fxglobals.h:374
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLenum condition
Definition: glext.h:9255
#define __out
Definition: dbghelp.h:62
ULONG FxEnhancedVerifierOptions
Definition: fxglobals.h:518
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
unsigned char BOOLEAN
_Must_inspect_result_ NTSTATUS FxPoolPackageInitialize(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: wdfpool.cpp:667
int zero
Definition: sehframes.cpp:29
#define FX_TAG
Definition: fxmacros.hpp:155
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
Definition: mxgeneralkm.h:226
#define _In_
Definition: ms_sal.h:308
#define C_ASSERT(e)
Definition: intsafe.h:73
#define RTL_REGISTRY_OPTIONAL
Definition: nt_native.h:169
IN ULONG IN UCHAR Condition
DECLSPEC_SELECTANY const ULONG_PTR FxHandleValueMask
NTSTATUS(* PFN_RTL_VERIFY_VERSION_INFO)(__in PRTL_OSVERSIONINFOEXW VersionInfo, __in ULONG TypeMask, __in ULONGLONG ConditionMask)
Definition: globals.cpp:408
PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX IoUnregisterPlugPlayNotificationEx
Definition: fxglobals.h:740
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
VOID FxVerifyObjectTableIsSorted(VOID)
Definition: globals.cpp:381
PCSTR FxObjectTypeToHandleName(__in WDFTYPE ObjectType)
Definition: globals.cpp:316
FxTrackPowerOption
Definition: fxglobals.h:71
void FxVerifierLockInitialize(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID FxCacheBugCheckDriverInfo(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
NTSTATUS(* PFN_RTL_GET_VERSION)(__out PRTL_OSVERSIONINFOW VersionInformation)
Definition: globals.cpp:402
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define WHILE(constant)
Definition: fxmacros.hpp:226
#define ASSERT(a)
Definition: mode.c:44
VOID(STDCALL * PFN_POX_IDLE_COMPONENT)(__in POHANDLE Handle, __in ULONG Component, __in ULONG Flags)
Definition: fxglobalskm.h:262
#define MmLockPagableCodeSection(Address)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOLEAN MachineSleepStates[FxMachineSleepStatesMax]
Definition: fxglobals.h:836
VOID AllocAndInitializeTelemetryContext(_In_ PFX_TELEMETRY_CONTEXT *TelemetryContext)
uint64_t ULONGLONG
Definition: typedefs.h:67
VOID FxUninitializeBugCheckDriverInfo()
USHORT ObjectType
Definition: fxglobals.h:898
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
Definition: wdfcore.h:161
FX_POOL FxPoolFrameworks
Definition: globals.cpp:93
WaitSignalFlags
Definition: fxglobals.h:83
#define VER_MAJORVERSION
Definition: rtltypes.h:227
PFN_KE_SET_TARGET_PROCESSOR_DPC KeSetTargetProcessorDpc
Definition: fxglobals.h:736
__inline VOID Uninitialize()
Definition: mxlockkm.h:104
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission(VOID)
Definition: globals.cpp:494
PFN_VF_CHECK_NX_POOL_TYPE VfCheckNxPoolType
Definition: fxglobals.h:766
NTSTATUS NTAPI WmiQueryTraceInformation(IN TRACE_INFORMATION_CLASS TraceInformationClass, OUT PVOID TraceInformation, IN ULONG TraceInformationLength, OUT PULONG RequiredLength OPTIONAL, IN PVOID Buffer OPTIONAL)
Definition: wmi.c:338
union FxObjectDebugInfo::@4518 u
ULONG FxObjectsInfoCount
struct _test_info info[]
Definition: SetCursorPos.c:19
BOOLEAN ProcessorGroupSupport
Definition: fxglobals.h:798
std::wstring STRING
Definition: fontsub.cpp:33
PVOID DummyPerfTraceRoutines
Definition: fxglobals.h:863
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
_Must_inspect_result_ FxObjectDebugInfo * FxVerifierGetObjectDebugInfo(__in HANDLE Key, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:1225
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
#define InterlockedDecrement
Definition: armddk.h:52
_Must_inspect_result_ NTSTATUS Initialize()
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
VOID(STDCALL * PFN_POX_ACTIVATE_COMPONENT)(__in POHANDLE Handle, __in ULONG Component, __in ULONG Flags)
Definition: fxglobalskm.h:254
#define RTL_REGISTRY_HANDLE
Definition: nt_native.h:168
_Must_inspect_result_ NTSTATUS FxInitialize(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in MdDriverObject DriverObject, __in PCUNICODE_STRING RegistryPath, __in_opt PWDF_DRIVER_CONFIG DriverConfig)
Definition: globals.cpp:848
NTSTATUS(STDCALL * PFN_IO_CONNECT_INTERRUPT_EX)(__inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:98
#define __inout
Definition: dbghelp.h:50
VOID(STDCALL * PFN_IO_REPORT_INTERRUPT_ACTIVE)(_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters)
Definition: fxglobalskm.h:303
VOID VerifierPageLockHandle(VOID)
Definition: globals.cpp:774
VOID FxRegisterBugCheckCallback(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in PDRIVER_OBJECT DriverObject)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Must_inspect_result_
Definition: ms_sal.h:558
BOOLEAN FxVerifierDbgBreakOnError
Definition: fxglobals.h:431
VOID FxLibraryGlobalsDecommission(VOID)
Definition: globals.cpp:742
char string[160]
Definition: util.h:11
#define VER_GREATER_EQUAL
Definition: rtltypes.h:239
#define MAKE_MX_FUNC_NAME(x)
Definition: mxgeneralkm.h:26
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
Definition: wdfcore.h:62
_Must_inspect_result_ BOOLEAN IsDebuggerAttached(VOID)
Definition: globalskm.cpp:250
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
#define TEXT(s)
Definition: k32.h:26
ULONGLONG(* PFN_VER_SET_CONDITION_MASK)(__in ULONGLONG ConditionMask, __in ULONG TypeMask, __in UCHAR Condition)
Definition: globals.cpp:416
#define InterlockedIncrement
Definition: armddk.h:53
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
PFX_TELEMETRY_CONTEXT TelemetryContext
Definition: fxglobals.h:540
#define GetModuleHandle
Definition: winbase.h:3683
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG FxVerifierDbgWaitForSignalTimeoutInSec
Definition: fxglobals.h:527
unsigned short USHORT
Definition: pedump.c:61
SINGLE_LIST_ENTRY * pCur
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
FxLibraryGlobalsType * LibraryGlobals
Definition: fxglobals.h:378
PFN_IO_DISCONNECT_INTERRUPT_EX IoDisconnectInterruptEx
Definition: fxglobals.h:732
USHORT WDFTYPE
Definition: fxtypes.h:29
LOGICAL NTAPI MmIsDriverVerifying(IN PDRIVER_OBJECT DriverObject)
Definition: drvmgmt.c:212
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
NTSTATUS(STDCALL * PFN_POX_REGISTER_DEVICE)(__in MdDeviceObject Pdo, __in PPO_FX_DEVICE PoxDevice, __out POHANDLE *Handle)
Definition: fxglobalskm.h:234
PFN_IO_REPORT_INTERRUPT_ACTIVE IoReportInterruptActive
Definition: fxglobals.h:762
#define NULL
Definition: types.h:112
BOOLEAN(STDCALL * PFN_KE_SET_COALESCABLE_TIMER)(__inout PKTIMER Timer, __in LARGE_INTEGER DueTime, __in ULONG Period, __in ULONG TolerableDelay, __in_opt PKDPC Dpc)
Definition: mxtimerkm.h:29
VOID FxUnregisterBugCheckCallback(__inout PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID FxDriverGlobalsInitializeDebugExtension(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt HANDLE Key)
Definition: globals.cpp:271
PFN_KE_QUERY_ACTIVE_PROCESSORS KeQueryActiveProcessors
Definition: fxglobals.h:734
_In_ ULONG _In_ ULONGLONG ConditionMask
Definition: rtlfuncs.h:4622
VOID FxLibraryGlobalsQueryRegistrySettings(VOID)
Definition: globals.cpp:464
const CHAR * HandleName
Definition: fxglobals.h:887
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
Definition: acpixf.h:1274
VOID FxPoolPackageDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: wdfpool.cpp:689
BOOLEAN FxVerifyDownlevel
Definition: fxglobals.h:426
VOID FxRegistrySettingsInitialize(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegistryPath, __in BOOLEAN WindowsVerifierOn)
Definition: globals.cpp:1361
static _Must_inspect_result_ NTSTATUS _VerifyMultiSzString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegValueName, __in_bcount(DataLength) PWCHAR DataString, __in ULONG DataLength)
Definition: fxregkey.cpp:14
_In_ HANDLE Handle
Definition: extypes.h:390
VOID FxVerifierQueryTrackPower(__in HANDLE Key, __out FxTrackPowerOption *TrackPower)
Definition: globals.cpp:1317
unsigned int ULONG
Definition: retypes.h:1
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_STATE)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:276
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
volatile LONG VerifierSectionHandleRefCount
Definition: fxglobals.h:848
#define GetProcAddress(x, y)
Definition: compat.h:612
VOID FxOverrideDefaultVerifierSettings(__in HANDLE Key, __in LPWSTR Name, __out PBOOLEAN OverrideValue)
Definition: globals.cpp:1336
const char * PCSTR
Definition: typedefs.h:52
PFN_IO_CONNECT_INTERRUPT_EX IoConnectInterruptEx
Definition: fxglobals.h:730
NTSTATUS(STDCALL * PFN_IO_DISCONNECT_INTERRUPT_EX)(__in PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:104
#define STATUS_SUCCESS
Definition: shellext.h:65
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
VOID(STDCALL * PFN_POX_SET_DEVICE_IDLE_TIMEOUT)(__in POHANDLE Handle, __in ULONGLONG IdleTimeout)
Definition: fxglobalskm.h:296
void exit(int exitcode)
Definition: _exit.c:33
WCHAR * LPWSTR
Definition: xmlstorage.h:184
ULONG_PTR WdfHandleMask
Definition: fxglobals.h:356
__inline VOID Initialize()
Definition: mxlockkm.h:43
#define WDF_REGISTRY_BASE_PATH
Definition: corepriv.hpp:31
NTSTATUS(STDCALL * PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX)(__in PVOID NotificationEntry)
Definition: fxglobalskm.h:228
#define __in
Definition: dbghelp.h:35
#define REG_DWORD
Definition: sdbapi.c:596
PFN_POX_IDLE_COMPONENT PoxIdleComponent
Definition: fxglobals.h:750
VOID(STDCALL * PFN_KE_SET_TARGET_PROCESSOR_DPC)(__in PRKDPC Dpc, __in CCHAR Number)
Definition: fxglobalskm.h:175
static SERVICE_STATUS status
Definition: service.c:31
struct _FX_DRIVER_GLOBALS * PFX_DRIVER_GLOBALS
Definition: fxforward.hpp:7
PFN_IO_REPORT_INTERRUPT_INACTIVE IoReportInterruptInactive
Definition: fxglobals.h:764
void FxVerifierLockDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_CONDITION)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:283
#define RTL_QUERY_REGISTRY_DIRECT
Definition: nt_native.h:144
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:213
_Must_inspect_result_ BOOLEAN FxVerifyObjectTypeInTable(__in USHORT ObjectType)
Definition: globals.cpp:117
PFN_POX_COMPLETE_IDLE_CONDITION PoxCompleteIdleCondition
Definition: fxglobals.h:756
PFN_POX_START_DEVICE_POWER_MANAGEMENT PoxStartDevicePowerManagement
Definition: fxglobals.h:744
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG BugCheckDriverInfoIndex
Definition: fxglobals.h:506
BOOLEAN FxForceLogsInMiniDump
Definition: fxglobals.h:477
LIST_ENTRY FxDriverGlobalsList
Definition: fxglobals.h:774
#define DO_NOTHING()
Definition: mxgeneral.h:32
MxLockNoDynam FxDriverGlobalsListLock
Definition: fxglobals.h:772
_Must_inspect_result_ FxObjectDebugInfo * FxVerifyAllocateDebugInfo(__in LPWSTR HandleNameList, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:139
Definition: ps.c:97