ReactOS 0.4.15-dev-8116-gf69e256
KeSpinLock.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Kernel-Mode Test Suite Spin lock test
5 * COPYRIGHT: Copyright 2011-2023 Thomas Faber (thomas.faber@reactos.org)
6 * COPYRIGHT: Copyright 2021 Jérôme Gardou (jerome.gardou@reactos.org)
7 */
8
9#ifndef _WIN64
10__declspec(dllimport) void __stdcall KeAcquireSpinLock(unsigned long *, unsigned char *);
11__declspec(dllimport) void __stdcall KeReleaseSpinLock(unsigned long *, unsigned char);
12__declspec(dllimport) void __stdcall KeAcquireSpinLockAtDpcLevel(unsigned long *);
13__declspec(dllimport) void __stdcall KeReleaseSpinLockFromDpcLevel(unsigned long *);
14#endif
15
16/* this define makes KeInitializeSpinLock not use the inlined version */
17#define WIN9X_COMPAT_SPINLOCK
18#include <kmt_test.h>
19#include <limits.h>
20
21//#define NDEBUG
22#include <debug.h>
23
24static
27_Post_satisfies_(return == 1 || return == 0)
30*pKeTryToAcquireSpinLockAtDpcLevel)(
32 _When_(return!=0, _Acquires_lock_(*_Curr_))
34
35static
36VOID
38*pKeAcquireInStackQueuedSpinLockForDpc)(
41
42static
43VOID
45*pKeReleaseInStackQueuedSpinLockForDpc)(
47
48static
52*pKeTestSpinLock)(
54
55/* TODO: multiprocessor testing */
56
57struct _CHECK_DATA;
58typedef struct _CHECK_DATA CHECK_DATA, *PCHECK_DATA;
59
60typedef VOID (*PACQUIRE_FUNCTION)(PKSPIN_LOCK, PCHECK_DATA);
61typedef VOID (*PRELEASE_FUNCTION)(PKSPIN_LOCK, PCHECK_DATA);
62typedef BOOLEAN (*PTRY_FUNCTION)(PKSPIN_LOCK, PCHECK_DATA);
63
64struct _CHECK_DATA
65{
66 enum
67 {
68 CheckQueueHandle,
69 CheckQueue,
70 CheckLock
71 } Check;
72 KIRQL IrqlWhenAcquired;
73 PACQUIRE_FUNCTION Acquire;
74 PRELEASE_FUNCTION Release;
75 PTRY_FUNCTION TryAcquire;
76 PACQUIRE_FUNCTION AcquireNoRaise;
77 PRELEASE_FUNCTION ReleaseNoLower;
78 PTRY_FUNCTION TryAcquireNoRaise;
79 KSPIN_LOCK_QUEUE_NUMBER QueueNumber;
80 BOOLEAN TryRetOnFailure;
81 KIRQL OriginalIrql;
82 BOOLEAN IsAcquired;
84 {
85 KLOCK_QUEUE_HANDLE QueueHandle;
87 KIRQL Irql;
89 PVOID UntouchedValue;
90};
91
92#define DEFINE_ACQUIRE(LocalName, SetIsAcquired, DoCall) \
93static VOID LocalName(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) \
94{ \
95 ASSERT(!CheckData->IsAcquired); \
96 DoCall; \
97 if (SetIsAcquired) CheckData->IsAcquired = TRUE; \
98}
99
100#define DEFINE_RELEASE(LocalName, SetIsAcquired, DoCall) \
101static VOID LocalName(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) \
102{ \
103 DoCall; \
104 if (SetIsAcquired) CheckData->IsAcquired = FALSE; \
105}
106
107DEFINE_ACQUIRE(AcquireNormal, TRUE, KeAcquireSpinLock(SpinLock, &CheckData->Irql))
108DEFINE_RELEASE(ReleaseNormal, TRUE, KeReleaseSpinLock(SpinLock, CheckData->Irql))
109#ifdef _X86_
110DEFINE_ACQUIRE(AcquireExp, TRUE, (KeAcquireSpinLock)(SpinLock, &CheckData->Irql))
111DEFINE_RELEASE(ReleaseExp, TRUE, (KeReleaseSpinLock)(SpinLock, CheckData->Irql))
112#else
113DEFINE_ACQUIRE(AcquireExp, TRUE, KeAcquireSpinLock(SpinLock, &CheckData->Irql))
114DEFINE_RELEASE(ReleaseExp, TRUE, KeReleaseSpinLock(SpinLock, CheckData->Irql))
115#endif
116DEFINE_ACQUIRE(AcquireSynch, TRUE, CheckData->Irql = KeAcquireSpinLockRaiseToSynch(SpinLock))
117
118DEFINE_ACQUIRE(AcquireInStackQueued, TRUE, KeAcquireInStackQueuedSpinLock(SpinLock, &CheckData->QueueHandle))
119DEFINE_ACQUIRE(AcquireInStackSynch, TRUE, KeAcquireInStackQueuedSpinLockRaiseToSynch(SpinLock, &CheckData->QueueHandle))
120DEFINE_RELEASE(ReleaseInStackQueued, TRUE, KeReleaseInStackQueuedSpinLock(&CheckData->QueueHandle))
121
122DEFINE_ACQUIRE(AcquireQueued, TRUE, CheckData->Irql = KeAcquireQueuedSpinLock(CheckData->QueueNumber))
123DEFINE_ACQUIRE(AcquireQueuedSynch, TRUE, CheckData->Irql = KeAcquireQueuedSpinLockRaiseToSynch(CheckData->QueueNumber))
124DEFINE_RELEASE(ReleaseQueued, TRUE, KeReleaseQueuedSpinLock(CheckData->QueueNumber, CheckData->Irql))
125
130
131DEFINE_ACQUIRE(AcquireInStackNoRaise, FALSE, KeAcquireInStackQueuedSpinLockAtDpcLevel(SpinLock, &CheckData->QueueHandle))
132DEFINE_RELEASE(ReleaseInStackNoRaise, FALSE, KeReleaseInStackQueuedSpinLockFromDpcLevel(&CheckData->QueueHandle))
133
134/* TODO: test these functions. They behave weirdly, though */
135#if 0
136DEFINE_ACQUIRE(AcquireForDpc, TRUE, CheckData->Irql = KeAcquireSpinLockForDpc(SpinLock))
137DEFINE_RELEASE(ReleaseForDpc, TRUE, KeReleaseSpinLockForDpc(SpinLock, CheckData->Irql))
138#endif
139
140DEFINE_ACQUIRE(AcquireInStackForDpc, FALSE, pKeAcquireInStackQueuedSpinLockForDpc(SpinLock, &CheckData->QueueHandle))
141DEFINE_RELEASE(ReleaseInStackForDpc, FALSE, pKeReleaseInStackQueuedSpinLockForDpc(&CheckData->QueueHandle))
142
143#ifdef _X86_
146#else
147DEFINE_ACQUIRE(AcquireInt, TRUE, KeAcquireSpinLock(SpinLock, &CheckData->Irql))
148DEFINE_RELEASE(ReleaseInt, TRUE, KeReleaseSpinLock(SpinLock, CheckData->Irql))
149#endif
150
151BOOLEAN TryQueued(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) {
152 LOGICAL Ret = KeTryToAcquireQueuedSpinLock(CheckData->QueueNumber, &CheckData->Irql);
153 CheckData->IsAcquired = TRUE;
154 ASSERT(Ret == FALSE || Ret == TRUE);
155 return (BOOLEAN)Ret;
156}
158 BOOLEAN Ret = KeTryToAcquireQueuedSpinLockRaiseToSynch(CheckData->QueueNumber, &CheckData->Irql);
159 CheckData->IsAcquired = TRUE;
160 return Ret;
161}
162BOOLEAN TryNoRaise(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) {
163 BOOLEAN Ret = pKeTryToAcquireSpinLockAtDpcLevel(SpinLock);
164 return Ret;
165}
166
167#define CheckSpinLockLock(SpinLock, CheckData, Value) do \
168{ \
169 PKTHREAD Thread = KeGetCurrentThread(); \
170 (VOID)Thread; \
171 if (KmtIsMultiProcessorBuild || KmtIsCheckedBuild) \
172 { \
173 ok_eq_bool(Ret, (Value) == 0); \
174 if (SpinLock) \
175 { \
176 if (KmtIsCheckedBuild) \
177 ok_eq_ulongptr(*(SpinLock), (Value) ? (ULONG_PTR)Thread | 1 : 0); \
178 else \
179 ok_eq_ulongptr(*(SpinLock), (Value) ? 1 : 0); \
180 } \
181 } \
182 else \
183 { \
184 ok_bool_true(Ret, "KeTestSpinLock returned"); \
185 if (SpinLock) \
186 ok_eq_ulongptr(*(SpinLock), 0); \
187 } \
188 ok_eq_uint((CheckData)->Irql, (CheckData)->OriginalIrql); \
189} while (0)
190
191#define CheckSpinLockQueue(SpinLock, CheckData, Value) do \
192{ \
193 ok_eq_pointer((CheckData)->Queue->Next, NULL); \
194 ok_eq_pointer((CheckData)->Queue->Lock, NULL); \
195 ok_eq_uint((CheckData)->Irql, (CheckData)->OriginalIrql); \
196} while (0)
197
198#define CheckSpinLockQueueHandle(SpinLock, CheckData, Value) do \
199{ \
200 if (KmtIsMultiProcessorBuild || KmtIsCheckedBuild) \
201 { \
202 ok_eq_bool(Ret, (Value) == 0); \
203 if (SpinLock) \
204 ok_eq_ulongptr(*(SpinLock), \
205 (Value) ? &(CheckData)->QueueHandle : 0); \
206 ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Next, NULL); \
207 ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Lock, \
208 (PVOID)((ULONG_PTR)SpinLock | ((Value) ? 2 : 0))); \
209 } \
210 else \
211 { \
212 ok_bool_true(Ret, "KeTestSpinLock returned"); \
213 if (SpinLock) \
214 ok_eq_ulongptr(*(SpinLock), 0); \
215 ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Next, (CheckData)->UntouchedValue); \
216 ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Lock, (CheckData)->UntouchedValue); \
217 } \
218 ok_eq_uint((CheckData)->QueueHandle.OldIrql, (CheckData)->OriginalIrql); \
219} while (0)
220
221#define CheckSpinLock(SpinLock, CheckData, Value) do \
222{ \
223 BOOLEAN Ret = SpinLock && pKeTestSpinLock ? pKeTestSpinLock(SpinLock) : TRUE; \
224 KIRQL ExpectedIrql = (CheckData)->OriginalIrql; \
225 \
226 switch ((CheckData)->Check) \
227 { \
228 case CheckLock: \
229 CheckSpinLockLock(SpinLock, CheckData, Value); \
230 break; \
231 case CheckQueue: \
232 CheckSpinLockQueue(SpinLock, CheckData, Value); \
233 break; \
234 case CheckQueueHandle: \
235 CheckSpinLockQueueHandle(SpinLock, CheckData, Value); \
236 break; \
237 } \
238 \
239 if ((CheckData)->IsAcquired) \
240 ExpectedIrql = (CheckData)->IrqlWhenAcquired; \
241 ok_irql(ExpectedIrql); \
242 ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); \
243 ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); \
244} while (0)
245
246static
247VOID
250 PCHECK_DATA CheckData)
251{
252 static INT Run = 0;
253 trace("Test SpinLock run %d\n", Run++);
254
255 ok_irql(CheckData->OriginalIrql);
256
257 if (SpinLock)
259 CheckData->Acquire(SpinLock, CheckData);
260 CheckSpinLock(SpinLock, CheckData, 1);
261 CheckData->Release(SpinLock, CheckData);
262 CheckSpinLock(SpinLock, CheckData, 0);
263
264 if (CheckData->TryAcquire)
265 {
266 CheckSpinLock(SpinLock, CheckData, 0);
267 ok_bool_true(CheckData->TryAcquire(SpinLock, CheckData), "TryAcquire returned");
268 CheckSpinLock(SpinLock, CheckData, 1);
269 /* A second TryToAcquire results in SPINLOCK_ALREADY_OWNED on checked builds */
271 {
273 {
274 /* In MP, this fails as you would expect */
275 ok_bool_false(CheckData->TryAcquire(SpinLock, CheckData), "TryAcquire returned");
276 }
277 else
278 {
279 /* In UP, this always succeeds: recursive acquires are illegal and parallel processors don't exist */
280 ok_bool_true(CheckData->TryAcquire(SpinLock, CheckData), "TryAcquire returned");
281 ok_eq_uint(CheckData->Irql, CheckData->IrqlWhenAcquired);
282 CheckData->Irql = CheckData->OriginalIrql;
283 }
284 CheckSpinLock(SpinLock, CheckData, 1);
285 }
286 CheckData->Release(SpinLock, CheckData);
287 CheckSpinLock(SpinLock, CheckData, 0);
288 }
289
290 if (CheckData->AcquireNoRaise &&
291 (CheckData->OriginalIrql >= DISPATCH_LEVEL || !KmtIsCheckedBuild) &&
292 (CheckData->AcquireNoRaise != AcquireInStackForDpc ||
293 !skip(pKeAcquireInStackQueuedSpinLockForDpc &&
294 pKeReleaseInStackQueuedSpinLockForDpc, "No DPC spinlock functions\n")))
295 {
296 /* acquire/release without irql change */
297 CheckData->AcquireNoRaise(SpinLock, CheckData);
298 CheckSpinLock(SpinLock, CheckData, 1);
299 CheckData->ReleaseNoLower(SpinLock, CheckData);
300 CheckSpinLock(SpinLock, CheckData, 0);
301
302 /* acquire without raise, but normal release */
303 CheckData->AcquireNoRaise(SpinLock, CheckData);
304 CheckSpinLock(SpinLock, CheckData, 1);
305 CheckData->Release(SpinLock, CheckData);
306 CheckSpinLock(SpinLock, CheckData, 0);
307
308 /* acquire normally but release without lower */
309 CheckData->Acquire(SpinLock, CheckData);
310 CheckSpinLock(SpinLock, CheckData, 1);
311 CheckData->ReleaseNoLower(SpinLock, CheckData);
312 CheckSpinLock(SpinLock, CheckData, 0);
313 CheckData->IsAcquired = FALSE;
314 KmtSetIrql(CheckData->OriginalIrql);
315
316 if (CheckData->TryAcquireNoRaise &&
317 !skip(pKeTryToAcquireSpinLockAtDpcLevel != NULL, "KeTryToAcquireSpinLockAtDpcLevel unavailable\n"))
318 {
319 CheckSpinLock(SpinLock, CheckData, 0);
320 ok_bool_true(CheckData->TryAcquireNoRaise(SpinLock, CheckData), "TryAcquireNoRaise returned");
321 CheckSpinLock(SpinLock, CheckData, 1);
323 {
325 {
326 /* In MP, this fails as you would expect */
327 ok_bool_false(CheckData->TryAcquireNoRaise(SpinLock, CheckData), "TryAcquireNoRaise returned");
328 }
329 else
330 {
331 /* In UP, this always succeeds: recursive acquires are illegal and parallel processors don't exist */
332 ok_bool_true(CheckData->TryAcquireNoRaise(SpinLock, CheckData), "TryAcquireNoRaise returned");
333 }
334 CheckSpinLock(SpinLock, CheckData, 1);
335 }
336 CheckData->ReleaseNoLower(SpinLock, CheckData);
337 CheckSpinLock(SpinLock, CheckData, 0);
338 }
339 }
340
341 ok_irql(CheckData->OriginalIrql);
342 /* make sure we survive this in case of error */
343 KmtSetIrql(CheckData->OriginalIrql);
344}
345
346START_TEST(KeSpinLock)
347{
348 KSPIN_LOCK SpinLock = (KSPIN_LOCK)0x5555555555555555LL;
349 PKSPIN_LOCK pSpinLock = &SpinLock;
351 KIRQL OriginalIrqls[] = { PASSIVE_LEVEL, APC_LEVEL, DISPATCH_LEVEL, HIGH_LEVEL };
352 CHECK_DATA TestData[] =
353 {
354 { CheckLock, DISPATCH_LEVEL, AcquireNormal, ReleaseNormal, NULL, AcquireNoRaise, ReleaseNoLower, TryNoRaise },
355 { CheckLock, DISPATCH_LEVEL, AcquireExp, ReleaseExp, NULL, AcquireExpNoRaise, ReleaseExpNoLower, NULL },
356 /* TODO: this one is just weird!
357 { CheckLock, DISPATCH_LEVEL, AcquireNormal, ReleaseNormal, NULL, AcquireForDpc, ReleaseForDpc, NULL },*/
358 { CheckLock, DISPATCH_LEVEL, AcquireNormal, ReleaseNormal, NULL, AcquireInt, ReleaseInt, NULL },
359 { CheckLock, SynchIrql, AcquireSynch, ReleaseNormal, NULL, NULL, NULL, NULL },
360 { CheckQueueHandle, DISPATCH_LEVEL, AcquireInStackQueued, ReleaseInStackQueued, NULL, AcquireInStackNoRaise, ReleaseInStackNoRaise, NULL },
361 { CheckQueueHandle, SynchIrql, AcquireInStackSynch, ReleaseInStackQueued, NULL, NULL, NULL, NULL },
362 { CheckQueueHandle, DISPATCH_LEVEL, AcquireInStackQueued, ReleaseInStackQueued, NULL, AcquireInStackForDpc, ReleaseInStackForDpc, NULL },
363 { CheckQueue, DISPATCH_LEVEL, AcquireQueued, ReleaseQueued, TryQueued, NULL, NULL, NULL, LockQueuePfnLock },
364 { CheckQueue, SynchIrql, AcquireQueuedSynch, ReleaseQueued, TryQueuedSynch, NULL, NULL, NULL, LockQueuePfnLock },
365 };
366 int i, iIrql;
367 PKPRCB Prcb;
368
369 pKeTryToAcquireSpinLockAtDpcLevel = KmtGetSystemRoutineAddress(L"KeTryToAcquireSpinLockAtDpcLevel");
370 pKeAcquireInStackQueuedSpinLockForDpc = KmtGetSystemRoutineAddress(L"KeAcquireInStackQueuedSpinLockForDpc");
371 pKeReleaseInStackQueuedSpinLockForDpc = KmtGetSystemRoutineAddress(L"KeReleaseInStackQueuedSpinLockForDpc");
372 pKeTestSpinLock = KmtGetSystemRoutineAddress(L"KeTestSpinLock");
373
374 Prcb = KeGetCurrentPrcb();
375
376 /* KeInitializeSpinLock */
377 memset(&SpinLock, 0x55, sizeof SpinLock);
380
381 /* KeTestSpinLock */
382 if (!skip(pKeTestSpinLock != NULL, "KeTestSpinLock unavailable\n"))
383 {
384 ok_bool_true(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
385 SpinLock = 1;
386 ok_bool_false(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
387 SpinLock = 2;
388 ok_bool_false(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
389 SpinLock = (ULONG_PTR)-1;
390 ok_bool_false(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
391 SpinLock = (ULONG_PTR)1 << (sizeof(ULONG_PTR) * CHAR_BIT - 1);
392 ok_bool_false(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
393 SpinLock = 0;
394 ok_bool_true(pKeTestSpinLock(&SpinLock), "KeTestSpinLock returned");
395 }
396
397 /* on UP none of the following functions actually looks at the spinlock! */
399 pSpinLock = NULL;
400
401 for (i = 0; i < sizeof TestData / sizeof TestData[0]; ++i)
402 {
403 memset(&SpinLock, 0x55, sizeof SpinLock);
405 if (TestData[i].Check == CheckQueueHandle)
406 memset(&TestData[i].QueueHandle, 0x55, sizeof TestData[i].QueueHandle);
407 if (TestData[i].Check == CheckQueue)
408 {
409 TestData[i].Queue = &Prcb->LockQueue[TestData[i].QueueNumber];
410 TestData[i].UntouchedValue = NULL;
411 }
412 else
413 TestData[i].UntouchedValue = (PVOID)0x5555555555555555LL;
414
415 for (iIrql = 0; iIrql < sizeof OriginalIrqls / sizeof OriginalIrqls[0]; ++iIrql)
416 {
417 if (KmtIsCheckedBuild && OriginalIrqls[iIrql] > DISPATCH_LEVEL)
418 continue;
419 KeRaiseIrql(OriginalIrqls[iIrql], &Irql);
420 TestData[i].OriginalIrql = OriginalIrqls[iIrql];
421 TestData[i].IsAcquired = FALSE;
422 TestSpinLock(pSpinLock, &TestData[i]);
424 }
425 }
426
428}
BOOLEAN(NTAPI * PACQUIRE_FUNCTION)(PERESOURCE, BOOLEAN)
Definition: ExResource.c:263
__declspec(dllimport)
Definition: KeSpinLock.c:10
static VOID TestSpinLock(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
Definition: KeSpinLock.c:248
BOOLEAN TryNoRaise(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
Definition: KeSpinLock.c:162
#define DEFINE_RELEASE(LocalName, SetIsAcquired, DoCall)
Definition: KeSpinLock.c:100
#define DEFINE_ACQUIRE(LocalName, SetIsAcquired, DoCall)
Definition: KeSpinLock.c:92
#define CheckSpinLock(SpinLock, CheckData, Value)
Definition: KeSpinLock.c:221
BOOLEAN TryQueuedSynch(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
Definition: KeSpinLock.c:157
unsigned char BOOLEAN
#define ok_bool_false(value, desc)
Definition: apitest.h:79
#define ok_eq_uint(value, expected)
Definition: apitest.h:61
#define ok_bool_true(value, desc)
Definition: apitest.h:78
#define ok_eq_ulongptr(value, expected)
Definition: apitest.h:71
#define trace
Definition: atltest.h:70
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
return
Definition: dirsup.c:529
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define _Acquires_lock_(lock)
#define _Requires_lock_not_held_(lock)
_Out_ PKIRQL Irql
Definition: csq.h:179
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CHAR_BIT
Definition: urlcache.c:62
#define ULONG_PTR
Definition: config.h:101
#define _IRQL_requires_min_(irql)
Definition: driverspecs.h:231
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define IPI_LEVEL
Definition: env_spec_w32.h:701
UCHAR KIRQL
Definition: env_spec_w32.h:591
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID FASTCALL KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:130
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
KIRQL FASTCALL KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:119
VOID FASTCALL KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:142
VOID FASTCALL KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:166
BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN PKIRQL OldIrql)
Definition: spinlock.c:177
KIRQL FASTCALL KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock)
Definition: spinlock.c:62
LOGICAL FASTCALL KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, OUT PKIRQL OldIrql)
Definition: spinlock.c:192
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
PVOID KmtGetSystemRoutineAddress(IN PCWSTR RoutineName)
VOID KmtSetIrql(IN KIRQL NewIrql)
BOOLEAN KmtIsCheckedBuild
BOOLEAN KmtIsMultiProcessorBuild
#define ASSERT(a)
Definition: mode.c:44
int Check()
Definition: movefile.cpp:196
#define _Inout_
Definition: ms_sal.h:378
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _When_(expr, annos)
Definition: ms_sal.h:254
#define _In_
Definition: ms_sal.h:308
#define _Post_satisfies_(cond)
Definition: ms_sal.h:588
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1161
#define FASTCALL
Definition: nt_native.h:50
#define DUMMYUNIONNAME
Definition: ntbasedef.h:32
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
VOID FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:363
VOID FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel(IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:395
VOID FASTCALL KeReleaseSpinLockForDpc(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: spinlock.c:435
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:287
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:298
KIRQL FASTCALL KeAcquireSpinLockForDpc(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:424
#define L(x)
Definition: ntvdm.h:50
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
Definition: ke.h:125
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
Definition: ke.h:135
#define memset(x, y, z)
Definition: compat.h:39
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]
Definition: ketypes.h:707
Definition: bidi.c:434
void * PVOID
Definition: typedefs.h:50
int32_t INT
Definition: typedefs.h:58
#define __stdcall
Definition: typedefs.h:25
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:717
enum _KSPIN_LOCK_QUEUE_NUMBER KSPIN_LOCK_QUEUE_NUMBER
@ LockQueuePfnLock
Definition: ketypes.h:660