ReactOS  0.4.15-dev-2534-geba00d1
mxlock.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxLock.h
8 
9 Abstract:
10 
11  Mode agnostic definition of lock
12 
13  See MxLockKm.h and MxLockUm.h for mode
14  specific implementations
15 
16 Author:
17 
18 
19 
20 Revision 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 
39 protected:
41 public:
42  MdLock &
43  Get(
44  )
45  {
46  return m_Lock;
47  }
48 
49  __inline
50  VOID
51  Initialize(
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
67  BOOLEAN
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 
101 class MxLock : public MxLockNoDynam
102 {
103 public:
104  __inline
105  MxLock();
106 
107  __inline
108  ~MxLock();
109 };
__inline ~MxLock()
Definition: mxlockkm.h:111
#define CHECK_RETURN_IF_USER_MODE
Definition: mxmacros.h:26
#define __drv_restoresIRQL
Definition: driverspecs.h:304
MdLock m_Lock
Definition: mxlock.h:40
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:273
UCHAR KIRQL
Definition: env_spec_w32.h:591
MdLock & Get()
Definition: mxlock.h:43
_Releases_lock_(this->m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Release(__drv_restoresIRQL KIRQL NewIrql)
#define __out
Definition: dbghelp.h:62
unsigned char BOOLEAN
#define __drv_requiresIRQL(irql)
Definition: driverspecs.h:303
__inline MxLock()
Definition: mxlockkm.h:33
__inline VOID Uninitialize()
Definition: mxlockkm.h:104
_Must_inspect_result_ this m_Lock __drv_setsIRQL(APC_LEVEL)) _When_(return
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define __drv_deref(annotes)
Definition: driverspecs.h:247
Definition: mxlock.h:101
DECLARE_DBGFLAG_INITIALIZED
Definition: mxlock.h:37
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define __drv_savesIRQL
Definition: driverspecs.h:308
_Acquires_lock_(this->m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) __inline VOID Acquire(__out __drv_deref(__drv_savesIRQL) KIRQL *OldIrql)
CHECK_RETURN_IF_USER_MODE __inline BOOLEAN TryToAcquire(VOID)
Definition: mxlockum.h:95
__inline VOID Initialize()
Definition: mxlockkm.h:43
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114