ReactOS 0.4.15-dev-7788-g1ad9096
fxglobals.h File Reference
#include "wdfglobals.h"
#include <debug.h>
Include dependency graph for fxglobals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FxObjectDebugInfo
 
struct  FxDriverGlobalsDebugExtension
 
struct  _FX_TELEMETRY_CONTEXT
 
struct  _FX_DRIVER_GLOBALS
 
struct  FxLibraryGlobalsType
 
struct  _FX_OBJECT_INFO
 

Macros

#define ROSWDFNOTIMPLEMENTED   (DbgPrint("(%s:%d) ReactOS KMDF: %s not implemented\n", __RELFILE__, __LINE__, __FUNCTION__))
 
#define FX_INTERNAL_OBJECT_INFO_ENTRY(_obj, _type)    { #_obj, NULL, sizeof(_obj), _type, }
 
#define FX_EXTERNAL_OBJECT_INFO_ENTRY(_obj, _type, _handletype)
 

Typedefs

typedef enum FxTrackPowerOption FxTrackPowerOption
 
typedef enum FxVerifierDownlevelOption FxVerifierDownLevelOption
 
typedef enum WaitSignalFlags WaitSignalFlags
 
typedef struct _FX_TELEMETRY_CONTEXT FX_TELEMETRY_CONTEXT
 
typedef struct _FX_TELEMETRY_CONTEXTPFX_TELEMETRY_CONTEXT
 
typedef struct _FX_DRIVER_GLOBALS FX_DRIVER_GLOBALS
 
typedef struct _FX_DRIVER_GLOBALSPFX_DRIVER_GLOBALS
 
typedef struct _WDF_DRIVER_CONFIGPWDF_DRIVER_CONFIG
 
typedef 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)
 
typedef NTSTATUS(* PFN_WMI_TRACE_MESSAGE_VA) (__in TRACEHANDLE LoggerHandle, __in ULONG MessageFlags, __in LPGUID MessageGuid, __in USHORT MessageNumber, __in va_list MessageArgList)
 
typedef struct _FX_OBJECT_INFO FX_OBJECT_INFO
 
typedef struct _FX_OBJECT_INFOPFX_OBJECT_INFO
 

Enumerations

enum  FxObjectDebugInfoFlags { FxObjectDebugTrackReferences = 0x0001 }
 
enum  FxTrackPowerOption : UCHAR { FxTrackPowerNone = 0 , FxTrackPowerRefs , FxTrackPowerRefsAndStack , FxTrackPowerMaxValue }
 
enum  FxVerifierDownlevelOption { NotOkForDownLevel = 0 , OkForDownLevel = 1 }
 
enum  WaitSignalFlags { WaitSignalBreakUnderVerifier = 0x01 , WaitSignalBreakUnderDebugger = 0x02 , WaitSignalAlwaysBreak = 0x04 }
 
enum  FxMachineSleepStates { FxMachineS1Index = 0 , FxMachineS2Index , FxMachineS3Index , FxMachineSleepStatesMax }
 

Functions

 __bcount (Size) PVOID FORCEINLINE FxPoolAllocate(__in PFX_DRIVER_GLOBALS Globals
 
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals (__in PWDF_DRIVER_GLOBALS DriverGlobals)
 
VOID LockVerifierSection (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
 
VOID UnlockVerifierSection (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
 
BOOLEAN IsWindowsVerifierOn (_In_ MdDriverObject DriverObject)
 
_Must_inspect_result_ NTSTATUS FxInitialize (__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in MdDriverObject DriverObject, __in PCUNICODE_STRING RegistryPath, __in_opt PWDF_DRIVER_CONFIG DriverConfig)
 
VOID FxDestroy (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission (VOID)
 
VOID FxLibraryGlobalsDecommission (VOID)
 
VOID FxCheckAssumptions (VOID)
 
void FxVerifierLockInitialize (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
void FxVerifierLockDestroy (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
_Must_inspect_result_ BOOLEAN FxVerifierGetTrackReferences (__in FxObjectDebugInfo *DebugInfo, __in WDFTYPE ObjectType)
 
PCSTR FxObjectTypeToHandleName (__in WDFTYPE ObjectType)
 
_Must_inspect_result_ BOOLEAN FxVerifyObjectTypeInTable (__in USHORT ObjectType)
 
VOID FxFlushQueuedDpcs (VOID)
 
VOID FxFreeAllocatedMdlsDebugInfo (__in FxDriverGlobalsDebugExtension *DebugExtension)
 
_Must_inspect_result_ __inline BOOLEAN FxIsClassExtension (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PFX_DRIVER_GLOBALS ExtDriverGlobals)
 
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid (__in CONST GUID *Lhs, __in CONST GUID *Rhs)
 
__inline size_t FxSizeTMax (__in size_t A, __in size_t B)
 
__inline size_t FxSizeTMin (__in size_t A, __in size_t B)
 
__inline LONG FxInterlockedIncrementFloor (__inout LONG volatile *Target, __in LONG Floor)
 
__inline LONG FxInterlockedIncrementGTZero (__inout LONG volatile *Target)
 
__inline ULONG FxRandom (__inout PULONG RandomSeed)
 
_Must_inspect_result_ __inline BOOLEAN FxIsPassiveLevelInterruptSupported (VOID)
 
__inline _Must_inspect_result_ BOOLEAN IsOsVersionGreaterThanOrEqualTo (__in ULONG Major, __in ULONG Minor)
 

Variables

__in POOL_TYPE Type
 
__in POOL_TYPE __in size_t Size
 
__in POOL_TYPE __in size_t __in ULONG Tag
 
FxLibraryGlobalsType FxLibraryGlobals
 

Macro Definition Documentation

◆ FX_EXTERNAL_OBJECT_INFO_ENTRY

#define FX_EXTERNAL_OBJECT_INFO_ENTRY (   _obj,
  _type,
  _handletype 
)
Value:
{ #_obj, \
(const CHAR*) (_handletype) #_handletype, \
sizeof(_obj), \
_type, \
}
char CHAR
Definition: xmlstorage.h:175

Definition at line 923 of file fxglobals.h.

◆ FX_INTERNAL_OBJECT_INFO_ENTRY

#define FX_INTERNAL_OBJECT_INFO_ENTRY (   _obj,
  _type 
)     { #_obj, NULL, sizeof(_obj), _type, }

Definition at line 906 of file fxglobals.h.

◆ ROSWDFNOTIMPLEMENTED

#define ROSWDFNOTIMPLEMENTED   (DbgPrint("(%s:%d) ReactOS KMDF: %s not implemented\n", __RELFILE__, __LINE__, __FUNCTION__))

Definition at line 52 of file fxglobals.h.

Typedef Documentation

◆ FX_DRIVER_GLOBALS

◆ FX_OBJECT_INFO

◆ FX_TELEMETRY_CONTEXT

◆ FxTrackPowerOption

◆ FxVerifierDownLevelOption

◆ PFN_WMI_QUERY_TRACE_INFORMATION

typedef 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 at line 677 of file fxglobals.h.

◆ PFN_WMI_TRACE_MESSAGE_VA

typedef NTSTATUS(* PFN_WMI_TRACE_MESSAGE_VA) (__in TRACEHANDLE LoggerHandle, __in ULONG MessageFlags, __in LPGUID MessageGuid, __in USHORT MessageNumber, __in va_list MessageArgList)

Definition at line 687 of file fxglobals.h.

◆ PFX_DRIVER_GLOBALS

◆ PFX_OBJECT_INFO

◆ PFX_TELEMETRY_CONTEXT

◆ PWDF_DRIVER_CONFIG

Definition at line 604 of file fxglobals.h.

◆ WaitSignalFlags

Enumeration Type Documentation

◆ FxMachineSleepStates

Enumerator
FxMachineS1Index 
FxMachineS2Index 
FxMachineS3Index 
FxMachineSleepStatesMax 

Definition at line 696 of file fxglobals.h.

696 {
701};
@ FxMachineSleepStatesMax
Definition: fxglobals.h:700
@ FxMachineS3Index
Definition: fxglobals.h:699
@ FxMachineS1Index
Definition: fxglobals.h:697
@ FxMachineS2Index
Definition: fxglobals.h:698

◆ FxObjectDebugInfoFlags

Enumerator
FxObjectDebugTrackReferences 

Definition at line 67 of file fxglobals.h.

67 {
69};
@ FxObjectDebugTrackReferences
Definition: fxglobals.h:68

◆ FxTrackPowerOption

Enumerator
FxTrackPowerNone 
FxTrackPowerRefs 
FxTrackPowerRefsAndStack 
FxTrackPowerMaxValue 

Definition at line 71 of file fxglobals.h.

71 : UCHAR {
FxTrackPowerOption
Definition: fxglobals.h:71
@ FxTrackPowerRefs
Definition: fxglobals.h:73
@ FxTrackPowerNone
Definition: fxglobals.h:72
@ FxTrackPowerMaxValue
Definition: fxglobals.h:75
@ FxTrackPowerRefsAndStack
Definition: fxglobals.h:74
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ FxVerifierDownlevelOption

Enumerator
NotOkForDownLevel 
OkForDownLevel 

Definition at line 78 of file fxglobals.h.

78 {
enum FxVerifierDownlevelOption FxVerifierDownLevelOption
@ OkForDownLevel
Definition: fxglobals.h:80
@ NotOkForDownLevel
Definition: fxglobals.h:79

◆ WaitSignalFlags

Enumerator
WaitSignalBreakUnderVerifier 
WaitSignalBreakUnderDebugger 
WaitSignalAlwaysBreak 

Definition at line 83 of file fxglobals.h.

83 {
WaitSignalFlags
Definition: fxglobals.h:83
@ WaitSignalBreakUnderDebugger
Definition: fxglobals.h:85
@ WaitSignalAlwaysBreak
Definition: fxglobals.h:86
@ WaitSignalBreakUnderVerifier
Definition: fxglobals.h:84

Function Documentation

◆ __bcount()

__bcount ( Size  )

◆ FxCheckAssumptions()

VOID FxCheckAssumptions ( VOID  )

◆ FxDestroy()

VOID FxDestroy ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 981 of file globals.cpp.

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}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
VOID FxUnregisterBugCheckCallback(__inout PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID FxPurgeBugCheckDriverInfo(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
void FxVerifierLockDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID FxPoolPackageDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: wdfpool.cpp:689
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:827
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:981
#define KernelMode
Definition: asm.h:34
@ Executive
Definition: ketypes.h:415

Referenced by FxDestroy(), and FxLibraryCommonUnregisterClient().

◆ FxFlushQueuedDpcs()

VOID FxFlushQueuedDpcs ( VOID  )

◆ FxFreeAllocatedMdlsDebugInfo()

VOID FxFreeAllocatedMdlsDebugInfo ( __in FxDriverGlobalsDebugExtension DebugExtension)

Definition at line 20 of file globalskm.cpp.

23{
24 FxAllocatedMdls* pNext, *pCur;
25
26 pNext = DebugExtension->AllocatedMdls.Next;
27
28 //
29 // MDL leaks were already checked for in FxPoolDestroy, just free all
30 // the tables here.
31 //
32 while (pNext != NULL) {
33 pCur = pNext;
34 pNext = pCur->Next;
35
37 }
38}
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
SINGLE_LIST_ENTRY * pCur
struct FxAllocatedMdls * Next
Definition: fxglobalskm.h:52
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629

Referenced by FxFreeDriverGlobals().

◆ FxInitialize()

_Must_inspect_result_ NTSTATUS FxInitialize ( __inout PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in MdDriverObject  DriverObject,
__in PCUNICODE_STRING  RegistryPath,
__in_opt PWDF_DRIVER_CONFIG  DriverConfig 
)

Definition at line 848 of file globals.cpp.

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,
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 //
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}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID FxCacheBugCheckDriverInfo(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID FxRegisterBugCheckCallback(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in PDRIVER_OBJECT DriverObject)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
void FxVerifierLockInitialize(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_Must_inspect_result_ NTSTATUS FxPoolPackageInitialize(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: wdfpool.cpp:667
BOOLEAN IsWindowsVerifierOn(_In_ MdDriverObject DriverObject)
Definition: globals.cpp:953
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
Definition: globals.cpp:783
VOID FxRegistrySettingsInitialize(__inout PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegistryPath, __in BOOLEAN WindowsVerifierOn)
Definition: globals.cpp:1361
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
Definition: ps.c:97
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:219
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

◆ FxInterlockedIncrementFloor()

__inline LONG FxInterlockedIncrementFloor ( __inout LONG volatile Target,
__in LONG  Floor 
)

Definition at line 1007 of file fxglobals.h.

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}
#define InterlockedCompareExchange
Definition: interlocked.h:104
long LONG
Definition: pedump.c:60
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

Referenced by FxInterlockedIncrementGTZero().

◆ FxInterlockedIncrementGTZero()

__inline LONG FxInterlockedIncrementGTZero ( __inout LONG volatile Target)

Definition at line 1045 of file fxglobals.h.

1048{
1050}
__inline LONG FxInterlockedIncrementFloor(__inout LONG volatile *Target, __in LONG Floor)
Definition: fxglobals.h:1007

Referenced by FxRequestBase::Cancel(), and FxIoTarget::TimerCallback().

◆ FxIsClassExtension()

_Must_inspect_result_ __inline BOOLEAN FxIsClassExtension ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in PFX_DRIVER_GLOBALS  ExtDriverGlobals 
)

Definition at line 965 of file fxglobals.h.

969{
970 return (FxDriverGlobals == ExtDriverGlobals) ? FALSE : TRUE;
971}
#define TRUE
Definition: types.h:120

Referenced by FxValiateCx().

◆ FxIsEqualGuid()

_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid ( __in CONST GUID Lhs,
__in CONST GUID Rhs 
)

Definition at line 977 of file fxglobals.h.

981{
982 return RtlCompareMemory(Lhs, Rhs, sizeof(GUID)) == sizeof(GUID);
983}
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

Referenced by FxWmiIrpHandler::AddPowerPolicyProviderAndInstance(), for(), FxVerifyLogHeader(), FxPkgPnp::HandleQueryInterface(), if(), and FxDevice::IsInterfaceRegistered().

◆ FxIsPassiveLevelInterruptSupported()

_Must_inspect_result_ __inline BOOLEAN FxIsPassiveLevelInterruptSupported ( VOID  )

Definition at line 1081 of file fxglobals.h.

1084{
1085 //
1086 // Passive-level interrupt handling is supported in Win 8 and forward.
1087 //
1089}
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
BOOLEAN PassiveLevelInterruptSupport
Definition: fxglobals.h:820

Referenced by FxInterrupt::AssignResources().

◆ FxLibraryGlobalsCommission()

_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission ( VOID  )

Definition at line 494 of file globals.cpp.

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}
#define VOID
Definition: acefi.h:82
__inline VOID Initialize()
Definition: mxlockkm.h:43
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
Definition: mxgeneralkm.h:226
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
VOID FxInitializeBugCheckDriverInfo()
VOID(STDCALL * PFN_POX_ACTIVATE_COMPONENT)(__in POHANDLE Handle, __in ULONG Component, __in ULONG Flags)
Definition: fxglobalskm.h:254
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_CONDITION)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:283
VOID(STDCALL * PFN_VF_CHECK_NX_POOL_TYPE)(_In_ POOL_TYPE PoolType, _In_ PVOID CallingAddress, _In_ ULONG PoolTag)
Definition: fxglobalskm.h:315
NTSTATUS(STDCALL * PFN_IO_DISCONNECT_INTERRUPT_EX)(__in PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:104
VOID(STDCALL * PFN_POX_IDLE_COMPONENT)(__in POHANDLE Handle, __in ULONG Component, __in ULONG Flags)
Definition: fxglobalskm.h:262
VOID(STDCALL * PFN_IO_REPORT_INTERRUPT_ACTIVE)(_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters)
Definition: fxglobalskm.h:303
VOID(STDCALL * PFN_IO_REPORT_INTERRUPT_INACTIVE)(_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters)
Definition: fxglobalskm.h:309
NTSTATUS(STDCALL * PFN_IO_CONNECT_INTERRUPT_EX)(__inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: fxglobalskm.h:98
VOID(STDCALL * PFN_POX_UNREGISTER_DEVICE)(__in POHANDLE Handle)
Definition: fxglobalskm.h:248
VOID(STDCALL * PFN_POX_COMPLETE_IDLE_STATE)(__in POHANDLE Handle, __in ULONG Component)
Definition: fxglobalskm.h:276
NTSTATUS(STDCALL * PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX)(__in PVOID NotificationEntry)
Definition: fxglobalskm.h:228
VOID(STDCALL * PFN_KE_SET_TARGET_PROCESSOR_DPC)(__in PRKDPC Dpc, __in CCHAR Number)
Definition: fxglobalskm.h:175
VOID(STDCALL * PFN_POX_SET_DEVICE_IDLE_TIMEOUT)(__in POHANDLE Handle, __in ULONGLONG IdleTimeout)
Definition: fxglobalskm.h:296
VOID(STDCALL * PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED)(__in POHANDLE Handle)
Definition: fxglobalskm.h:290
NTSTATUS(STDCALL * PFN_POX_REGISTER_DEVICE)(__in MdDeviceObject Pdo, __in PPO_FX_DEVICE PoxDevice, __out POHANDLE *Handle)
Definition: fxglobalskm.h:234
VOID(STDCALL * PFN_POX_REPORT_DEVICE_POWERED_ON)(__in POHANDLE Handle)
Definition: fxglobalskm.h:270
KAFFINITY(STDCALL * PFN_KE_QUERY_ACTIVE_PROCESSORS)(VOID)
Definition: fxglobalskm.h:169
VOID(STDCALL * PFN_POX_START_DEVICE_POWER_MANAGEMENT)(__in POHANDLE Handle)
Definition: fxglobalskm.h:242
#define WmiQueryTraceInformation
Definition: fxwmicompat.h:64
VOID FxVerifyObjectTableIsSorted(VOID)
Definition: globals.cpp:381
VOID FxLibraryGlobalsVerifyVersion(VOID)
Definition: globals.cpp:423
VOID FxLibraryGlobalsQueryRegistrySettings(VOID)
Definition: globals.cpp:464
NTSTATUS(* PFN_RTL_GET_VERSION)(__out PRTL_OSVERSIONINFOW VersionInformation)
Definition: globals.cpp:402
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define ASSERT(a)
Definition: mode.c:44
#define MAKE_MX_FUNC_NAME(x)
Definition: mxgeneralkm.h:26
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
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define L(x)
Definition: ntvdm.h:50
FX_DRIVER_TRACKER_CACHE_AWARE DriverTracker
Definition: fxglobals.h:812
PFN_KE_QUERY_ACTIVE_PROCESSORS KeQueryActiveProcessors
Definition: fxglobals.h:734
PFN_IO_REPORT_INTERRUPT_INACTIVE IoReportInterruptInactive
Definition: fxglobals.h:764
PVOID VerifierSectionHandle
Definition: fxglobals.h:842
PFN_POX_REGISTER_DEVICE PoxRegisterDevice
Definition: fxglobals.h:742
PFN_KE_SET_TARGET_PROCESSOR_DPC KeSetTargetProcessorDpc
Definition: fxglobals.h:736
PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED PoxCompleteDevicePowerNotRequired
Definition: fxglobals.h:758
PFN_POX_START_DEVICE_POWER_MANAGEMENT PoxStartDevicePowerManagement
Definition: fxglobals.h:744
LIST_ENTRY FxDriverGlobalsList
Definition: fxglobals.h:774
PVOID DummyPerfTraceRoutines
Definition: fxglobals.h:863
PFN_IO_DISCONNECT_INTERRUPT_EX IoDisconnectInterruptEx
Definition: fxglobals.h:732
PFN_POX_COMPLETE_IDLE_STATE PoxCompleteIdleState
Definition: fxglobals.h:754
RTL_OSVERSIONINFOEXW OsVersionInfo
Definition: fxglobals.h:770
PFN_POX_IDLE_COMPONENT PoxIdleComponent
Definition: fxglobals.h:750
PFN_KE_SET_COALESCABLE_TIMER KeSetCoalescableTimer
Definition: fxglobals.h:738
PFN_IO_CONNECT_INTERRUPT_EX IoConnectInterruptEx
Definition: fxglobals.h:730
PFN_POX_REPORT_DEVICE_POWERED_ON PoxReportDevicePoweredOn
Definition: fxglobals.h:752
PFN_VF_CHECK_NX_POOL_TYPE VfCheckNxPoolType
Definition: fxglobals.h:766
PFN_IO_REPORT_INTERRUPT_ACTIVE IoReportInterruptActive
Definition: fxglobals.h:762
PFN_POX_COMPLETE_IDLE_CONDITION PoxCompleteIdleCondition
Definition: fxglobals.h:756
PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX IoUnregisterPlugPlayNotificationEx
Definition: fxglobals.h:740
PFN_POX_ACTIVATE_COMPONENT PoxActivateComponent
Definition: fxglobals.h:748
BOOLEAN ProcessorGroupSupport
Definition: fxglobals.h:798
PFN_POX_SET_DEVICE_IDLE_TIMEOUT PoxSetDeviceIdleTimeout
Definition: fxglobals.h:760
BOOLEAN MachineSleepStates[FxMachineSleepStatesMax]
Definition: fxglobals.h:836
BOOLEAN IsUserModeFramework
Definition: fxglobals.h:825
MxLockNoDynam FxDriverGlobalsListLock
Definition: fxglobals.h:772
PFN_POX_UNREGISTER_DEVICE PoxUnregisterDevice
Definition: fxglobals.h:746
volatile LONG VerifierSectionHandleRefCount
Definition: fxglobals.h:848
_Must_inspect_result_ NTSTATUS Initialize()
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3601
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by FxLibraryCommonCommission().

◆ FxLibraryGlobalsDecommission()

VOID FxLibraryGlobalsDecommission ( VOID  )

Definition at line 742 of file globals.cpp.

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}
__inline VOID Uninitialize()
Definition: mxlockkm.h:104
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
VOID FxUninitializeBugCheckDriverInfo()

Referenced by FxLibraryCommonDecommission().

◆ FxObjectTypeToHandleName()

PCSTR FxObjectTypeToHandleName ( __in WDFTYPE  ObjectType)

Definition at line 316 of file globals.cpp.

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}
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 FxObjectsInfoCount
const FX_OBJECT_INFO FxObjectsInfo[]
ObjectType
Definition: metafile.c:81
const CHAR * HandleName
Definition: fxglobals.h:887
uint32_t ULONG
Definition: typedefs.h:59

Referenced by FxObject::~FxObject().

◆ FxRandom()

__inline ULONG FxRandom ( __inout PULONG  RandomSeed)

Definition at line 1054 of file fxglobals.h.

1073{
1074 *RandomSeed = *RandomSeed * 1103515245 + 12345;
1075 return (ULONG)(*RandomSeed / 65536) % 32768;
1076}
static ULONG RandomSeed
Definition: UEFIFirmware.c:24

Referenced by FxPkgIo::VerifierFreeRequestToTestForwardProgess().

◆ FxSizeTMax()

__inline size_t FxSizeTMax ( __in size_t  A,
__in size_t  B 
)

Definition at line 987 of file fxglobals.h.

991{
992 return A > B ? A : B;
993}
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
#define A(row, col)
#define B(row, col)

Referenced by FxDmaEnabler::ConfigureBusMasterAdapters().

◆ FxSizeTMin()

◆ FxVerifierGetTrackReferences()

_Must_inspect_result_ BOOLEAN FxVerifierGetTrackReferences ( __in FxObjectDebugInfo DebugInfo,
__in WDFTYPE  ObjectType 
)

Definition at line 338 of file globals.cpp.

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}
#define FLAG_TO_BOOL(_Flags, _FlagMask)
Definition: fxobject.hpp:125
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

Referenced by FxObject::AllocateTagTracker().

◆ FxVerifierLockDestroy()

void FxVerifierLockDestroy ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 137 of file fxverifierlock.cpp.

140{
141 if( FxDriverGlobals->FxVerifierLock ) {
142 FxVerifierLock::FreeThreadTable(FxDriverGlobals);
143
144 FxDriverGlobals->ThreadTableLock.Uninitialize();
145 }
146
147 return;
148}
static void FreeThreadTable(__in PFX_DRIVER_GLOBALS FxDriverGlobals)

Referenced by FxDestroy().

◆ FxVerifierLockInitialize()

void FxVerifierLockInitialize ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 118 of file fxverifierlock.cpp.

121{
122 if( FxDriverGlobals->FxVerifierLock ) {
123
124 FxDriverGlobals->ThreadTableLock.Initialize();
125
127 }
128
129 return;
130}
static void AllocateThreadTable(__in PFX_DRIVER_GLOBALS FxDriverGlobals)

Referenced by FxInitialize().

◆ FxVerifyObjectTypeInTable()

_Must_inspect_result_ BOOLEAN FxVerifyObjectTypeInTable ( __in USHORT  ObjectType)

Definition at line 117 of file globals.cpp.

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}

◆ GetFxDriverGlobals()

◆ IsOsVersionGreaterThanOrEqualTo()

__inline _Must_inspect_result_ BOOLEAN IsOsVersionGreaterThanOrEqualTo ( __in ULONG  Major,
__in ULONG  Minor 
)

Definition at line 1094 of file fxglobals.h.

1098{
1099 return ((FxLibraryGlobals.OsVersionInfo.dwMajorVersion > Major) ||
1102}
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44

Referenced by FxDmaEnabler::Initialize().

◆ IsWindowsVerifierOn()

BOOLEAN IsWindowsVerifierOn ( _In_ MdDriverObject  DriverObject)

Definition at line 953 of file globals.cpp.

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}
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
LOGICAL NTAPI MmIsDriverVerifying(IN PDRIVER_OBJECT DriverObject)
Definition: drvmgmt.c:212

Referenced by FxInitialize().

◆ LockVerifierSection()

VOID LockVerifierSection ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ PCUNICODE_STRING  RegistryPath 
)

Definition at line 783 of file globals.cpp.

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}
#define InterlockedIncrement
Definition: armddk.h:53
GLuint GLuint GLsizei count
Definition: gl.h:1545
VOID VerifierPageLockHandle(VOID)
Definition: globals.cpp:774
#define C_ASSERT(e)
Definition: intsafe.h:73
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define MmLockPagableCodeSection(Address)

Referenced by FxInitialize(), and FxLibraryCommonRegisterClient().

◆ UnlockVerifierSection()

VOID UnlockVerifierSection ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 827 of file globals.cpp.

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}
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by FxDestroy(), and FxLibraryCommonUnregisterClient().

Variable Documentation

◆ FxLibraryGlobals

◆ Size

Initial value:
{
&Globals->FxPoolFrameworks,
Globals->Tag,
)
Type
Definition: Type.h:7
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
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
#define _ReturnAddress()
Definition: intrin_arm.h:35
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Definition at line 555 of file fxglobals.h.

◆ Tag

Initial value:
{
&Globals->FxPoolFrameworks,
Tag,
Globals->FxPoolTrackingOn ? _ReturnAddress() : NULL
)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065

Definition at line 579 of file fxglobals.h.

◆ Type

Definition at line 554 of file fxglobals.h.