ReactOS
0.4.16-dev-433-g6363f78
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
mxpagedlockum.h
Go to the documentation of this file.
1
/*++
2
3
Copyright (c) Microsoft Corporation
4
5
ModuleName:
6
7
MxPagedLockUm.h
8
9
Abstract:
10
11
User 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
typedef
struct
{
27
CRITICAL_SECTION
Lock
;
28
bool
Initialized
;
29
DWORD
OwnerThreadId
;
30
}
MdPagedLock
;
31
32
#include "MxPagedLock.h"
33
34
__inline
35
MxPagedLock::MxPagedLock
(
36
)
37
{
38
m_Lock
.
Initialized
=
false
;
39
m_Lock
.
OwnerThreadId
= 0;
40
}
41
42
_Must_inspect_result_
43
__inline
44
NTSTATUS
45
MxPagedLockNoDynam::Initialize
(
46
)
47
{
48
if
(
InitializeCriticalSectionAndSpinCount
(&
m_Lock
.
Lock
, 0)) {
49
m_Lock
.
Initialized
=
true
;
50
51
return
S_OK
;
52
}
53
else
{
54
DWORD
err
=
GetLastError
();
55
return
WinErrorToNtStatus
(
err
);
56
}
57
}
58
59
__inline
60
VOID
61
#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "Can't apply kernel mode annotations."
);
62
MxPagedLockNoDynam::Acquire(
63
)
64
{
65
EnterCriticalSection
(&
m_Lock
.
Lock
);
66
67
DWORD
threadId =
GetCurrentThreadId
();
68
69
if
(threadId ==
m_Lock
.
OwnerThreadId
) {
70
Mx::MxAssertMsg
(
"Recursive acquision of the lock is not allowed"
,
FALSE
);
71
}
72
73
m_Lock
.
OwnerThreadId
=
GetCurrentThreadId
();
74
}
75
76
__inline
77
VOID
78
MxPagedLockNoDynam::AcquireUnsafe
(
79
)
80
{
81
MxPagedLockNoDynam::Acquire();
82
}
83
84
__inline
85
BOOLEAN
86
#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "Can't apply kernel mode annotations."
);
87
MxPagedLockNoDynam::TryToAcquire(
88
)
89
{
90
return
TryEnterCriticalSection
(&
m_Lock
.
Lock
) ==
TRUE
?
TRUE
:
FALSE
;
91
}
92
93
94
__inline
95
VOID
96
#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "Can't apply kernel mode annotations."
);
97
MxPagedLockNoDynam::Release(
98
)
99
{
100
m_Lock
.
OwnerThreadId
= 0;
101
102
LeaveCriticalSection
(&
m_Lock
.
Lock
);
103
}
104
105
__inline
106
VOID
107
MxPagedLockNoDynam::ReleaseUnsafe
(
108
)
109
{
110
MxPagedLockNoDynam::Release();
111
}
112
113
__inline
114
VOID
115
MxPagedLockNoDynam::Uninitialize
(
116
)
117
{
118
DeleteCriticalSection
(&
m_Lock
.
Lock
);
119
m_Lock
.
Initialized
=
false
;
120
}
121
122
__inline
123
MxPagedLock::~MxPagedLock
(
124
)
125
{
126
if
(
m_Lock
.
Initialized
) {
127
this->
Uninitialize
();
128
}
129
}
BOOLEAN
unsigned char BOOLEAN
Definition:
ProcessorBind.h:185
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
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
Mx::MxAssertMsg
static __inline VOID MxAssertMsg(__in LPSTR Message, __in BOOLEAN Condition)
Definition:
mxgeneralkm.h:176
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
WinErrorToNtStatus
NTSTATUS WinErrorToNtStatus(__in ULONG WinError)
Definition:
errtostatus.cpp:60
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
S_OK
#define S_OK
Definition:
intsafe.h:52
_Must_inspect_result_
#define _Must_inspect_result_
Definition:
no_sal2.h:62
err
#define err(...)
Definition:
reactos_support_code.h:30
MdPagedLock
Definition:
mxpagedlockum.h:26
MdPagedLock::Lock
CRITICAL_SECTION Lock
Definition:
mxpagedlockum.h:27
MdPagedLock::OwnerThreadId
DWORD OwnerThreadId
Definition:
mxpagedlockum.h:29
MdPagedLock::Initialized
bool Initialized
Definition:
mxpagedlockum.h:28
_CRITICAL_SECTION
Definition:
winbase.h:918
InitializeCriticalSectionAndSpinCount
BOOL WINAPI InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount)
Definition:
synch.c:765
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
TryEnterCriticalSection
BOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION)
GetCurrentThreadId
DWORD WINAPI GetCurrentThreadId(void)
Definition:
thread.c:459
LeaveCriticalSection
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
EnterCriticalSection
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DeleteCriticalSection
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
sdk
lib
drivers
wdf
shared
inc
primitives
um
mxpagedlockum.h
Generated on Tue Jan 7 2025 06:18:42 for ReactOS by
1.9.6