ReactOS 0.4.15-dev-5667-ged97270
FxCallbackMutexLock Class Reference

#include <fxcallbackmutexlock.hpp>

Inheritance diagram for FxCallbackMutexLock:
Collaboration diagram for FxCallbackMutexLock:

Public Member Functions

 FxCallbackMutexLock (PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxCallbackMutexLock ()
 
virtual void Initialize (FxObject *ParentObject)
 
virtual void Lock (__out PKIRQL PreviousIrql)
 
virtual void Unlock (__in KIRQL PreviousIrql)
 
virtual _Must_inspect_result_ BOOLEAN IsOwner (VOID)
 
- Public Member Functions inherited from FxCallbackLock
 FxCallbackLock (PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxCallbackLock ()
 
virtual void Initialize (FxObject *ParentObject)=0
 
virtual void Lock (__out PKIRQL PreviousIrql)=0
 
virtual void Unlock (__in KIRQL PreviousIrql)=0
 
virtual _Must_inspect_result_ BOOLEAN IsOwner (VOID)=0
 
VOID CheckOwnership (VOID)
 
- Public Member Functions inherited from FxGlobalsStump
 FxGlobalsStump (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
- Public Member Functions inherited from FxStump
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType)
 
VOID operator delete (__in PVOID pointer)
 
PVOID operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete[] (__in PVOID pointer)
 

Private Attributes

MxPagedLock m_Lock
 

Additional Inherited Members

- Public Attributes inherited from FxCallbackLock
KIRQL m_PreviousIrql
 
- Protected Member Functions inherited from FxStump
 FxStump (VOID)
 
- Protected Attributes inherited from FxCallbackLock
MxThread m_OwnerThread
 
ULONG m_RecursionCount
 
FxVerifierLockm_Verifier
 

Detailed Description

Definition at line 34 of file fxcallbackmutexlock.hpp.

Constructor & Destructor Documentation

◆ FxCallbackMutexLock()

FxCallbackMutexLock::FxCallbackMutexLock ( PFX_DRIVER_GLOBALS  FxDriverGlobals)
inline

Definition at line 48 of file fxcallbackmutexlock.hpp.

50 :
51 FxCallbackLock(FxDriverGlobals)
52 {
54 }
_Must_inspect_result_ __inline NTSTATUS Initialize()
Definition: mxpagedlockkm.h:52

◆ ~FxCallbackMutexLock()

virtual FxCallbackMutexLock::~FxCallbackMutexLock ( )
inlinevirtual

Definition at line 57 of file fxcallbackmutexlock.hpp.

58 {
59 if (m_Verifier) {
60 delete m_Verifier;
61 }
62 }
FxVerifierLock * m_Verifier

Member Function Documentation

◆ Initialize()

virtual void FxCallbackMutexLock::Initialize ( FxObject ParentObject)
inlinevirtual

Implements FxCallbackLock.

Definition at line 66 of file fxcallbackmutexlock.hpp.

69 {
71
74
76
77 //
78 // VerifierLock CreateAndInitialize failure is not fatal,
79 // we just won't track anything
80 //
83 ParentObject,
84 TRUE);
85 }
86 }
_Must_inspect_result_ static __inline NTSTATUS CreateAndInitialize(__out FxVerifierLock **VerifierLock, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *ParentObject, __in BOOLEAN UseMutex)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
PFX_DRIVER_GLOBALS fxDriverGlobals
PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxstump.hpp:98
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451

Referenced by FxDriver::ConfigureConstraints(), and FxIoQueue::ConfigureConstraints().

◆ IsOwner()

virtual _Must_inspect_result_ BOOLEAN FxCallbackMutexLock::IsOwner ( VOID  )
inlinevirtual

Implements FxCallbackLock.

Definition at line 158 of file fxcallbackmutexlock.hpp.

161 {
163
164 if (m_OwnerThread == cur) {
165 return TRUE;
166 }
167 else {
168 return FALSE;
169 }
170 }
MxThread m_OwnerThread
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
#define FALSE
Definition: types.h:117
FxCollectionEntry * cur

◆ Lock()

virtual void FxCallbackMutexLock::Lock ( __out PKIRQL  PreviousIrql)
inlinevirtual

Implements FxCallbackLock.

Definition at line 90 of file fxcallbackmutexlock.hpp.

93 {
95
96 if (m_OwnerThread == cur) {
98
101
102 //
103 // For now we have decided not to allow this.
104 //
105
106
107
108
109
110
111
112 //
114 "Recursive acquire of callback lock 0x%p", this);
115
118 (ULONG_PTR)this);
119 }
120 else {
121 if (m_Verifier != NULL) {
122 m_Verifier->Lock(PreviousIrql, FALSE);
123 }
124 else {
125 Mx::MxEnterCriticalRegion();
127 }
129 }
130 }
VOID Lock(__out PKIRQL PreviousIrql, __in BOOLEAN AtDpc)
__inline VOID AcquireUnsafe()
Definition: mxpagedlockkm.h:78
#define TRACINGDEVICE
Definition: dbgtrace.h:58
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
#define TRACE_LEVEL_FATAL
Definition: storswtr.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:65
@ WDF_RECURSIVE_LOCK
Definition: wdfbugcodes.h:59

◆ Unlock()

virtual void FxCallbackMutexLock::Unlock ( __in KIRQL  PreviousIrql)
inlinevirtual

Implements FxCallbackLock.

Definition at line 134 of file fxcallbackmutexlock.hpp.

137 {
139
140 if (m_RecursionCount > 0) {
142 }
143 else {
145 if (m_Verifier) {
146 m_Verifier->Unlock(PreviousIrql, FALSE);
147 }
148 else {
150 Mx::MxLeaveCriticalRegion();
151 }
152 }
153 }
VOID CheckOwnership(VOID)
VOID Unlock(__in KIRQL PreviousIrql, __in BOOLEAN AtDpc)
__inline VOID ReleaseUnsafe()

Member Data Documentation

◆ m_Lock

MxPagedLock FxCallbackMutexLock::m_Lock
private

Definition at line 44 of file fxcallbackmutexlock.hpp.

Referenced by FxCallbackMutexLock(), Lock(), and Unlock().


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