ReactOS  0.4.15-dev-3165-gdf6fff7
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 ()
 
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  }
FxCallbackLock(PFX_DRIVER_GLOBALS FxDriverGlobals)
_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 
72  m_Verifier = NULL;
74 
76 
77  //
78  // VerifierLock CreateAndInitialize failure is not fatal,
79  // we just won't track anything
80  //
83  ParentObject,
84  TRUE);
85  }
86  }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define TRUE
Definition: types.h:120
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451
FxVerifierLock * m_Verifier
PFX_DRIVER_GLOBALS fxDriverGlobals
#define NULL
Definition: types.h:112
_Must_inspect_result_ static __inline NTSTATUS CreateAndInitialize(__out FxVerifierLock **VerifierLock, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *ParentObject, __in BOOLEAN UseMutex)
PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxstump.hpp:98

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
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
FxCollectionEntry * cur
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61

◆ 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  }
128  m_OwnerThread = cur;
129  }
130  }
MxThread m_OwnerThread
__inline VOID AcquireUnsafe()
Definition: mxpagedlockkm.h:78
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
#define TRACE_LEVEL_FATAL
Definition: storswtr.h:26
VOID Lock(__out PKIRQL PreviousIrql, __in BOOLEAN AtDpc)
#define TRACINGDEVICE
Definition: dbgtrace.h:58
FxVerifierLock * m_Verifier
FxCollectionEntry * cur
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
PFX_DRIVER_GLOBALS fxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxstump.hpp:98

◆ Unlock()

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

Implements FxCallbackLock.

Definition at line 134 of file fxcallbackmutexlock.hpp.

137  {
138  CheckOwnership();
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  }
MxThread m_OwnerThread
__inline VOID ReleaseUnsafe()
VOID Unlock(__in KIRQL PreviousIrql, __in BOOLEAN AtDpc)
#define FALSE
Definition: types.h:117
FxVerifierLock * m_Verifier
VOID CheckOwnership(VOID)
#define NULL
Definition: types.h:112

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: