ReactOS  0.4.15-dev-3182-g7b62228
fxspinlockapi.cpp File Reference
#include "fxsupportpch.hpp"
#include "fxspinlock.hpp"
Include dependency graph for fxspinlockapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfSpinLockCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (NT_SUCCESS(FxValidateObjectAttributesForParentHandle(pFxDriverGlobals, SpinLockAttributes)))
 
 FxPointerNotNull (pFxDriverGlobals, SpinLock)
 
 if (!NT_SUCCESS(status))
 
 if (pFxDriverGlobals->FxVerifierLock)
 
 if (pLock==NULL)
 
 if (NT_SUCCESS(status))
 
 __drv_raisesIRQL (DISPATCH_LEVEL) __drv_maxIRQL(DISPATCH_LEVEL) VOID STDCALL WDFEXPORT(WdfSpinLockAcquire)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
__in __drv_savesIRQL _Requires_lock_not_held_ (_Curr_) _Acquires_lock_(_Curr_) WDFSPINLOCK SpinLock)
 
__in __drv_restoresIRQL _Requires_lock_held_ (_Curr_) _Releases_lock_(_Curr_) WDFSPINLOCK SpinLock)
 

Variables

_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES SpinLockAttributes
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFSPINLOCK * SpinLock
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
NTSTATUS status = FxValidateObjectAttributes(pFxDriverGlobals, SpinLockAttributes)
 
FxSpinLockpLock
 
WDFSPINLOCK lock
 
USHORT extra
 
 else
 

Function Documentation

◆ __drv_maxIRQL()

◆ __drv_raisesIRQL()

__drv_raisesIRQL ( DISPATCH_LEVEL  )

◆ _Requires_lock_held_()

__in __drv_restoresIRQL _Requires_lock_held_ ( _Curr_  )

Definition at line 156 of file fxspinlockapi.cpp.

160 {
161  DDI_ENTRY();
162 
164  FxSpinLock* pLock;
165 
167  SpinLock,
169  (PVOID*) &pLock,
171 
172  if (pLock->IsInterruptLock()) {
174  "WDFSPINLOCK %p is associated with an interrupt, "
175  "cannot be used for normal sync operations",
176  SpinLock);
178  return;
179  }
180 
181  pLock->ReleaseLock();
182 }
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
PFX_DRIVER_GLOBALS pFxDriverGlobals
DriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:225
FxSpinLock * pLock
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
BOOLEAN IsInterruptLock(VOID)
Definition: fxspinlock.hpp:81
#define TRACINGERROR
Definition: dbgtrace.h:63
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ _Requires_lock_not_held_()

__in __drv_savesIRQL _Requires_lock_not_held_ ( _Curr_  )

Definition at line 118 of file fxspinlockapi.cpp.

122 {
123  DDI_ENTRY();
124 
126  FxSpinLock* pLock;
127 
129  SpinLock,
131  (PVOID*) &pLock,
133 
134  if (pLock->IsInterruptLock()) {
136  "WDFSPINLOCK %p is associated with an interrupt, "
137  "cannot be used for normal sync operations",
138  SpinLock);
140  return;
141  }
142 
143  pLock->AcquireLock(
145 }
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
PFX_DRIVER_GLOBALS pFxDriverGlobals
DriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:225
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451
FxSpinLock * pLock
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
void * _ReturnAddress(void)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
BOOLEAN IsInterruptLock(VOID)
Definition: fxspinlock.hpp:81
#define TRACINGERROR
Definition: dbgtrace.h:63
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ FxPointerNotNull()

FxPointerNotNull ( pFxDriverGlobals  ,
SpinLock   
)

◆ if() [1/5]

Definition at line 63 of file fxspinlockapi.cpp.

64  {
66 
68  SpinLockAttributes->ParentObject,
70  (PVOID*)&pParent,
72  }
PFX_DRIVER_GLOBALS pFxDriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES SpinLockAttributes
Definition: wdfsync.h:225
FxObject * pParent
Definition: fxdpcapi.cpp:86
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)

◆ if() [2/5]

if ( NT_SUCCESSstatus)

Definition at line 77 of file fxspinlockapi.cpp.

77  {
78  return status;
79  }
NTSTATUS status

◆ if() [3/5]

if ( pFxDriverGlobals->  FxVerifierLock)

Definition at line 81 of file fxspinlockapi.cpp.

81  {
82  extra = sizeof(FX_SPIN_LOCK_HISTORY);
83  }
USHORT extra

◆ if() [4/5]

if ( pLock  = NULL)

Definition at line 93 of file fxspinlockapi.cpp.

93  {
95  }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ if() [5/5]

if ( NT_SUCCESS(status )

Definition at line 99 of file fxspinlockapi.cpp.

99  {
100  *SpinLock = lock;
101  }
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:225
WDFSPINLOCK lock

Variable Documentation

◆ else

else
Initial value:
{
extra = 0
USHORT extra

Definition at line 84 of file fxspinlockapi.cpp.

◆ extra

USHORT extra

Definition at line 56 of file fxspinlockapi.cpp.

Referenced by if().

◆ lock

WDFSPINLOCK lock

Definition at line 55 of file fxspinlockapi.cpp.

Referenced by if().

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 52 of file fxspinlockapi.cpp.

Referenced by _Requires_lock_held_(), _Requires_lock_not_held_(), and if().

◆ pLock

FxWaitLock * pLock
Initial value:
PFX_DRIVER_GLOBALS pFxDriverGlobals
USHORT extra
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES SpinLockAttributes

Definition at line 54 of file fxspinlockapi.cpp.

Referenced by _Requires_lock_held_(), _Requires_lock_not_held_(), FreeDescriptorsFromList(), FxVerifierLock::GetThreadTableEntry(), and FxVerifierLock::ReleaseOrReplaceThreadTableEntry().

◆ SpinLock

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 49 of file fxspinlockapi.cpp.

◆ SpinLockAttributes

◆ status