ReactOS 0.4.16-dev-297-gc569aee
mxlock.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxLock.h
8
9Abstract:
10
11 Mode agnostic definition of lock
12
13 See MxLockKm.h and MxLockUm.h for mode
14 specific implementations
15
16Author:
17
18
19
20Revision History:
21
22
23
24--*/
25
26#pragma once
27
28//
29// MxLockNoDynam has no c'tor/d'tor
30// so as to be usable in global structs in km
31//
32// MxLock dervies from it and adds c'tor/d'tor
33//
35{
36
38
39protected:
41public:
42 MdLock &
44 )
45 {
46 return m_Lock;
47 }
48
49 __inline
50 VOID
52 );
53
54 _Acquires_lock_(this->m_Lock)
57 __inline
58 VOID
59 Acquire(
61 );
62
63#if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
64
66 __inline
69 VOID
70 );
71#endif
72
73 _Acquires_lock_(this->m_Lock)
75 __inline
76 VOID
77 AcquireAtDpcLevel(
78 );
79
80 _Releases_lock_(this->m_Lock)
82 __inline
83 VOID
84 Release(
86 );
87
88 _Releases_lock_(this->m_Lock)
90 __inline
91 VOID
92 ReleaseFromDpcLevel(
93 );
94
95 __inline
96 VOID
98 );
99};
100
101class MxLock : public MxLockNoDynam
102{
103public:
104 __inline
105 MxLock();
106
107 __inline
108 ~MxLock();
109};
unsigned char BOOLEAN
_In_ BOOLEAN Release
Definition: cdrom.h:920
MdLock m_Lock
Definition: mxlock.h:40
_Acquires_lock_(this->m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID AcquireAtDpcLevel()
CHECK_RETURN_IF_USER_MODE __inline BOOLEAN TryToAcquire(VOID)
Definition: mxlockum.h:95
__inline VOID Uninitialize()
Definition: mxlockkm.h:104
_Releases_lock_(this->m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Release(__drv_restoresIRQL KIRQL NewIrql)
MdLock & Get()
Definition: mxlock.h:43
DECLARE_DBGFLAG_INITIALIZED
Definition: mxlock.h:37
_Releases_lock_(this->m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID ReleaseFromDpcLevel()
_Acquires_lock_(this->m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) __inline VOID Acquire(__out __drv_deref(__drv_savesIRQL) KIRQL *OldIrql)
__inline VOID Initialize()
Definition: mxlockkm.h:43
Definition: mxlock.h:102
__inline MxLock()
Definition: mxlockkm.h:33
__inline ~MxLock()
Definition: mxlockkm.h:111
#define __out
Definition: dbghelp.h:62
#define __drv_savesIRQL
Definition: driverspecs.h:326
#define __drv_deref(annotes)
Definition: driverspecs.h:265
#define __drv_setsIRQL(irql)
Definition: driverspecs.h:328
#define __drv_restoresIRQL
Definition: driverspecs.h:322
#define __drv_requiresIRQL(irql)
Definition: driverspecs.h:321
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define CHECK_RETURN_IF_USER_MODE
Definition: mxmacros.h:26
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778