ReactOS  0.4.15-dev-3308-g9455def
FxCallbackSpinLock Class Reference

#include <fxcallbackspinlock.hpp>

Inheritance diagram for FxCallbackSpinLock:
Collaboration diagram for FxCallbackSpinLock:

Public Member Functions

 FxCallbackSpinLock (PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxCallbackSpinLock (VOID)
 
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

MxLock 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 37 of file fxcallbackspinlock.hpp.

Constructor & Destructor Documentation

◆ FxCallbackSpinLock()

FxCallbackSpinLock::FxCallbackSpinLock ( PFX_DRIVER_GLOBALS  FxDriverGlobals)
inline

Definition at line 44 of file fxcallbackspinlock.hpp.

46  :
47  FxCallbackLock(FxDriverGlobals)
48  {
49  }
FxCallbackLock(PFX_DRIVER_GLOBALS FxDriverGlobals)

◆ ~FxCallbackSpinLock()

virtual FxCallbackSpinLock::~FxCallbackSpinLock ( VOID  )
inlinevirtual

Definition at line 52 of file fxcallbackspinlock.hpp.

55  {
56  if (m_Verifier) {
57  delete m_Verifier;
58  }
59  }
FxVerifierLock * m_Verifier

Member Function Documentation

◆ Initialize()

virtual void FxCallbackSpinLock::Initialize ( FxObject ParentObject)
inlinevirtual

Implements FxCallbackLock.

Definition at line 63 of file fxcallbackspinlock.hpp.

66  {
68 
69  m_Verifier = NULL;
71 
73 
74  //
75  // VerifierLock CreateAndInitialize failure is not fatal,
76  // we just won't track anything
77  //
80  ParentObject,
81  FALSE);
82 
83  }
84  }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define FALSE
Definition: types.h:117
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 FxIoQueue::ConfigureConstraints().

◆ IsOwner()

virtual _Must_inspect_result_ BOOLEAN FxCallbackSpinLock::IsOwner ( VOID  )
inlinevirtual

Implements FxCallbackLock.

Definition at line 156 of file fxcallbackspinlock.hpp.

159  {
161 
162  if (m_OwnerThread == cur) {
163  return TRUE;
164  }
165  else {
166  return FALSE;
167  }
168  }
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 FxCallbackSpinLock::Lock ( __out PKIRQL  PreviousIrql)
inlinevirtual

Implements FxCallbackLock.

Definition at line 88 of file fxcallbackspinlock.hpp.

91  {
93 
94  if (m_OwnerThread == cur) {
96 
99 
100  //
101  // For now we have decided not to allow this.
102  //
103 
104 
105 
106 
107 
108  //
110  "Recursive acquire of callback lock! 0x%p", this);
111 
114  (ULONG_PTR) this);
115  return;
116  }
117  else {
118  if (m_Verifier != NULL) {
119  m_Verifier->Lock(PreviousIrql, FALSE);
120  }
121  else {
122  m_Lock.Acquire(PreviousIrql);
123  }
124 
125  m_OwnerThread = cur;
126  return;
127  }
128  }
MxThread m_OwnerThread
#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 FxCallbackSpinLock::Unlock ( __in KIRQL  PreviousIrql)
inlinevirtual

Implements FxCallbackLock.

Definition at line 132 of file fxcallbackspinlock.hpp.

135  {
136  CheckOwnership();
137 
138  if (m_RecursionCount > 0) {
140  }
141  else {
143  if (m_Verifier != NULL) {
144  m_Verifier->Unlock(PreviousIrql, FALSE);
145  }
146  else {
147  m_Lock.Release(PreviousIrql);
148  }
149  }
150  }
MxThread m_OwnerThread
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

MxLock FxCallbackSpinLock::m_Lock
private

Definition at line 40 of file fxcallbackspinlock.hpp.

Referenced by Lock(), and Unlock().


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