ReactOS
0.4.15-dev-8621-g4b051b9
mxpagedlockkm.h
Go to the documentation of this file.
1
/*++
2
3
Copyright (c) Microsoft Corporation
4
5
ModuleName:
6
7
MxPagedLockKm.h
8
9
Abstract:
10
11
Kernel mode implementation of paged lock defined in
12
MxPagedLock.h
13
14
Author:
15
16
17
18
Revision History:
19
20
21
22
--*/
23
24
#pragma once
25
26
#include "
dbgmacros.h
"
27
28
typedef
FAST_MUTEX
MdPagedLock
;
29
30
#include "
mxpagedlock.h
"
31
32
__inline
33
MxPagedLock::MxPagedLock
(
34
)
35
{
36
CLEAR_DBGFLAG_INITIALIZED
;
37
38
//
39
// Temporarily call initialize from c'tor
40
// so that we don't have to churn all of the KMDF code
41
//
42
#ifndef MERGE_COMPLETE
43
(
VOID
)
MxPagedLock::Initialize
();
44
#endif
45
}
46
47
__inline
48
NTSTATUS
49
#ifdef _MSC_VER
50
#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "_Must_inspect_result_ not needed in kernel mode as the function always succeeds"
);
51
#endif
52
MxPagedLockNoDynam::Initialize
(
53
)
54
{
55
ExInitializeFastMutex
(&
m_Lock
);
56
57
SET_DBGFLAG_INITIALIZED
;
58
59
return
STATUS_SUCCESS
;
60
}
61
62
__drv_maxIRQL
(
APC_LEVEL
)
63
__drv_setsIRQL
(
APC_LEVEL
)
64
__drv_savesIRQLGlobal
(FastMutexObject, this->m_Lock)
65
_Acquires_lock_
(this->m_Lock)
66
__inline
67
VOID
68
MxPagedLockNoDynam
::Acquire(
69
)
70
{
71
ASSERT_DBGFLAG_INITIALIZED
;
72
73
ExAcquireFastMutex
(&m_Lock);
74
}
75
76
__inline
77
VOID
78
MxPagedLockNoDynam::AcquireUnsafe
(
79
)
80
{
81
ASSERT_DBGFLAG_INITIALIZED
;
82
83
ExAcquireFastMutexUnsafe
(&
m_Lock
);
84
}
85
86
_Must_inspect_result_
87
__drv_maxIRQL
(
APC_LEVEL
)
88
__drv_savesIRQLGlobal
(FastMutexObject, this->m_Lock)
89
__drv_valueIs
(==1;==0)
90
__drv_when
(
return
==1,
__drv_setsIRQL
(
APC_LEVEL
))
91
_When_
(
return
==1,
_Acquires_lock_
(this->m_Lock))
92
__inline
93
BOOLEAN
94
MxPagedLockNoDynam
::TryToAcquire(
95
)
96
{
97
ASSERT_DBGFLAG_INITIALIZED
;
98
99
return
ExTryToAcquireFastMutex
(&m_Lock);
100
}
101
102
__drv_requiresIRQL
(
APC_LEVEL
)
103
__drv_restoresIRQLGlobal
(FastMutexObject, this->m_Lock)
104
_Releases_lock_
(this->m_Lock)
105
__inline
106
VOID
107
MxPagedLockNoDynam
::
Release
(
108
)
109
{
110
ASSERT_DBGFLAG_INITIALIZED
;
111
112
ExReleaseFastMutex
(&m_Lock);
113
}
114
115
__inline
116
VOID
117
MxPagedLockNoDynam::ReleaseUnsafe
(
118
)
119
{
120
ASSERT_DBGFLAG_INITIALIZED
;
121
122
ExReleaseFastMutexUnsafe
(&
m_Lock
);
123
}
124
125
126
__inline
127
VOID
128
MxPagedLockNoDynam::Uninitialize
(
129
)
130
{
131
CLEAR_DBGFLAG_INITIALIZED
;
132
}
133
134
__inline
135
MxPagedLock::~MxPagedLock
(
136
)
137
{
138
CLEAR_DBGFLAG_INITIALIZED
;
139
}
BOOLEAN
unsigned char BOOLEAN
Definition:
ProcessorBind.h:185
VOID
#define VOID
Definition:
acefi.h:82
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
return
return
Definition:
dirsup.c:529
Release
_In_ BOOLEAN Release
Definition:
cdrom.h:920
MxPagedLockNoDynam
Definition:
mxpagedlock.h:35
MxPagedLockNoDynam::m_Lock
MdPagedLock m_Lock
Definition:
mxpagedlock.h:40
MxPagedLockNoDynam::Uninitialize
__inline VOID Uninitialize()
Definition:
mxpagedlockkm.h:128
MxPagedLockNoDynam::AcquireUnsafe
__inline VOID AcquireUnsafe()
Definition:
mxpagedlockkm.h:78
MxPagedLockNoDynam::Initialize
_Must_inspect_result_ __inline NTSTATUS Initialize()
Definition:
mxpagedlockkm.h:52
MxPagedLockNoDynam::ReleaseUnsafe
__inline VOID ReleaseUnsafe()
Definition:
mxpagedlockkm.h:117
MxPagedLock::~MxPagedLock
__inline ~MxPagedLock()
Definition:
mxpagedlockkm.h:135
MxPagedLock::MxPagedLock
__inline MxPagedLock()
Definition:
mxpagedlockkm.h:33
_Acquires_lock_
#define _Acquires_lock_(lock)
Definition:
concurrencysal.h:78
_Releases_lock_
#define _Releases_lock_(lock)
Definition:
concurrencysal.h:100
dbgmacros.h
ASSERT_DBGFLAG_INITIALIZED
#define ASSERT_DBGFLAG_INITIALIZED
Definition:
dbgmacros.h:58
SET_DBGFLAG_INITIALIZED
#define SET_DBGFLAG_INITIALIZED
Definition:
dbgmacros.h:59
CLEAR_DBGFLAG_INITIALIZED
#define CLEAR_DBGFLAG_INITIALIZED
Definition:
dbgmacros.h:60
__drv_when
#define __drv_when(cond, annotes)
Definition:
driverspecs.h:335
__drv_restoresIRQLGlobal
#define __drv_restoresIRQLGlobal(kind, param)
Definition:
driverspecs.h:323
__drv_setsIRQL
#define __drv_setsIRQL(irql)
Definition:
driverspecs.h:328
__drv_requiresIRQL
#define __drv_requiresIRQL(irql)
Definition:
driverspecs.h:321
__drv_savesIRQLGlobal
#define __drv_savesIRQLGlobal(kind, param)
Definition:
driverspecs.h:327
__drv_maxIRQL
#define __drv_maxIRQL(irql)
Definition:
driverspecs.h:291
APC_LEVEL
#define APC_LEVEL
Definition:
env_spec_w32.h:695
ExAcquireFastMutex
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition:
fmutex.c:23
ExReleaseFastMutex
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition:
fmutex.c:31
ExTryToAcquireFastMutex
BOOLEAN FASTCALL ExTryToAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition:
fmutex.c:39
void
Definition:
nsiface.idl:2307
_Must_inspect_result_
#define _Must_inspect_result_
Definition:
ms_sal.h:558
_When_
#define _When_(expr, annos)
Definition:
ms_sal.h:254
mxpagedlock.h
MdPagedLock
FAST_MUTEX MdPagedLock
Definition:
mxpagedlockkm.h:28
__drv_valueIs
_Must_inspect_result_ this m_Lock __drv_valueIs(==1;==0) __drv_when(return
ExReleaseFastMutexUnsafe
VOID FASTCALL ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
Definition:
fmutex.c:86
ExAcquireFastMutexUnsafe
VOID FASTCALL ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
Definition:
fmutex.c:75
STATUS_SUCCESS
#define STATUS_SUCCESS
Definition:
shellext.h:65
ExInitializeFastMutex
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition:
exfuncs.h:274
FAST_MUTEX
FAST_MUTEX
Definition:
extypes.h:17
sdk
lib
drivers
wdf
shared
inc
primitives
km
mxpagedlockkm.h
Generated on Sun Sep 8 2024 06:13:28 for ReactOS by
1.9.6