ReactOS  0.4.15-dev-3299-gbe8e5fc
fxglobals.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxGlobals.h
8 
9 Abstract:
10 
11  This module contains globals definitions for the frameworks.
12 
13 Author:
14 
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24  Made it mode agnostic
25  Moved km specific portions to FxGlobalsKm.h
26 
27 
28 
29 
30 
31 
32 
33 
34 
35  New failure paths:
36  AllocatedTagTrackersLock initialization -
37  If this fails we free debug extensions structure and not use it
38  ThreadTableLock initialization -
39  If this fails we turn off lock verification
40  FxDriverGlobalsListLock initialization -
41  If this fails we fail FxLibraryGlobalsCommission
42 
43 --*/
44 
45 #ifndef _FXGLOBALS_H
46 #define _FXGLOBALS_H
47 
48 #include "wdfglobals.h"
49 #include <debug.h>
50 
51 // REACTOS
52 #define ROSWDFNOTIMPLEMENTED (DbgPrint("(%s:%d) ReactOS KMDF: %s not implemented\n", __RELFILE__, __LINE__, __FUNCTION__))
53 // REACTOS
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
60 
61 class CWudfDriverGlobals; //UMDF driver globals
62 
63 //
64 // NOTE: any time you add a value to this enum, you must add a field to the
65 // union in FxObjectDebugInfo.
66 //
69 };
70 
71 typedef enum FxTrackPowerOption : UCHAR {
77 
82 
83 typedef enum WaitSignalFlags {
88 
89 
91  //
92  // FX_OBJECT_TYPES enum value
93  //
95 
96  union {
97  //
98  // Combo of values from FxObjectDebugInfoFlags
99  //
101 
102  //
103  // Break out of DebugFlags as individual fields. This is used by the
104  // debugger extension to reference the values w/out knowing the actual
105  // enum values.
106  //
107  struct {
109  } Bits;
110  } u;
111 };
112 
114  //
115  // Debug information per object. List is sorted by
116  // FxObjectDebugInfo::ObjectType, length is the same as FxObjectsInfo.
117  //
119 
120  //
121  // Track allocated Mdls only in kernel mode version
122  //
123 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
125 
127 #endif
128 
129  //
130  // List of all allocated tag trackers for this driver. This is used to keep
131  // track of orphaned objects due to leaked reference counts in the debugger
132  // extension.
133  //
135 
136  //
137  // Synchronizes access to AllocatedTagTrackersListHead
138  //
140 
141  //
142  // Whether we track power references for WDFDEVICE objects
143  // and optionally capture stack frames.
144  //
146 };
147 
148 //
149 // A telemetry context that is allocated if the telemetry provider is enabled.
150 //
151 typedef struct _FX_TELEMETRY_CONTEXT{
152  //
153  // A GUID representing the driver session
154  //
156 
157  //
158  // A general purpose bitmap that can be used
159  // by various telemetry events that may want to
160  // fire once per driver session.
161  //
164 
165 typedef struct _FX_DRIVER_GLOBALS {
166 public:
167  ULONG
168  __inline
171  __in LONG Line = 0,
173  )
174  {
175  ULONG c;
176 
180 
182 
183  //
184  // Catch the transition from 0 to 1. Since the RefCount starts off at 1,
185  // we should never have to increment to get to this value.
186  //
187  ASSERT(c > 1);
188  return c;
189  }
190 
191  ULONG
192  __inline
195  __in LONG Line = 0,
197  )
198  {
199  ULONG c;
200 
204 
206  ASSERT((LONG)c >= 0);
207  if (c == 0) {
208  DestroyEvent.Set();
209  }
210 
211  return c;
212  }
213 
214  BOOLEAN
216  VOID
217  )
218  {
219  return (FxPoolTrackingOn) ? TRUE : FALSE;
220  }
221 
222  BOOLEAN
224  VOID
225  )
226  {
227  if (FxVerifierHandle) {
228  return TRUE;
229  }
230  else {
231  return FALSE;
232  }
233  }
234 
235  VOID
238  )
239  {
240  //
241  // Master switch
242  //
244 
249 
250  //
251  // Following two can be overridden by the registry settings
252  // WDFVERIFY matches the state of the verifier.
253  //
254  FxVerifyOn = State;
257 
258  //
259  // Set the public flags for consumption by client drivers.
260  //
261  if (State) {
262  Public.DriverFlags |= (WdfVerifyOn | WdfVerifierOn);
263  }
264  }
265 
267  BOOLEAN
269  __in ULONG Major,
271  );
272 
274  BOOLEAN
276  _In_ PCUNICODE_STRING ServiceKeyName
277  );
278 
279  VOID
281  _In_ PCUNICODE_STRING ServiceKeyName
282  );
283 
285  BOOLEAN
287  __in ULONG Major,
288  __in ULONG Minor,
290  )
291  {
292  //
293  // those verifier checks that are restricted to specific version can be
294  // applied to previous version drivers if driver opts-in by setting a
295  // reg key (whose value is stored in FxVerifyDownlevel)
296  //
297  if (FxVerifierOn &&
299  (DownLevel ? FxVerifyDownlevel : FALSE))) {
300  return TRUE;
301  }
302  else {
303  return FALSE;
304  }
305  }
306 
307  //
308  // To be used in code path where it is already determined that the driver
309  // is down-level, otherwise use IsVerificationEnabled.
310  //
311  __inline
313  BOOLEAN
315  )
316  {
317  return FxVerifyDownlevel;
318  }
319 
320  VOID
322  __in MxEvent* Event,
323  __in PCSTR ReasonForWaiting,
324  __in PVOID Handle,
325  __in ULONG WarningTimeoutInSec,
327  );
328 
330  BOOLEAN
332  VOID
333  );
334 
335 public:
336  //
337  // Link list of driver FxDriverGlobals on this WDF Version.
338  //
340 
341  //
342  // Reference count is operated on with interlocked operations
343  //
345 
346  //
347  // This event is signaled when globals can be freed. Unload thread waits
348  // on this event to make sure driver's threads are done and driver unload
349  // can proceed.
350  //
352 
353  //
354  // Mask to XOR all outgoing handles against
355  //
357 
358  //
359  // If verifier is on, this is the count of allocations
360  // to fail at
361  //
363 
364  //
365  // Tag to be used for allocations on behalf of the driver writer. This is
366  // based off of the service name (which might be different than the binary
367  // name).
368  //
370 
371  //
372  // Backpointer to Fx driver object
373  //
375 
377 
379 
380  //
381  // WDF internal In-Flight Recorder (IFR) log
382  //
384 
385  //
386  // The driver's memory pool header
387  //
389 
390  //
391  // Framworks Pool Tracking
392  //
394 
395  //
396  // FxVerifierLock per driver state
397  //
399 
401 
402  //
403  // Embedded pointer to driver's WDF_BIND_INFO structure (in stub)
404  //
406 
407  //
408  // The base address of the image.
409  //
411 
412  //
413  // The size of the image.
414  //
416 
417  //
418  // Top level verifier flag.
419  //
421 
422  //
423  // Apply latest-version-restricted verifier checks to downlevel drivers.
424  // Drivers set this value in registry.
425  //
427 
428  //
429  // Breakpoint on errors.
430  //
432 
433  //
434  // Breakpoint on device state errors.
435  //
437 
438  //
439  // Handle verifier.
440  //
442 
443  //
444  // I/O verifier.
445  //
447 
448  //
449  // Lock verifier.
450  //
452 
453  //
454  // Not a verifier option. Rather, controls whether WDFVERIFY macros are
455  // live.
456  //
458 
459  //
460  // Capture IFR Verbose messages.
461  //
463 
464  //
465  // Parent queue presented requests (to device).
466  //
468 
469  //
470  // Enable/Disable support for device simulation framework (DSF).
471  //
473 
474  //
475  // Force copy of IFR data to mini-dump when a bugcheck happens.
476  //
478 
479  //
480  // TRUE to enable run-time driver tracking. The dump callback logic
481  // uses this info for finding the right log to write in the minidump.
482  //
484 
485  //
486  // TRUE if compiled for user-mode
487  //
489 
490  //
491  // Remove lock options, these are also specified through
492  // WdfDeviceInitSetRemoveLockOptions.
493  //
495 
496  //
497  // Bug check callback data for kernel mode only
498 
499 
500 
501  //
502 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
503  //
504  // 0-based index into the BugCheckDriverInfo holding this driver info.
505  //
507 
508  //
509  // Bug check callback record for processing bugchecks.
510  //
512 
513 #endif
514 
515  //
516  // Enhanced Verifier Options.
517  //
519 
520  //
521  // If FxVerifierDbgBreakOnError is true, WaitForSignal interrupts the
522  // execution of the system after waiting for the specified number
523  // of seconds. Developer will have an opportunity to validate the state
524  // of the driver when breakpoint is hit. Developer can continue to wait
525  // by entering 'g' in the debugger.
526  //
528 
529  //
530  // Timeout used by the wake interrupt ISR in WaitForSignal to catch
531  // scenarios where the interrupt ISR is blocked because the device stack
532  // is taking too long to power up
533  //
535 
536 #if (FX_CORE_MODE==FX_CORE_USER_MODE)
537  CWudfDriverGlobals * UfxDriverGlobals;
538 #endif
539 
541 
542  //
543  // The public version of WDF_DRIVER_GLOBALS
544  //
546 
548 
549 __bcount(Size)
550 PVOID
552 FxPoolAllocate(
555  __in size_t Size
556  )
557 {
558  //
559  // Always pass in the return address, regardless of the value of
560  // Globals->WdfPoolTrackingOn.
561  //
562  return FxPoolAllocator(
563  Globals,
564  &Globals->FxPoolFrameworks,
565  Type,
566  Size,
567  Globals->Tag,
569  );
570 }
571 
572 __bcount(Size)
573 PVOID
575 FxPoolAllocateWithTag(
578  __in size_t Size,
579  __in ULONG Tag
580  )
581 {
582  return FxPoolAllocator(
583  Globals,
584  &Globals->FxPoolFrameworks,
585  Type,
586  Size,
587  Tag,
588  Globals->FxPoolTrackingOn ? _ReturnAddress() : NULL
589  );
590 }
591 
592 //
593 // Get FxDriverGlobals from api's DriverGlobals
594 //
595 __inline
599  )
600 {
602 }
603 
605 
606 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
607 VOID
609  _In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
611  );
612 
613 VOID
615  _In_ PFX_DRIVER_GLOBALS FxDriverGlobals
616  );
617 #endif
618 
619 BOOLEAN
622  );
623 
625 NTSTATUS
627  __inout PFX_DRIVER_GLOBALS FxDriverGlobals,
630  __in_opt PWDF_DRIVER_CONFIG DriverConfig //optional in user mode
631  );
632 
633 VOID
634 FxDestroy(
635  __in PFX_DRIVER_GLOBALS FxDriverGlobals
636  );
637 
639 NTSTATUS
641  VOID
642  );
643 
644 VOID
646  VOID
647  );
648 
649 VOID
651  VOID
652  );
653 
654 void
656  __in PFX_DRIVER_GLOBALS FxDriverGlobals
657  );
658 
659 void
661  __in PFX_DRIVER_GLOBALS FxDriverGlobals
662  );
663 
665 BOOLEAN
667  __in FxObjectDebugInfo* DebugInfo,
669  );
670 
671 PCSTR
674  );
675 
676 typedef
677 NTSTATUS
679  __in TRACE_INFORMATION_CLASS TraceInformationClass,
680  __out PVOID TraceInformation,
684  );
685 
686 typedef
687 NTSTATUS
689  __in TRACEHANDLE LoggerHandle,
690  __in ULONG MessageFlags,
691  __in LPGUID MessageGuid,
693  __in va_list MessageArgList
694  );
695 
701 };
702 
703 //
704 // Private Globals for the entire DLL
705 
706 //
708 
709 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
710 
711  //
712  // The driver object for the library.
713 
714 
715 
716 
717 
718  //
720 
721  //
722  // As long as this device object is around, the library cannot be unloaded.
723  // This prevents the following scenario from unloading the service
724  // 1 wdfldr.sys loads the library
725  // 2 user tries to run "net stop <service>" while there are outstanding clients
726  // through wdfldr
727  //
729 
731 
733 
735 
737 
739 
741 
743 
745 
747 
749 
751 
753 
755 
757 
759 
761 
763 
765 
767 
768 #endif
769 
771 
773 
775 
776 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
777  //
778  // Index to first free entry in BugCheckDriverInfo array.
779  //
781 
782  //
783  // # of entries in BugCheckDriverInfo array.
784  //
786 
787  //
788  // Array of info about loaded driver. The library bugcheck callback
789  // writes this data into the minidump.
790  //
792 
793  //
794  // Library bug-check callback record for processing bugchecks.
795  //
797 
799 
800 #endif
801  //
802  // WPP tracing.
803  //
805 
806 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
807  //
808  // The following field is used by the debug dump callback routine for
809  // finding which driver's dump log file to write in the minidump if an
810  // exact match is not found.
811  //
813 
814  //
815  // Best driver match for the mini-dump log.
816  //
818 #endif
819 
821 
822  //
823  // TRUE if compiled for user-mode
824  //
826 
827  //
828 
829 
830 
831 
832 
833 
834  //
835 
837 
838 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
839  //
840  // used for locking/unlocking Enhanced-verifier image section
841  //
843 
844  //
845  // This keeps track of the # of times we pinned the paged memory down.
846  // This is only used to aid debugging.
847  //
849 
850  //
851  // Routines provided by the kernel SystemTraceProvider for perf
852  // tracing of WDF operations. The size member of this structure
853  // allows versioning across multiple OS versions.
854  //
855  //PWMI_WDF_NOTIFY_ROUTINES PerfTraceRoutines; __REACTOS__
857 
858  //
859  // PerfTraceRoutines points here if the SystemTraceProvider failed
860  // to provide trace routines.
861  //
862  //WMI_WDF_NOTIFY_ROUTINES DummyPerfTraceRoutines; __REACTOS__
864 
865 #endif
866 
867  //
868  // Registry setting to disable IFR on low-memory systems.
869  //
871 };
872 
874 
875 
876 typedef struct _FX_OBJECT_INFO {
877  //
878  // The name of the object, ie "FxObject"
879  //
880  const CHAR* Name;
881 
882  //
883  // The name of the external WDF handle that represents the object, ie
884  // WDFDEVICE. If the object does not have an external handle, this field
885  // may be NULL.
886  //
887  const CHAR* HandleName;
888 
889  //
890  // The minimum size of the object, ie sizeof(FxObject). There are objects
891  // which allocate more than their sizeof() length.
892  //
894 
895  //
896  // FX_OBJECT_TYPES value
897  //
899 
901 
902 //
903 // Define to declare an internal entry. An internal entry has no external WDF
904 // handle.
905 //
906 #define FX_INTERNAL_OBJECT_INFO_ENTRY(_obj, _type) \
907  { #_obj, NULL, sizeof(_obj), _type, }
908 
909 //
910 // Define to declare an external entry. An external entry has an external WDF
911 // handle.
912 //
913 // By casting #_handletype to a (_handletype), we make sure that _handletype is
914 // actually a valid WDF handle name. The cast forces the parameter to be
915 // evaluated as true handle type vs a string (ie the # preprocesor operator).
916 // For instance, this would catch the following error:
917 //
918 // FX_EXTERNAL_OBJECT_INFO_ENTRY(FxDevice, FX_TYPE_DEVICE, WDFDEVICES),
919 //
920 // because the statement would evaluate to (const CHAR*) (WDFDEVICES) "WDFDEVICES"
921 // and WDFDEVICES is not a valid type (WDFDEVICE is though).
922 //
923 #define FX_EXTERNAL_OBJECT_INFO_ENTRY(_obj, _type, _handletype) \
924  { #_obj, \
925  (const CHAR*) (_handletype) #_handletype, \
926  sizeof(_obj), \
927  _type, \
928  }
929 
931 BOOLEAN
934  );
935 
936 VOID
938  VOID
939  );
940 
941 VOID
943  __in FxDriverGlobalsDebugExtension* DebugExtension
944  );
945 
946 //
947 
948 
949 
950 
951 
952 
953 
954 
955 
956 
957 
958 
959 
960 //
961 
963 __inline
964 BOOLEAN
966  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
967  __in PFX_DRIVER_GLOBALS ExtDriverGlobals
968  )
969 {
970  return (FxDriverGlobals == ExtDriverGlobals) ? FALSE : TRUE;
971 }
972 
973 
975 BOOLEAN
976 __inline
978  __in CONST GUID* Lhs,
979  __in CONST GUID* Rhs
980  )
981 {
982  return RtlCompareMemory(Lhs, Rhs, sizeof(GUID)) == sizeof(GUID);
983 }
984 
985 __inline
986 size_t
988  __in size_t A,
989  __in size_t B
990  )
991 {
992  return A > B ? A : B;
993 }
994 
995 __inline
996 size_t
998  __in size_t A,
999  __in size_t B
1000  )
1001 {
1002  return A < B ? A : B;
1003 }
1004 
1005 __inline
1006 LONG
1008  __inout LONG volatile *Target,
1009  __in LONG Floor
1010  )
1011 {
1012  LONG startVal;
1013  LONG currentVal;
1014 
1015  currentVal = *Target;
1016 
1017  do {
1018  if (currentVal <= Floor) {
1019  return currentVal;
1020  }
1021 
1022  startVal = currentVal;
1023 
1024  //
1025  // currentVal will be the value that used to be Target if the exchange was made
1026  // or its current value if the exchange was not made.
1027  //
1028  currentVal = InterlockedCompareExchange(Target, startVal+1, startVal);
1029 
1030  //
1031  // If startVal == currentVal, then no one updated Target in between the deref at the top
1032  // and the InterlockedCompareExchange afterward.
1033  //
1034  } while (startVal != currentVal);
1035 
1036  //
1037  // startVal is the old value of Target. Since InterlockedIncrement returns the new
1038  // incremented value of Target, we should do the same here.
1039  //
1040  return startVal+1;
1041 }
1042 
1043 __inline
1044 LONG
1046  __inout LONG volatile *Target
1047  )
1048 {
1050 }
1051 
1052 __inline
1053 ULONG
1055  __inout PULONG RandomSeed
1056  )
1057 /*++
1058 
1059 Routine Description:
1060 
1061  Simple threadsafe random number generator to use at DISPATCH_LEVEL
1062  (in kernel mode) because the system provided function RtlRandomEx
1063  can be called at only passive-level.
1064 
1065  This function requires the user to provide a variable used to seed
1066  the generator, and it must be valid and initialized to some number.
1067 
1068 Return Value:
1069 
1070  ULONG
1071 
1072 --*/
1073 {
1074  *RandomSeed = *RandomSeed * 1103515245 + 12345;
1075  return (ULONG)(*RandomSeed / 65536) % 32768;
1076 }
1077 
1079 __inline
1080 BOOLEAN
1082  VOID
1083  )
1084 {
1085  //
1086  // Passive-level interrupt handling is supported in Win 8 and forward.
1087  //
1089 }
1090 
1091 __inline
1093 BOOLEAN
1095  __in ULONG Major,
1096  __in ULONG Minor
1097  )
1098 {
1099  return ((FxLibraryGlobals.OsVersionInfo.dwMajorVersion > Major) ||
1102 }
1103 
1104 #ifdef __cplusplus
1105 }
1106 #endif
1107 #endif // _FXGLOBALS_H
1108 
struct _FX_OBJECT_INFO FX_OBJECT_INFO
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
PFN_KE_SET_COALESCABLE_TIMER KeSetCoalescableTimer
Definition: fxglobals.h:738
ObjectType
Definition: metafile.c:80
VOID(STDCALL * PFN_VF_CHECK_NX_POOL_TYPE)(_In_ POOL_TYPE PoolType, _In_ PVOID CallingAddress, _In_ ULONG PoolTag)
Definition: fxglobalskm.h:315
PFN_POX_UNREGISTER_DEVICE PoxUnregisterDevice
Definition: fxglobals.h:746
BOOLEAN FxTrackDriverForMiniDumpLog
Definition: fxglobals.h:483
_Must_inspect_result_ BOOLEAN IsCorrectVersionRegistered(_In_ PCUNICODE_STRING ServiceKeyName)
Definition: globalskm.cpp:112
enum FxVerifierDownlevelOption FxVerifierDownLevelOption
enum _TRACE_INFORMATION_CLASS TRACE_INFORMATION_CLASS
MxEvent DestroyEvent
Definition: fxglobals.h:351
FxObjectDebugInfo * ObjectDebugInfo
Definition: fxglobals.h:118
Definition: ehthrow.cxx:53
BOOLEAN FxVerifierOn
Definition: fxglobals.h:420
PLIST_ENTRY ThreadTable
Definition: fxglobals.h:400
ULONG64 TRACEHANDLE
Definition: evntrace.h:40
VOID FxCheckAssumptions(VOID)
BOOLEAN FxRequestParentOptimizationOn
Definition: fxglobals.h:467
PFX_DRIVER_GLOBALS BestDriverForDumpLog
Definition: fxglobals.h:817
PDEVICE_OBJECT LibraryDeviceObject
Definition: fxglobals.h:728
VOID(STDCALL * PFN_POX_START_DEVICE_POWER_MANAGEMENT)(__in POHANDLE Handle)
Definition: fxglobalskm.h:242
BOOLEAN InternalTracingInitialized
Definition: fxglobals.h:804
BOOLEAN FxVerboseOn
Definition: fxglobals.h:462
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
ULONG dwMinorVersion
Definition: rtltypes.h:271
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
PFN_POX_REGISTER_DEVICE PoxRegisterDevice
Definition: fxglobals.h:742
char CHAR
Definition: xmlstorage.h:175
VOID SetVerifierState(__in BOOLEAN State)
Definition: fxglobals.h:236
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
PCSTR FxObjectTypeToHandleName(__in WDFTYPE ObjectType)
Definition: globals.cpp:316
VOID FxFreeAllocatedMdlsDebugInfo(__in FxDriverGlobalsDebugExtension *DebugExtension)
Definition: globalskm.cpp:20
struct _WDF_DRIVER_CONFIG * PWDF_DRIVER_CONFIG
Definition: fxglobals.h:604
LONG WdfVerifierAllocateFailCount
Definition: fxglobals.h:362
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
__inline VOID Set()
Definition: mxeventkm.h:91
VOID FxLibraryGlobalsDecommission(VOID)
Definition: globals.cpp:742
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
Definition: fxglobals.h:977
#define InterlockedCompareExchange
Definition: interlocked.h:104
ULONG DbgWaitForWakeInterruptIsrTimeoutInSec
Definition: fxglobals.h:534
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
BOOLEAN IsUserModeFramework
Definition: fxglobals.h:825
PFX_DUMP_DRIVER_INFO_ENTRY BugCheckDriverInfo
Definition: fxglobals.h:791
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
ULONG BugCheckDriverInfoCount
Definition: fxglobals.h:785
FxObjectDebugInfoFlags
Definition: fxglobals.h:67
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
struct _FX_TELEMETRY_CONTEXT * PFX_TELEMETRY_CONTEXT
Definition: fxbugcheck.h:81
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
BOOLEAN PassiveLevelInterruptSupport
Definition: fxglobals.h:820
Definition: ehthrow.cxx:92
struct FxObjectDebugInfo::@4518::@4519 Bits
FxTrackPowerOption TrackPower
Definition: fxglobals.h:145
struct _FX_DRIVER_GLOBALS * PFX_DRIVER_GLOBALS
KAFFINITY(STDCALL * PFN_KE_QUERY_ACTIVE_PROCESSORS)(VOID)
Definition: fxglobalskm.h:169
ULONG dwMajorVersion
Definition: rtltypes.h:270
uint32_t ULONG_PTR
Definition: typedefs.h:65
FX_DRIVER_TRACKER_CACHE_AWARE DriverTracker
Definition: fxglobals.h:812
FX_POOL FxPoolFrameworks
Definition: fxglobals.h:388
BOOLEAN IsPoolTrackingOn(VOID)
Definition: fxglobals.h:215
#define A(row, col)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
PVOID VerifierSectionHandle
Definition: fxglobals.h:842
#define __out_opt
Definition: dbghelp.h:65
LIST_ENTRY Linkage
Definition: fxglobals.h:339
#define FALSE
Definition: types.h:117
Definition: fxpool.h:63
PFN_POX_ACTIVATE_COMPONENT PoxActivateComponent
Definition: fxglobals.h:748
PFN_POX_COMPLETE_IDLE_STATE PoxCompleteIdleState
Definition: fxglobals.h:754
BOOLEAN FxVerifierHandle
Definition: fxglobals.h:441
long LONG
Definition: pedump.c:60
__inline _Must_inspect_result_ BOOLEAN IsDownlevelVerificationEnabled()
Definition: fxglobals.h:314
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
FxDriver * Driver
Definition: fxglobals.h:374
#define __out
Definition: dbghelp.h:62
ULONG FxEnhancedVerifierOptions
Definition: fxglobals.h:518
unsigned char BOOLEAN
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: globalskm.cpp:92
#define _In_
Definition: ms_sal.h:308
char * va_list
Definition: acmsvcex.h:78
struct _FX_DRIVER_GLOBALS FX_DRIVER_GLOBALS
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451
KBUGCHECK_REASON_CALLBACK_RECORD BugCheckCallbackRecord
Definition: fxglobals.h:511
_Must_inspect_result_ BOOLEAN FxVerifierGetTrackReferences(__in FxObjectDebugInfo *DebugInfo, __in WDFTYPE ObjectType)
Definition: globals.cpp:338
VOID FxFlushQueuedDpcs(VOID)
FxMachineSleepStates
Definition: fxglobals.h:696
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX IoUnregisterPlugPlayNotificationEx
Definition: fxglobals.h:740
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
PDRIVER_OBJECT DriverObject
Definition: fxglobals.h:719
FxTrackPowerOption
Definition: fxglobals.h:71
void FxVerifierLockInitialize(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
__inline size_t FxSizeTMax(__in size_t A, __in size_t B)
Definition: fxglobals.h:987
BOOLEAN FxVerifierDbgBreakOnDeviceStateError
Definition: fxglobals.h:436
#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
VOID RegisterClientVersion(_In_ PCUNICODE_STRING ServiceKeyName)
Definition: globalskm.cpp:162
BOOLEAN MachineSleepStates[FxMachineSleepStatesMax]
Definition: fxglobals.h:836
INT POOL_TYPE
Definition: typedefs.h:78
struct _FX_TELEMETRY_CONTEXT FX_TELEMETRY_CONTEXT
USHORT ObjectType
Definition: fxglobals.h:898
PWDF_BIND_INFO WdfBindInfo
Definition: fxglobals.h:405
FxAllocatedMdls AllocatedMdls
Definition: fxglobals.h:124
ULONG __inline Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxglobals.h:193
WaitSignalFlags
Definition: fxglobals.h:83
ULONG RemoveLockOptionFlags
Definition: fxglobals.h:494
PVOID FxPoolAllocator(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PFX_POOL Pool, __in POOL_TYPE Type, __in SIZE_T Size, __in ULONG Tag, __in PVOID CallersAddress)
Definition: wdfpool.cpp:76
const GLubyte * c
Definition: glext.h:8905
Type
Definition: Type.h:6
PFN_KE_SET_TARGET_PROCESSOR_DPC KeSetTargetProcessorDpc
Definition: fxglobals.h:736
struct _FX_OBJECT_INFO * PFX_OBJECT_INFO
_Must_inspect_result_ BOOLEAN IsVerificationEnabled(__in ULONG Major, __in ULONG Minor, __in FxVerifierDownlevelOption DownLevel)
Definition: fxglobals.h:286
_Must_inspect_result_ __inline BOOLEAN FxIsClassExtension(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PFX_DRIVER_GLOBALS ExtDriverGlobals)
Definition: fxglobals.h:965
USHORT TrackReferences
Definition: fxglobals.h:108
PFN_VF_CHECK_NX_POOL_TYPE VfCheckNxPoolType
Definition: fxglobals.h:766
_Must_inspect_result_ BOOLEAN FxVerifyObjectTypeInTable(__in USHORT ObjectType)
Definition: globals.cpp:117
union FxObjectDebugInfo::@4518 u
BOOLEAN ProcessorGroupSupport
Definition: fxglobals.h:798
Definition: ncftp.h:79
PVOID DummyPerfTraceRoutines
Definition: fxglobals.h:863
unsigned char UCHAR
Definition: xmlstorage.h:181
__inline LONG FxInterlockedIncrementFloor(__inout LONG volatile *Target, __in LONG Floor)
Definition: fxglobals.h:1007
#define InterlockedDecrement
Definition: armddk.h:52
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define NTSTATUS
Definition: precomp.h:20
VOID(STDCALL * PFN_POX_ACTIVATE_COMPONENT)(__in POHANDLE Handle, __in ULONG Component, __in ULONG Flags)
Definition: fxglobalskm.h:254
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission(VOID)
Definition: globals.cpp:494
NTSTATUS(STDCALL * PFN_IO_CONNECT_INTERRUPT_EX)(__inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:98
#define __inout
Definition: dbghelp.h:50
Definition: typedefs.h:119
VOID(STDCALL * PFN_IO_REPORT_INTERRUPT_ACTIVE)(_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters)
Definition: fxglobalskm.h:303
BOOLEAN FxVerifyOn
Definition: fxglobals.h:457
#define _Must_inspect_result_
Definition: ms_sal.h:558
BOOLEAN FxVerifierDbgBreakOnError
Definition: fxglobals.h:431
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
__inline size_t FxSizeTMin(__in size_t A, __in size_t B)
Definition: fxglobals.h:997
MxLock ThreadTableLock
Definition: fxglobals.h:398
Definition: mxlock.h:101
ULONG BugCheckDriverInfoIndex
Definition: fxglobals.h:780
BOOLEAN IsObjectDebugOn(VOID)
Definition: fxglobals.h:223
_Must_inspect_result_ BOOLEAN IsDebuggerAttached(VOID)
Definition: globalskm.cpp:250
BOOLEAN FxVerifierIO
Definition: fxglobals.h:446
struct _GUID GUID
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
Definition: globals.cpp:783
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:981
#define InterlockedIncrement
Definition: armddk.h:53
__inline LONG FxInterlockedIncrementGTZero(__inout LONG volatile *Target)
Definition: fxglobals.h:1045
PFX_TELEMETRY_CONTEXT TelemetryContext
Definition: fxglobals.h:540
ULONG FxVerifierDbgWaitForSignalTimeoutInSec
Definition: fxglobals.h:527
unsigned short USHORT
Definition: pedump.c:61
__inline _Must_inspect_result_ BOOLEAN IsOsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: fxglobals.h:1094
FxLibraryGlobalsType * LibraryGlobals
Definition: fxglobals.h:378
PFN_IO_DISCONNECT_INTERRUPT_EX IoDisconnectInterruptEx
Definition: fxglobals.h:732
USHORT WDFTYPE
Definition: fxtypes.h:29
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
signed char * PSTR
Definition: retypes.h:7
_Must_inspect_result_ typedef _In_ ULONG _In_ ULONG MessageNumber
Definition: iotypes.h:4303
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
NTSTATUS(STDCALL * PFN_POX_REGISTER_DEVICE)(__in MdDeviceObject Pdo, __in PPO_FX_DEVICE PoxDevice, __out POHANDLE *Handle)
Definition: fxglobalskm.h:234
unsigned int * PULONG
Definition: retypes.h:1
#define B(row, col)
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
_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(* PFN_WMI_TRACE_MESSAGE_VA)(__in TRACEHANDLE LoggerHandle, __in ULONG MessageFlags, __in LPGUID MessageGuid, __in USHORT MessageNumber, __in va_list MessageArgList)
Definition: fxglobals.h:688
PFN_KE_QUERY_ACTIVE_PROCESSORS KeQueryActiveProcessors
Definition: fxglobals.h:734
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
const CHAR * HandleName
Definition: fxglobals.h:887
const CHAR * Name
Definition: fxglobals.h:880
BOOLEAN FxPoolTrackingOn
Definition: fxglobals.h:393
BOOLEAN FxVerifyDownlevel
Definition: fxglobals.h:426
void * _ReturnAddress(void)
_In_ HANDLE Handle
Definition: extypes.h:390
KBUGCHECK_REASON_CALLBACK_RECORD BugCheckCallbackRecord
Definition: fxglobals.h:796
_Must_inspect_result_ __inline BOOLEAN FxIsPassiveLevelInterruptSupported(VOID)
Definition: fxglobals.h:1081
#define c
Definition: ke_i.h:80
NTSTATUS(* PFN_WMI_QUERY_TRACE_INFORMATION)(__in TRACE_INFORMATION_CLASS TraceInformationClass, __out PVOID TraceInformation, __in ULONG TraceInformationLength, __out_opt PULONG RequiredLength, __in_opt PVOID Buffer)
Definition: fxglobals.h:678
unsigned int ULONG
Definition: retypes.h:1
__bcount(Size) PVOID FORCEINLINE FxPoolAllocate(__in PFX_DRIVER_GLOBALS Globals
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_STATE)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:276
volatile LONG VerifierSectionHandleRefCount
Definition: fxglobals.h:848
CWudfDriverGlobals * UfxDriverGlobals
Definition: fxglobals.h:537
const char * PCSTR
Definition: typedefs.h:52
BOOLEAN IsWindowsVerifierOn(_In_ MdDriverObject DriverObject)
Definition: globals.cpp:953
PFN_IO_CONNECT_INTERRUPT_EX IoConnectInterruptEx
Definition: fxglobals.h:730
Definition: File.h:15
NTSTATUS(STDCALL * PFN_IO_DISCONNECT_INTERRUPT_EX)(__in PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:104
__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
DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) WDF_DRIVER_GLOBALS Public
ULONG_PTR WdfHandleMask
Definition: fxglobals.h:356
ULONG __inline AddRef(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxglobals.h:169
NTSTATUS(STDCALL * PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX)(__in PVOID NotificationEntry)
Definition: fxglobalskm.h:228
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:827
#define __in
Definition: dbghelp.h:35
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
_In_ ULONG TraceInformationLength
Definition: wmifuncs.h:29
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
#define CONST
Definition: pedump.c:81
PFN_IO_REPORT_INTERRUPT_INACTIVE IoReportInterruptInactive
Definition: fxglobals.h:764
__inline ULONG FxRandom(__inout PULONG RandomSeed)
Definition: fxglobals.h:1054
FxVerifierDownlevelOption
Definition: fxglobals.h:78
void FxVerifierLockDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_CONDITION)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:283
volatile LONG DoOnceFlagsBitmap
Definition: fxglobals.h:162
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:213
PFN_POX_COMPLETE_IDLE_CONDITION PoxCompleteIdleCondition
Definition: fxglobals.h:756
PFN_POX_START_DEVICE_POWER_MANAGEMENT PoxStartDevicePowerManagement
Definition: fxglobals.h:744
ULONG BugCheckDriverInfoIndex
Definition: fxglobals.h:506
BOOLEAN FxForceLogsInMiniDump
Definition: fxglobals.h:477
LIST_ENTRY FxDriverGlobalsList
Definition: fxglobals.h:774
MxLockNoDynam FxDriverGlobalsListLock
Definition: fxglobals.h:772