ReactOS 0.4.15-dev-7961-gdcf9eb0
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
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}
BOOLEAN IsInterruptLock(VOID)
Definition: fxspinlock.hpp:81
#define TRACINGERROR
Definition: dbgtrace.h:63
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxSpinLock * pLock
@ FX_TYPE_SPIN_LOCK
Definition: fxtypes.h:77
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228

◆ _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
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 NULL
Definition: types.h:112
#define _ReturnAddress()
Definition: intrin_arm.h:35
BOOLEAN FxVerifierLock
Definition: fxglobals.h:451

◆ FxPointerNotNull()

FxPointerNotNull ( pFxDriverGlobals  ,
SpinLock   
)

◆ if() [1/5]

if ( NT_SUCCESSstatus)

Definition at line 77 of file fxspinlockapi.cpp.

77 {
78 return status;
79 }
NTSTATUS status

◆ if() [2/5]

Definition at line 63 of file fxspinlockapi.cpp.

64 {
66
68 SpinLockAttributes->ParentObject,
70 (PVOID*)&pParent,
72 }
FxObject * pParent
Definition: fxdpcapi.cpp:86
@ FX_TYPE_OBJECT
Definition: fxtypes.h:45
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES SpinLockAttributes
Definition: wdfsync.h:225

◆ if() [3/5]

if ( NT_SUCCESS(status )

Definition at line 99 of file fxspinlockapi.cpp.

99 {
100 *SpinLock = lock;
101 }
WDFSPINLOCK lock

◆ if() [4/5]

if ( pFxDriverGlobals->  FxVerifierLock)

Definition at line 81 of file fxspinlockapi.cpp.

81 {
83 }
USHORT extra

◆ if() [5/5]

if ( pLock  = NULL)

Definition at line 93 of file fxspinlockapi.cpp.

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

Variable Documentation

◆ else

else
Initial value:
{
extra = 0

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

◆ SpinLock

Initial value:

Definition at line 47 of file fxspinlockapi.cpp.

◆ SpinLockAttributes

◆ status