ReactOS  0.4.15-dev-3207-ga415bd4
Mx Class Reference

#include <mxgeneral.h>

Public Member Functions

 __drv_maxIRQL (HIGH_LEVEL) __drv_raisesIRQL(NewIrql) __inline static VOID MxRaiseIrql(__in KIRQL NewIrql
 
 __drv_maxIRQL (HIGH_LEVEL) __inline static VOID MxLowerIrql(__in __drv_restoresIRQL __drv_nonConstant KIRQL NewIrql)
 
 _Acquires_lock_ (_Global_critical_region_) __inline static VOID MxEnterCriticalRegion()
 
 _Releases_lock_ (_Global_critical_region_) __inline static VOID MxLeaveCriticalRegion()
 
 _Releases_lock_ (_Global_cancel_spin_lock_) __drv_requiresIRQL(DISPATCH_LEVEL) __inline static VOID ReleaseCancelSpinLock(__in __drv_restoresIRQL __drv_useCancelIRQL KIRQL Irql)
 

Static Public Member Functions

static __inline BOOLEAN IsUM ()
 
static __inline BOOLEAN IsKM ()
 
static __inline MxThread MxGetCurrentThread ()
 
static __inline MdEThread GetCurrentEThread ()
 
static NTSTATUS MxTerminateCurrentThread (__in NTSTATUS Status)
 
static __inline KIRQL MxGetCurrentIrql ()
 
static __inline VOID MxQueryTickCount (__out PLARGE_INTEGER TickCount)
 
static __inline ULONG MxQueryTimeIncrement ()
 
static DECLSPEC_NORETURN VOID MxBugCheckEx (__in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
 
static __inline VOID MxDbgBreakPoint ()
 
static VOID MxDbgPrint (__drv_formatString(printf) __in PCSTR DebugMessage,...)
 
static __inline VOID MxAssert (__in BOOLEAN Condition)
 
static __inline VOID MxAssertMsg (__in LPSTR Message, __in BOOLEAN Condition)
 
static __inline VOID MxDelayExecutionThread (__in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in PLARGE_INTEGER Interval)
 
static __inline PVOID MxGetSystemRoutineAddress (__in MxFuncName FuncName)
 
static __inline VOID MxReferenceObject (__in PVOID Object)
 
static __inline VOID MxDereferenceObject (__in PVOID Object)
 
static __inline VOID MxInitializeRemoveLock (__in MdRemoveLock Lock, __in ULONG AllocateTag, __in ULONG MaxLockedMinutes, __in ULONG HighWatermark)
 
static __inline NTSTATUS MxAcquireRemoveLock (__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
 
static __inline VOID MxReleaseRemoveLock (__in MdRemoveLock RemoveLock, __in PVOID Tag)
 
static __inline VOID MxReleaseRemoveLockAndWait (__in MdRemoveLock RemoveLock, __in PVOID Tag)
 
static __inline BOOLEAN MxHasEnoughRemainingThreadStack (VOID)
 
static __inline NTSTATUS CreateCallback (__out PCALLBACK_OBJECT *CallbackObject, __in POBJECT_ATTRIBUTES ObjectAttributes, __in BOOLEAN Create, __in BOOLEAN AllowMultipleCallbacks)
 
static __inline PVOID RegisterCallback (__in PCALLBACK_OBJECT CallbackObject, __in MdCallbackFunction CallbackFunction, __in PVOID CallbackContext)
 
static __inline VOID UnregisterCallback (__in PVOID CbRegistration)
 
static VOID MxGlobalInit (VOID)
 
static __inline VOID MxUnlockPages (__in PMDL Mdl)
 
static __inline PVOID MxGetSystemAddressForMdlSafe (__inout PMDL Mdl, __in ULONG Priority)
 
static __inline VOID MxBuildMdlForNonPagedPool (__inout PMDL Mdl)
 
static __inline PVOID MxGetDriverObjectExtension (__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
 
static __inline NTSTATUS MxAllocateDriverObjectExtension (_In_ MdDriverObject DriverObject, _In_ PVOID ClientIdentificationAddress, _In_ ULONG DriverObjectExtensionSize, _Post_ _At_(*DriverObjectExtension, _When_(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) _Post_notnull_)) _When_(return==0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize)) PVOID *DriverObjectExtension)
 
static __inline MdDeviceObject MxGetAttachedDeviceReference (__in MdDeviceObject DriverObject)
 
static __inline VOID MxDeleteSymbolicLink (__in PUNICODE_STRING Link)
 
static __inline VOID MxDeleteNPagedLookasideList (_In_ PNPAGED_LOOKASIDE_LIST LookasideList)
 
static __inline VOID MxDeletePagedLookasideList (_In_ PPAGED_LOOKASIDE_LIST LookasideList)
 
static __inline VOID MxInitializeNPagedLookasideList (_Out_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
 
static __inline VOID MxInitializePagedLookasideList (_Out_ PPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
 
static __inline VOID MxDeleteDevice (_In_ MdDeviceObject Device)
 
static VOID MxDetachDevice (_Inout_ MdDeviceObject Device)
 
static __inline MdDeviceObject MxAttachDeviceToDeviceStack (_In_ MdDeviceObject SourceDevice, _In_ MdDeviceObject TargetDevice)
 
static __inline NTSTATUS MxCreateDeviceSecure (_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _In_ PCUNICODE_STRING DefaultSDDLString, _In_opt_ LPCGUID DeviceClassGuid, _Out_ MdDeviceObject *DeviceObject)
 
static __inline NTSTATUS MxCreateDevice (_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _Out_ MdDeviceObject *DeviceObject)
 
static __inline NTSTATUS MxCreateSymbolicLink (_In_ PUNICODE_STRING SymbolicLinkName, _In_ PUNICODE_STRING DeviceName)
 
static __inline VOID MxFlushQueuedDpcs ()
 
static __inline NTSTATUS MxOpenKey (_Out_ PHANDLE KeyHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
 
static __inline NTSTATUS MxSetDeviceInterfaceState (_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
 
static __inline NTSTATUS MxRegisterDeviceInterface (_In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ const GUID *InterfaceClassGuid, _In_opt_ PUNICODE_STRING ReferenceString, _Out_ PUNICODE_STRING SymbolicLinkName)
 
static __inline NTSTATUS MxDeleteKey (_In_ HANDLE KeyHandle)
 
static __inline VOID MxInitializeMdl (_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
 
static __inline PVOID MxGetMdlVirtualAddress (_In_ PMDL Mdl)
 
static __inline VOID MxBuildPartialMdl (_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
 
static __inline VOID MxQuerySystemTime (_Out_ PLARGE_INTEGER CurrentTime)
 
static __inline NTSTATUS MxSetValueKey (_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_opt_ ULONG TitleIndex, _In_ ULONG Type, _In_opt_ PVOID Data, _In_ ULONG DataSize)
 
static __inline NTSTATUS MxQueryValueKey (_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, _Out_opt_ PVOID KeyValueInformation, _In_ ULONG Length, _Out_ PULONG ResultLength)
 
static __inline NTSTATUS MxReferenceObjectByHandle (__in HANDLE Handle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_TYPE ObjectType, __in KPROCESSOR_MODE AccessMode, __out PVOID *Object, __out_opt POBJECT_HANDLE_INFORMATION HandleInformation)
 
static __inline NTSTATUS MxUnRegisterPlugPlayNotification (__in __drv_freesMem(Pool) PVOID NotificationEntry)
 
static __inline NTSTATUS MxClose (__in HANDLE Handle)
 
static __inline KIRQL MxAcquireInterruptSpinLock (_Inout_ PKINTERRUPT Interrupt)
 
static __inline VOID MxReleaseInterruptSpinLock (_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
 
static __inline BOOLEAN MxInsertQueueDpc (__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
 

Public Attributes

__out __deref __drv_savesIRQL PKIRQL OldIrql
 

Detailed Description

Definition at line 40 of file mxgeneral.h.

Member Function Documentation

◆ __drv_maxIRQL() [1/2]

Mx::__drv_maxIRQL ( HIGH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

Mx::__drv_maxIRQL ( HIGH_LEVEL  )

◆ _Acquires_lock_()

Mx::_Acquires_lock_ ( _Global_critical_region_  )

◆ _Releases_lock_() [1/2]

Mx::_Releases_lock_ ( _Global_critical_region_  )

◆ _Releases_lock_() [2/2]

Mx::_Releases_lock_ ( _Global_cancel_spin_lock_  )

◆ CreateCallback()

__inline NTSTATUS Mx::CreateCallback ( __out PCALLBACK_OBJECT CallbackObject,
__in POBJECT_ATTRIBUTES  ObjectAttributes,
__in BOOLEAN  Create,
__in BOOLEAN  AllowMultipleCallbacks 
)
static

Definition at line 318 of file mxgeneralkm.h.

324 {
325  return ExCreateCallback(
326  CallbackObject,
328  Create,
330 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_In_ BOOLEAN Create
Definition: pstypes.h:527
NTSTATUS NTAPI ExCreateCallback(OUT PCALLBACK_OBJECT *CallbackObject, IN POBJECT_ATTRIBUTES ObjectAttributes, IN BOOLEAN Create, IN BOOLEAN AllowMultipleCallbacks)
Definition: callback.c:361
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:748

Referenced by FxPowerPolicyOwnerSettings::Init().

◆ GetCurrentEThread()

__inline MdEThread Mx::GetCurrentEThread ( )
static

Definition at line 69 of file mxgeneralkm.h.

71 {
72  return PsGetCurrentThread();
73 }
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81

Referenced by FX_VF_METHOD(), FxSystemThread::IsCurrentThread(), FxSystemThread::Thread(), and FxWorkItem::WaitForSignal().

◆ IsKM()

__inline BOOLEAN Mx::IsKM ( )
static

Definition at line 53 of file mxgeneralkm.h.

55 {
56  return TRUE;
57 }
#define TRUE
Definition: types.h:120

Referenced by FxPoolAllocator(), and FxPoolFree().

◆ IsUM()

__inline BOOLEAN Mx::IsUM ( )
static

Definition at line 45 of file mxgeneralkm.h.

47 {
48  return FALSE;
49 }
#define FALSE
Definition: types.h:117

Referenced by FxPoolAllocator().

◆ MxAcquireInterruptSpinLock()

__inline KIRQL Mx::MxAcquireInterruptSpinLock ( _Inout_ PKINTERRUPT  Interrupt)
static

Definition at line 767 of file mxgeneralkm.h.

770 {
772 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
KIRQL NTAPI KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
Definition: spinlock.c:154

Referenced by FxInterrupt::AcquireLock().

◆ MxAcquireRemoveLock()

__inline NTSTATUS Mx::MxAcquireRemoveLock ( __in MdRemoveLock  RemoveLock,
__in_opt PVOID  Tag 
)
static

Definition at line 268 of file mxgeneralkm.h.

272 {
273  return IoAcquireRemoveLock(RemoveLock, Tag);
274 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
#define IoAcquireRemoveLock(RemoveLock, Tag)

Referenced by FxDevice::_AcquireOptinRemoveLock(), FxPkgPnp::_PnpRemoveDevice(), FxPkgGeneral::AcquireRemoveLockForClose(), FxDevice::DispatchPreprocessedIrp(), FxDevice::DispatchWithLock(), and FxPkgPnp::PnpEventFinal().

◆ MxAllocateDriverObjectExtension()

__inline NTSTATUS Mx::MxAllocateDriverObjectExtension ( _In_ MdDriverObject  DriverObject,
_In_ PVOID  ClientIdentificationAddress,
_In_ ULONG  DriverObjectExtensionSize,
_Post_ _At_(*,(==0, Mem  _Post_notnull_ 
)
static

Definition at line 396 of file mxgeneralkm.h.

406 {
409  DriverObjectExtensionSize,
410  DriverObjectExtension);
411 }
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1799
__drv_aliasesMem _In_ PVOID ClientIdentificationAddress
Definition: iofuncs.h:1028
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

Referenced by FxDriver::AllocateDriverObjectExtensionAndStoreFxDriver().

◆ MxAssert()

__inline VOID Mx::MxAssert ( __in BOOLEAN  Condition)
static

Definition at line 165 of file mxgeneralkm.h.

168 {
170 
171  ASSERT(Condition); //this get defined as RtlAssert
172 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN ULONG IN UCHAR Condition
#define ASSERT(a)
Definition: mode.c:44

Referenced by __drv_when(), FxPkgPnp::CleanupDeviceFromFailedCreate(), FxPkgPnp::Dispatch(), FxPkgPdo::Initialize(), MxWorkItem::WaitForCallbacksToComplete(), and FxPkgPnp::~FxPkgPnp().

◆ MxAssertMsg()

__inline VOID Mx::MxAssertMsg ( __in LPSTR  Message,
__in BOOLEAN  Condition 
)
static

Definition at line 176 of file mxgeneralkm.h.

180 {
183 
184  ASSERT(Condition);
185 
186  // ASSERTMSG(Message, Condition); TODO: wtf
187 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN ULONG IN UCHAR Condition
#define ASSERT(a)
Definition: mode.c:44
CHAR Message[80]
Definition: alive.c:5

Referenced by __drv_when(), and MxLockNoDynam::TryToAcquire().

◆ MxAttachDeviceToDeviceStack()

__inline MdDeviceObject Mx::MxAttachDeviceToDeviceStack ( _In_ MdDeviceObject  SourceDevice,
_In_ MdDeviceObject  TargetDevice 
)
static

Definition at line 511 of file mxgeneralkm.h.

515 {
517 }
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:690
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:690
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966

Referenced by FxDevice::FdoInitialize().

◆ MxBugCheckEx()

VOID Mx::MxBugCheckEx ( __in ULONG  BugCheckCode,
__in ULONG_PTR  BugCheckParameter1,
__in ULONG_PTR  BugCheckParameter2,
__in ULONG_PTR  BugCheckParameter3,
__in ULONG_PTR  BugCheckParameter4 
)
static

Definition at line 133 of file mxgeneralkm.h.

140 {
141 #ifdef _MSC_VER
142  #pragma prefast(suppress:__WARNING_USE_OTHER_FUNCTION, "KeBugCheckEx is the intent.");
143 #endif
144  KeBugCheckEx(
145  BugCheckCode,
146  BugCheckParameter1,
147  BugCheckParameter2,
148  BugCheckParameter3,
149  BugCheckParameter4
150  );
151 
152  UNREACHABLE;
153 }
#define UNREACHABLE
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108

Referenced by FxPoolFree(), FxVerifierBugCheckWorker(), WdfCxVerifierKeBugCheck(), and WdfVerifierKeBugCheck().

◆ MxBuildMdlForNonPagedPool()

__inline VOID Mx::MxBuildMdlForNonPagedPool ( __inout PMDL  Mdl)
static

Definition at line 376 of file mxgeneralkm.h.

379 {
381 }
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
Definition: mdlsup.c:415
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequest::GetDeviceControlOutputMdl(), and FxRequest::GetMdl().

◆ MxBuildPartialMdl()

__inline VOID Mx::MxBuildPartialMdl ( _In_ PMDL  SourceMdl,
_Inout_ PMDL  TargetMdl,
_In_ PVOID  VirtualAddress,
_In_ ULONG  Length 
)
static

Definition at line 663 of file mxgeneralkm.h.

669 {
670  IoBuildPartialMdl(SourceMdl,
671  TargetMdl,
673  Length
674  );
675 }
_Inout_ PMDL TargetMdl
Definition: iofuncs.h:730
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID NTAPI IoBuildPartialMdl(IN PMDL SourceMdl, IN PMDL TargetMdl, IN PVOID VirtualAddress, IN ULONG Length)
Definition: iomdl.c:96
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress

Referenced by FxRequestBuffer::GetOrAllocateMdl().

◆ MxClose()

__inline NTSTATUS Mx::MxClose ( __in HANDLE  Handle)
static

Definition at line 758 of file mxgeneralkm.h.

761 {
762  return ZwClose(Handle);
763 }
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ HANDLE Handle
Definition: extypes.h:390

Referenced by FxIoTargetRemote::Close().

◆ MxCreateDevice()

__inline NTSTATUS Mx::MxCreateDevice ( _In_ MdDriverObject  DriverObject,
_In_ ULONG  DeviceExtensionSize,
_In_opt_ PUNICODE_STRING  DeviceName,
_In_ DEVICE_TYPE  DeviceType,
_In_ ULONG  DeviceCharacteristics,
_In_ BOOLEAN  Exclusive,
_Out_ MdDeviceObject DeviceObject 
)
static

Definition at line 557 of file mxgeneralkm.h.

566 {
568  DeviceExtensionSize,
569  DeviceName,
570  DeviceType,
572  Exclusive,
573  DeviceObject);
574 
575 }
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2772
DeviceType
Definition: mmdrv.h:41
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031

Referenced by FxDevice::CreateDevice().

◆ MxCreateDeviceSecure()

__inline NTSTATUS Mx::MxCreateDeviceSecure ( _In_ MdDriverObject  DriverObject,
_In_ ULONG  DeviceExtensionSize,
_In_opt_ PUNICODE_STRING  DeviceName,
_In_ DEVICE_TYPE  DeviceType,
_In_ ULONG  DeviceCharacteristics,
_In_ BOOLEAN  Exclusive,
_In_ PCUNICODE_STRING  DefaultSDDLString,
_In_opt_ LPCGUID  DeviceClassGuid,
_Out_ MdDeviceObject DeviceObject 
)
static

Definition at line 521 of file mxgeneralkm.h.

532 {
533 #ifndef __REACTOS__ // we don't have wdmsec.lib
534  return IoCreateDeviceSecure(DriverObject,
535  DeviceExtensionSize,
536  DeviceName,
537  DeviceType,
539  Exclusive,
540  DefaultSDDLString,
542  DeviceObject);
543 #else
544  return IoCreateDevice(
545  DriverObject,
546  DeviceExtensionSize,
547  DeviceName,
548  DeviceType,
550  Exclusive,
551  DeviceObject);
552 #endif
553 }
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2772
DeviceType
Definition: mmdrv.h:41
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
Definition: wdfdevice.h:3333
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031

Referenced by FxDevice::CreateDevice().

◆ MxCreateSymbolicLink()

__inline NTSTATUS Mx::MxCreateSymbolicLink ( _In_ PUNICODE_STRING  SymbolicLinkName,
_In_ PUNICODE_STRING  DeviceName 
)
static

Definition at line 579 of file mxgeneralkm.h.

583 {
585 }
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3736

Referenced by FxDevice::CreateSymbolicLink().

◆ MxDbgBreakPoint()

__inline VOID Mx::MxDbgBreakPoint ( )
static

Definition at line 157 of file mxgeneralkm.h.

159 {
160  DbgBreakPoint();
161 }
VOID NTAPI DbgBreakPoint(VOID)

Referenced by FxVerifierBreakOnDeviceStateError(), and FxVerifierDbgBreakPoint().

◆ MxDbgPrint()

VOID Mx::MxDbgPrint ( __drv_formatString(printf) __in PCSTR  DebugMessage,
  ... 
)
static

Definition at line 7 of file mxgeneralkm.cpp.

12 {
13 #if DBG
14 
15 #define TEMP_BUFFER_SIZE 1024
16  va_list list;
17  CHAR debugMessageBuffer[TEMP_BUFFER_SIZE];
19 
20  va_start(list, DebugMessage);
21 
22  if (DebugMessage) {
23 
24  //
25  // Using new safe string functions instead of _vsnprintf.
26  // This function takes care of NULL terminating if the message
27  // is longer than the buffer.
28  //
29  status = RtlStringCbVPrintfA( debugMessageBuffer,
30  sizeof(debugMessageBuffer),
31  DebugMessage,
32  list );
33  if(!NT_SUCCESS(status)) {
34 
35  DbgPrint ("WDF DbgPrint: Unable to expand: %s", DebugMessage);
36  }
37  else {
38  DbgPrint("%s", debugMessageBuffer);
39  }
40  }
41  va_end(list);
42 
43 #else
44  UNREFERENCED_PARAMETER(DebugMessage);
45 #endif
46  return;
47 }
#define DbgPrint
Definition: hal.h:12
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
#define va_end(ap)
Definition: acmsvcex.h:90
NTSTATUS RtlStringCbVPrintfA(char *pszDest, size_t cbDest, const char *pszFormat, va_list argList)
char * va_list
Definition: acmsvcex.h:78
#define TEMP_BUFFER_SIZE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
va_start(ap, x)
Definition: _list.h:228
#define list
Definition: rosglue.h:35
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by FxVerifierBreakOnDeviceStateError(), and FxVerifierDbgBreakPoint().

◆ MxDelayExecutionThread()

__inline VOID Mx::MxDelayExecutionThread ( __in KPROCESSOR_MODE  WaitMode,
__in BOOLEAN  Alertable,
__in PLARGE_INTEGER  Interval 
)
static

Definition at line 209 of file mxgeneralkm.h.

214 {
215  ASSERTMSG("Interval must be relative\n", Interval->QuadPart <= 0);
216 
218  WaitMode,
219  Alertable,
220  Interval
221  );
222 }
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
DWORD Interval
Definition: netstat.c:33

Referenced by FxVerifierLock::Lock(), FxPkgPnp::PowerPolicySendDevicePowerRequest(), and FxVerifierLock::Unlock().

◆ MxDeleteDevice()

__inline VOID Mx::MxDeleteDevice ( _In_ MdDeviceObject  Device)
static

Definition at line 493 of file mxgeneralkm.h.

496 {
498 }
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251

Referenced by FxDevice::DeleteObject(), FxDevice::Destroy(), and FxDevice::FdoInitialize().

◆ MxDeleteKey()

__inline NTSTATUS Mx::MxDeleteKey ( _In_ HANDLE  KeyHandle)
static

Definition at line 634 of file mxgeneralkm.h.

637 {
638  return ZwDeleteKey(KeyHandle);
639 }
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711

◆ MxDeleteNPagedLookasideList()

__inline VOID Mx::MxDeleteNPagedLookasideList ( _In_ PNPAGED_LOOKASIDE_LIST  LookasideList)
static

Definition at line 433 of file mxgeneralkm.h.

436 {
438 }
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
Definition: fltkernel.h:2550

Referenced by FxDevice::~FxDevice(), and FxPagedLookasideListFromPool::~FxPagedLookasideListFromPool().

◆ MxDeletePagedLookasideList()

__inline VOID Mx::MxDeletePagedLookasideList ( _In_ PPAGED_LOOKASIDE_LIST  LookasideList)
static

Definition at line 442 of file mxgeneralkm.h.

445 {
447 }
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:194
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
Definition: fltkernel.h:2550

Referenced by FxPagedLookasideListFromPool::~FxPagedLookasideListFromPool().

◆ MxDeleteSymbolicLink()

__inline VOID Mx::MxDeleteSymbolicLink ( __in PUNICODE_STRING  Link)
static

Definition at line 424 of file mxgeneralkm.h.

427 {
429 }
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406

◆ MxDereferenceObject()

__inline VOID Mx::MxDereferenceObject ( __in PVOID  Object)
static

◆ MxDetachDevice()

VOID Mx::MxDetachDevice ( _Inout_ MdDeviceObject  Device)
static

Definition at line 502 of file mxgeneralkm.h.

505 {
507 }
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

Referenced by FxDevice::DetachDevice().

◆ MxFlushQueuedDpcs()

__inline VOID Mx::MxFlushQueuedDpcs ( )
static

Definition at line 589 of file mxgeneralkm.h.

591 {
593 }
VOID NTAPI KeFlushQueuedDpcs(VOID)
Definition: dpc.c:919

Referenced by MxTimer::FlushQueuedDpcs().

◆ MxGetAttachedDeviceReference()

__inline MdDeviceObject Mx::MxGetAttachedDeviceReference ( __in MdDeviceObject  DriverObject)
static

Definition at line 415 of file mxgeneralkm.h.

418 {
420 }
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1406
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

Referenced by FxDeviceBase::GetAttachedDeviceReference().

◆ MxGetCurrentIrql()

◆ MxGetCurrentThread()

◆ MxGetDriverObjectExtension()

__inline PVOID Mx::MxGetDriverObjectExtension ( __in MdDriverObject  DriverObject,
__in PVOID  ClientIdentificationAddress 
)
static

Definition at line 385 of file mxgeneralkm.h.

389 {
392 }
__drv_aliasesMem _In_ PVOID ClientIdentificationAddress
Definition: iofuncs.h:1028
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1877

Referenced by FxDriver::GetFxDriver().

◆ MxGetMdlVirtualAddress()

__inline PVOID Mx::MxGetMdlVirtualAddress ( _In_ PMDL  Mdl)
static

Definition at line 654 of file mxgeneralkm.h.

657 {
658  return MmGetMdlVirtualAddress(Mdl);
659 }
#define MmGetMdlVirtualAddress(_Mdl)
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequestBuffer::GetOrAllocateMdl().

◆ MxGetSystemAddressForMdlSafe()

__inline PVOID Mx::MxGetSystemAddressForMdlSafe ( __inout PMDL  Mdl,
__in ULONG  Priority 
)
static

Definition at line 366 of file mxgeneralkm.h.

370 {
372 }
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequestBuffer::GetBuffer(), FxRequestSystemBuffer::GetBuffer(), FxRequestOutputBuffer::GetBuffer(), FxRequest::GetDeviceControlOutputMemoryObject(), FxRequest::GetMemoryObject(), FxRequest::ProbeAndLockForRead(), and FxRequest::ProbeAndLockForWrite().

◆ MxGetSystemRoutineAddress()

__inline PVOID Mx::MxGetSystemRoutineAddress ( __in MxFuncName  FuncName)
static

Definition at line 226 of file mxgeneralkm.h.

229 {
230  UNICODE_STRING funcName;
231 
232  RtlInitUnicodeString(&funcName, FuncName);
233  return MmGetSystemRoutineAddress(&funcName);
234 }
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3514
macro IMPORT Name endm macro EXPORT Name global &Name endm macro TEXTAREA section rx align endm macro DATAAREA section rw endm macro RODATAAREA section rw endm macro NESTED_ENTRY Name FuncName equ &Name PrologName equ &Name &_Prolog FuncEndName equ &Name &_end global &FuncName align func &FuncName & FuncName
Definition: kxarm.h:185
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by FxLibraryGlobalsCommission(), and FxLibraryGlobalsVerifyVersion().

◆ MxGlobalInit()

VOID Mx::MxGlobalInit ( VOID  )
static

Definition at line 51 of file mxgeneralkm.cpp.

54 {
55  //
56  // Global initialization for kernel-mode primitives
57  //
58 }

Referenced by FxLibraryGlobalsCommission().

◆ MxHasEnoughRemainingThreadStack()

__inline BOOLEAN Mx::MxHasEnoughRemainingThreadStack ( VOID  )
static

Definition at line 298 of file mxgeneralkm.h.

301 {
302  return (IoGetRemainingStackSize() < KERNEL_STACK_SIZE/2) ? FALSE : TRUE;
303 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define KERNEL_STACK_SIZE

Referenced by FxPkgPnp::PnpDeviceUsageNotification(), and FxPkgPdo::PnpQueryCapabilities().

◆ MxInitializeMdl()

__inline VOID Mx::MxInitializeMdl ( _In_ PMDL  MemoryDescriptorList,
_In_ PVOID  BaseVa,
_In_ SIZE_T  Length 
)
static

Definition at line 643 of file mxgeneralkm.h.

648 {
650 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define MmInitializeMdl(_MemoryDescriptorList, _BaseVa, _Length)
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405

Referenced by FxRequestBuffer::GetOrAllocateMdl().

◆ MxInitializeNPagedLookasideList()

__inline VOID Mx::MxInitializeNPagedLookasideList ( _Out_ PNPAGED_LOOKASIDE_LIST  Lookaside,
_In_opt_ PALLOCATE_FUNCTION  Allocate,
_In_opt_ PFREE_FUNCTION  Free,
_In_ ULONG  Flags,
_In_ SIZE_T  Size,
_In_ ULONG  Tag,
_In_ USHORT  Depth 
)
static

Definition at line 451 of file mxgeneralkm.h.

460 {
462  Allocate,
463  Free,
464  Flags,
465  Size,
466  Tag,
467  Depth);
468 }
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:407
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:814
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061

Referenced by FxPagedLookasideListFromPool::Initialize(), and FxDevice::Initialize().

◆ MxInitializePagedLookasideList()

__inline VOID Mx::MxInitializePagedLookasideList ( _Out_ PPAGED_LOOKASIDE_LIST  Lookaside,
_In_opt_ PALLOCATE_FUNCTION  Allocate,
_In_opt_ PFREE_FUNCTION  Free,
_In_ ULONG  Flags,
_In_ SIZE_T  Size,
_In_ ULONG  Tag,
_In_ USHORT  Depth 
)
static

Definition at line 472 of file mxgeneralkm.h.

481 {
483  Allocate,
484  Free,
485  Flags,
486  Size,
487  Tag,
488  Depth);
489 }
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
VOID NTAPI ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:270
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:407
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:814
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061

Referenced by FxPagedLookasideListFromPool::Initialize().

◆ MxInitializeRemoveLock()

__inline VOID Mx::MxInitializeRemoveLock ( __in MdRemoveLock  Lock,
__in ULONG  AllocateTag,
__in ULONG  MaxLockedMinutes,
__in ULONG  HighWatermark 
)
static

Definition at line 256 of file mxgeneralkm.h.

262 {
264 }
#define IoInitializeRemoveLock(Lock, AllocateTag, MaxLockedMinutes, HighWatermark)
Definition: iofuncs.h:2833
LONG MaxLockedMinutes
Definition: lock.c:35
_In_ ULONG AllocateTag
Definition: iofuncs.h:1067
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
Definition: iofuncs.h:1067

Referenced by FxDevice::CreateDevice().

◆ MxInsertQueueDpc()

__inline BOOLEAN Mx::MxInsertQueueDpc ( __inout PRKDPC  Dpc,
__in_opt PVOID  SystemArgument1,
__in_opt PVOID  SystemArgument2 
)
static

Definition at line 786 of file mxgeneralkm.h.

791 {
793 }
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:107
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:725
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675

Referenced by FxInterrupt::QueueWorkItemForIsr().

◆ MxOpenKey()

__inline NTSTATUS Mx::MxOpenKey ( _Out_ PHANDLE  KeyHandle,
_In_ ACCESS_MASK  DesiredAccess,
_In_ POBJECT_ATTRIBUTES  ObjectAttributes 
)
static

Definition at line 597 of file mxgeneralkm.h.

602 {
603  return ZwOpenKey(KeyHandle, DesiredAccess, ObjectAttributes);
604 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711

◆ MxQuerySystemTime()

__inline VOID Mx::MxQuerySystemTime ( _Out_ PLARGE_INTEGER  CurrentTime)
static

Definition at line 679 of file mxgeneralkm.h.

682 {
683  KeQuerySystemTime(CurrentTime);
684 }
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570

Referenced by IsLoggingEnabledAndNeeded(), and RegistryWriteCurrentTime().

◆ MxQueryTickCount()

__inline VOID Mx::MxQueryTickCount ( __out PLARGE_INTEGER  TickCount)
static

Definition at line 116 of file mxgeneralkm.h.

119 {
120  KeQueryTickCount(TickCount);
121 }
VOID NTAPI KeQueryTickCount(IN PLARGE_INTEGER TickCount)
Definition: clock.c:165

Referenced by __drv_raisesIRQL(), __drv_requiresIRQL(), FxPkgIo::FxPkgIo(), FxTagTrackingBlock::FxTagTrackingBlock(), FxPkgPnp::PnpIncrementRestartCountLogic(), and FxTagTracker::UpdateTagHistory().

◆ MxQueryTimeIncrement()

__inline ULONG Mx::MxQueryTimeIncrement ( )
static

Definition at line 125 of file mxgeneralkm.h.

127 {
128  return KeQueryTimeIncrement();
129 }
ULONG NTAPI KeQueryTimeIncrement(VOID)
Definition: clock.c:153

Referenced by FxPkgPnp::PnpIncrementRestartCountLogic().

◆ MxQueryValueKey()

__inline NTSTATUS Mx::MxQueryValueKey ( _In_ HANDLE  KeyHandle,
_In_ PUNICODE_STRING  ValueName,
_In_ KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
_Out_opt_ PVOID  KeyValueInformation,
_In_ ULONG  Length,
_Out_ PULONG  ResultLength 
)
static

Definition at line 708 of file mxgeneralkm.h.

716 {
717  return ZwQueryValueKey(KeyHandle,
718  ValueName,
720  KeyValueInformation,
721  Length,
723  );
724 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
Definition: cmfuncs.h:93

◆ MxReferenceObject()

__inline VOID Mx::MxReferenceObject ( __in PVOID  Object)
static

◆ MxReferenceObjectByHandle()

__inline NTSTATUS Mx::MxReferenceObjectByHandle ( __in HANDLE  Handle,
__in ACCESS_MASK  DesiredAccess,
__in_opt POBJECT_TYPE  ObjectType,
__in KPROCESSOR_MODE  AccessMode,
__out PVOID Object,
__out_opt POBJECT_HANDLE_INFORMATION  HandleInformation 
)
static

Definition at line 728 of file mxgeneralkm.h.

736 {
738  Handle,
740  ObjectType,
741  AccessMode,
742  Object,
744 }
ObjectType
Definition: metafile.c:80
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:395
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:40
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ HANDLE Handle
Definition: extypes.h:390

◆ MxRegisterDeviceInterface()

__inline NTSTATUS Mx::MxRegisterDeviceInterface ( _In_ PDEVICE_OBJECT  PhysicalDeviceObject,
_In_ const GUID InterfaceClassGuid,
_In_opt_ PUNICODE_STRING  ReferenceString,
_Out_ PUNICODE_STRING  SymbolicLinkName 
)
static

Definition at line 619 of file mxgeneralkm.h.

625 {
630 }
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1155
NTSTATUS NTAPI IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, IN CONST GUID *InterfaceClassGuid, IN PUNICODE_STRING ReferenceString OPTIONAL, OUT PUNICODE_STRING SymbolicLinkName)
Definition: deviface.c:955
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3625
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3736

Referenced by FxDeviceInterface::Register().

◆ MxReleaseInterruptSpinLock()

__inline VOID Mx::MxReleaseInterruptSpinLock ( _Inout_ PKINTERRUPT  Interrupt,
_In_ KIRQL  OldIrql 
)
static

Definition at line 776 of file mxgeneralkm.h.

780 {
782 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
__out __deref __drv_savesIRQL PKIRQL OldIrql
Definition: mxgeneral.h:98
VOID NTAPI KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt, IN KIRQL OldIrql)
Definition: spinlock.c:171

Referenced by FxInterrupt::ReleaseLock().

◆ MxReleaseRemoveLock()

__inline VOID Mx::MxReleaseRemoveLock ( __in MdRemoveLock  RemoveLock,
__in PVOID  Tag 
)
static

Definition at line 278 of file mxgeneralkm.h.

282 {
283  IoReleaseRemoveLock(RemoveLock, Tag);
284 }
#define IoReleaseRemoveLock(_RemoveLock, _Tag)
Definition: iofuncs.h:2764
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061

Referenced by FxPkgFdo::_PnpPassDown(), FxPkgFdo::_PowerPassDown(), FxPkgPnp::CompletePnpRequest(), FxPkgPnp::CompletePowerRequest(), FxDefaultIrpHandler::Dispatch(), FxDevice::DispatchWithLock(), FxPkgGeneral::OnClose(), and PreprocessIrp().

◆ MxReleaseRemoveLockAndWait()

__inline VOID Mx::MxReleaseRemoveLockAndWait ( __in MdRemoveLock  RemoveLock,
__in PVOID  Tag 
)
static

Definition at line 288 of file mxgeneralkm.h.

292 {
293  IoReleaseRemoveLockAndWait(RemoveLock, Tag);
294 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
#define IoReleaseRemoveLockAndWait(_RemoveLock, _Tag)
Definition: iofuncs.h:2774

Referenced by FxPkgPnp::PnpEventFinal(), FxPkgFdo::ProcessRemoveDeviceOverload(), and FxPkgPdo::ProcessRemoveDeviceOverload().

◆ MxSetDeviceInterfaceState()

__inline NTSTATUS Mx::MxSetDeviceInterfaceState ( _In_ PUNICODE_STRING  SymbolicLinkName,
_In_ BOOLEAN  Enable 
)
static

Definition at line 608 of file mxgeneralkm.h.

612 {
614 }
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
Definition: deviface.c:1311
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3736

Referenced by FxDeviceInterface::SetState().

◆ MxSetValueKey()

__inline NTSTATUS Mx::MxSetValueKey ( _In_ HANDLE  KeyHandle,
_In_ PUNICODE_STRING  ValueName,
_In_opt_ ULONG  TitleIndex,
_In_ ULONG  Type,
_In_opt_ PVOID  Data,
_In_ ULONG  DataSize 
)
static

Definition at line 688 of file mxgeneralkm.h.

696 {
697  return ZwSetValueKey(KeyHandle,
698  ValueName,
699  TitleIndex,
700  Type,
701  Data,
702  DataSize
703  );
704 }
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:130
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
Type
Definition: Type.h:6
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751

Referenced by RegistryWriteCurrentTime().

◆ MxTerminateCurrentThread()

__inline NTSTATUS Mx::MxTerminateCurrentThread ( __in NTSTATUS  Status)
static

Definition at line 77 of file mxgeneralkm.h.

80 {
82 }
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1144

◆ MxUnlockPages()

__inline VOID Mx::MxUnlockPages ( __in PMDL  Mdl)
static

Definition at line 357 of file mxgeneralkm.h.

360 {
362 }
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1426
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequest::ProbeAndLockForRead(), FxRequest::ProbeAndLockForWrite(), FxUsbDeviceControlContext::ReleaseAndRestore(), and FxRequestMemory::~FxRequestMemory().

◆ MxUnRegisterPlugPlayNotification()

__inline NTSTATUS Mx::MxUnRegisterPlugPlayNotification ( __in __drv_freesMem(Pool) PVOID  NotificationEntry)
static

Definition at line 748 of file mxgeneralkm.h.

751 {
753 }
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
Definition: pnpnotify.c:479

◆ RegisterCallback()

__inline PVOID Mx::RegisterCallback ( __in PCALLBACK_OBJECT  CallbackObject,
__in MdCallbackFunction  CallbackFunction,
__in PVOID  CallbackContext 
)
static

Definition at line 334 of file mxgeneralkm.h.

339 {
340  return ExRegisterCallback(
341  CallbackObject,
344 }
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:55
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:1034
PVOID NTAPI ExRegisterCallback(IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext)
Definition: callback.c:556

Referenced by FxPowerPolicyOwnerSettings::Init().

◆ UnregisterCallback()

__inline VOID Mx::UnregisterCallback ( __in PVOID  CbRegistration)
static

Definition at line 348 of file mxgeneralkm.h.

351 {
352  ExUnregisterCallback(CbRegistration);
353 }
VOID NTAPI ExUnregisterCallback(IN PVOID CallbackRegistrationHandle)
Definition: callback.c:636

Referenced by FxPowerPolicyOwnerSettings::CleanupPowerCallback().

Member Data Documentation

◆ OldIrql

Definition at line 98 of file mxgeneral.h.

Referenced by __drv_maxIRQL(), and MxReleaseInterruptSpinLock().


The documentation for this class was generated from the following files: