ReactOS 0.4.15-dev-5664-g3bf4ef6
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 ()
 
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

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 }

◆ ~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
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 }
_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 FALSE
Definition: types.h:117
PFX_DRIVER_GLOBALS fxDriverGlobals
PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxstump.hpp:98
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451

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

◆ 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
126 return;
127 }
128 }
VOID Lock(__out PKIRQL PreviousIrql, __in BOOLEAN AtDpc)
#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 FxCallbackSpinLock::Unlock ( __in KIRQL  PreviousIrql)
inlinevirtual

Implements FxCallbackLock.

Definition at line 132 of file fxcallbackspinlock.hpp.

135 {
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 }
VOID CheckOwnership(VOID)
VOID Unlock(__in KIRQL PreviousIrql, __in BOOLEAN AtDpc)

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: