ReactOS  0.4.15-dev-2155-g06f57e1
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 678 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 688 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.

◆ FxObjectDebugInfoFlags

Enumerator
FxObjectDebugTrackReferences 

Definition at line 67 of file fxglobals.h.

◆ FxTrackPowerOption

Enumerator
FxTrackPowerNone 
FxTrackPowerRefs 
FxTrackPowerRefsAndStack 
FxTrackPowerMaxValue 

Definition at line 71 of file fxglobals.h.

◆ FxVerifierDownlevelOption

Enumerator
NotOkForDownLevel 
OkForDownLevel 

Definition at line 78 of file fxglobals.h.

78  {
80  OkForDownLevel = 1,
enum FxVerifierDownlevelOption FxVerifierDownLevelOption

◆ WaitSignalFlags

Enumerator
WaitSignalBreakUnderVerifier 
WaitSignalBreakUnderDebugger 
WaitSignalAlwaysBreak 

Definition at line 83 of file fxglobals.h.

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

Referenced by 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 }
struct FxAllocatedMdls * Next
Definition: fxglobalskm.h:52
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
SINGLE_LIST_ENTRY * pCur
#define NULL
Definition: types.h:112
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

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

◆ 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
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

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
#define FALSE
Definition: types.h:117

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 }
struct _GUID GUID
#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 }
BOOLEAN PassiveLevelInterruptSupport
Definition: fxglobals.h:820
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95

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

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 }
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FX_DRIVER_TRACKER_CACHE_AWARE DriverTracker
Definition: fxglobals.h:812
#define ASSERT(a)
Definition: mode.c:45
VOID FxUninitializeBugCheckDriverInfo()
__inline VOID Uninitialize()
Definition: mxlockkm.h:104
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
LIST_ENTRY FxDriverGlobalsList
Definition: fxglobals.h:774
MxLockNoDynam FxDriverGlobalsListLock
Definition: fxglobals.h:772

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 }
ObjectType
Definition: metafile.c:80
const FX_OBJECT_INFO FxObjectsInfo[]
ULONG FxObjectsInfoCount
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
#define NULL
Definition: types.h:112
const CHAR * HandleName
Definition: fxglobals.h:887
unsigned int ULONG
Definition: retypes.h:1

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 }
unsigned int ULONG
Definition: retypes.h:1

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:53
Definition: ehthrow.cxx:92
#define A(row, col)
#define B(row, col)

Referenced by FxDmaEnabler::ConfigureBusMasterAdapters().

◆ FxSizeTMin()

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

◆ 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 }
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
ObjectType
Definition: metafile.c:80
#define FLAG_TO_BOOL(_Flags, _FlagMask)
Definition: fxobject.hpp:125
const FX_OBJECT_INFO FxObjectsInfo[]
#define FALSE
Definition: types.h:117
ULONG FxObjectsInfoCount
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
unsigned int ULONG
Definition: retypes.h:1

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 
126  FxVerifierLock::AllocateThreadTable(FxDriverGlobals);
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 }
ObjectType
Definition: metafile.c:80
const FX_OBJECT_INFO FxObjectsInfo[]
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
ULONG FxObjectsInfoCount
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
unsigned int ULONG
Definition: retypes.h:1

◆ 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 }
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
ULONG dwMinorVersion
Definition: rtltypes.h:271
RTL_OSVERSIONINFOEXW OsVersionInfo
Definition: fxglobals.h:770
ULONG dwMajorVersion
Definition: rtltypes.h:270
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95

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 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
static const WCHAR L[]
Definition: oid.c:1250
LOGICAL NTAPI MmIsDriverVerifying(IN PDRIVER_OBJECT DriverObject)
Definition: drvmgmt.c:212
#define NULL
Definition: types.h:112
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838

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 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
PVOID VerifierSectionHandle
Definition: fxglobals.h:842
long LONG
Definition: pedump.c:60
#define C_ASSERT(e)
Definition: intsafe.h:71
#define ASSERT(a)
Definition: mode.c:45
#define MmLockPagableCodeSection(Address)
VOID VerifierPageLockHandle(VOID)
Definition: globals.cpp:774
#define InterlockedIncrement
Definition: armddk.h:53
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
volatile LONG VerifierSectionHandleRefCount
Definition: fxglobals.h:848

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 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
PVOID VerifierSectionHandle
Definition: fxglobals.h:842
long LONG
Definition: pedump.c:60
#define ASSERT(a)
Definition: mode.c:45
#define InterlockedDecrement
Definition: armddk.h:52
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
volatile LONG VerifierSectionHandleRefCount
Definition: fxglobals.h:848

Referenced by FxDestroy(), and FxLibraryCommonUnregisterClient().

Variable Documentation

◆ FxLibraryGlobals

◆ Size

Initial value:
{
&Globals->FxPoolFrameworks,
Globals->Tag,
)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
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
Type
Definition: Type.h:6
void * _ReturnAddress(void)

Definition at line 557 of file fxglobals.h.

◆ Tag

Initial value:
{
&Globals->FxPoolFrameworks,
Tag,
Globals->FxPoolTrackingOn ? _ReturnAddress() : NULL
)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
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
Type
Definition: Type.h:6
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
#define NULL
Definition: types.h:112
void * _ReturnAddress(void)

Definition at line 581 of file fxglobals.h.

◆ Type

Definition at line 554 of file fxglobals.h.