ReactOS  0.4.15-dev-1197-g8081ba9
KeGuardedMutex.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Kernel-Mode Test Suite Guarded Mutex test
5  * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6  */
7 
8 #include <kmt_test.h>
9 
10 #define NDEBUG
11 #include <debug.h>
12 
13 static
16 BOOLEAN
17 (NTAPI
18 *pKeAreAllApcsDisabled)(VOID);
19 
20 static
21 _Acquires_lock_(_Global_critical_region_)
26 VOID
27 (FASTCALL
28 *pKeAcquireGuardedMutex)(
29  _Inout_ PKGUARDED_MUTEX GuardedMutex);
30 
31 static
32 _Requires_lock_not_held_(*FastMutex)
33 _Acquires_lock_(*FastMutex)
36 VOID
37 (FASTCALL
38 *pKeAcquireGuardedMutexUnsafe)(
39  _Inout_ PKGUARDED_MUTEX GuardedMutex);
40 
41 static
42 _Acquires_lock_(_Global_critical_region_)
44 VOID
45 (NTAPI
46 *pKeEnterGuardedRegion)(VOID);
47 
48 static
49 _Releases_lock_(_Global_critical_region_)
51 VOID
52 (NTAPI
53 *pKeLeaveGuardedRegion)(VOID);
54 
55 static
58 VOID
59 (FASTCALL
60 *pKeInitializeGuardedMutex)(
61  _Out_ PKGUARDED_MUTEX GuardedMutex);
62 
63 static
64 _Requires_lock_held_(*FastMutex)
65 _Releases_lock_(*FastMutex)
67 VOID
68 (FASTCALL
69 *pKeReleaseGuardedMutexUnsafe)(
70  _Inout_ PKGUARDED_MUTEX GuardedMutex);
71 
72 static
73 _Releases_lock_(_Global_critical_region_)
77 VOID
78 (FASTCALL
79 *pKeReleaseGuardedMutex)(
80  _Inout_ PKGUARDED_MUTEX GuardedMutex);
81 
82 static
84 _Success_(return != FALSE)
86 _Post_satisfies_(return == 1 || return == 0)
87 BOOLEAN
88 (FASTCALL
89 *pKeTryToAcquireGuardedMutex)(
90  _When_ (return, _Requires_lock_not_held_(*_Curr_) _Acquires_exclusive_lock_(*_Curr_)) _Acquires_lock_(_Global_critical_region_)
91  _Inout_ PKGUARDED_MUTEX GuardedMutex);
92 
93 #define CheckMutex(Mutex, ExpectedCount, ExpectedOwner, ExpectedContention, \
94  ExpectedKernelApcDisable, ExpectedSpecialApcDisable, \
95  KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, \
96  ExpectedIrql) do \
97 { \
98  ok_eq_long((Mutex)->Count, ExpectedCount); \
99  ok_eq_pointer((Mutex)->Owner, ExpectedOwner); \
100  ok_eq_ulong((Mutex)->Contention, ExpectedContention); \
101  ok_eq_int((Mutex)->KernelApcDisable, ExpectedKernelApcDisable); \
102  if (KmtIsCheckedBuild) \
103  ok_eq_int((Mutex)->SpecialApcDisable, ExpectedSpecialApcDisable); \
104  else \
105  ok_eq_int((Mutex)->SpecialApcDisable, 0x5555); \
106  ok_eq_bool(KeAreApcsDisabled(), KernelApcsDisabled || SpecialApcsDisabled); \
107  ok_eq_int(Thread->KernelApcDisable, KernelApcsDisabled); \
108  ok_eq_bool(pKeAreAllApcsDisabled(), AllApcsDisabled); \
109  ok_eq_int(Thread->SpecialApcDisable, SpecialApcsDisabled); \
110  ok_irql(ExpectedIrql); \
111 } while (0)
112 
113 static
114 VOID
115 TestGuardedMutex(
117  SHORT KernelApcsDisabled,
118  SHORT SpecialApcsDisabled,
119  SHORT AllApcsDisabled,
120  KIRQL OriginalIrql)
121 {
123 
124  ok_irql(OriginalIrql);
125  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, 0x5555, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
126 
127  /* these ASSERT */
128  if (!KmtIsCheckedBuild || OriginalIrql <= APC_LEVEL)
129  {
130  /* acquire/release normally */
131  pKeAcquireGuardedMutex(Mutex);
132  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled - 1, TRUE, OriginalIrql);
133  ok_bool_false(pKeTryToAcquireGuardedMutex(Mutex), "KeTryToAcquireGuardedMutex returned");
134  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled - 1, TRUE, OriginalIrql);
135  pKeReleaseGuardedMutex(Mutex);
136  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
137 
138  /* try to acquire */
139  ok_bool_true(pKeTryToAcquireGuardedMutex(Mutex), "KeTryToAcquireGuardedMutex returned");
140  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled - 1, TRUE, OriginalIrql);
141  pKeReleaseGuardedMutex(Mutex);
142  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
143  }
144  else
145  /* Make the following test happy */
146  Mutex->SpecialApcDisable = SpecialApcsDisabled - 1;
147 
148  /* ASSERT */
149  if (!KmtIsCheckedBuild || OriginalIrql == APC_LEVEL || SpecialApcsDisabled < 0)
150  {
151  /* acquire/release unsafe */
152  pKeAcquireGuardedMutexUnsafe(Mutex);
153  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
154  pKeReleaseGuardedMutexUnsafe(Mutex);
155  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
156  }
157 
158  /* Bugchecks >= DISPATCH_LEVEL */
159  if (!KmtIsCheckedBuild)
160  {
161  /* mismatched acquire/release */
162  pKeAcquireGuardedMutex(Mutex);
163  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled - 1, TRUE, OriginalIrql);
164  pKeReleaseGuardedMutexUnsafe(Mutex);
165  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled - 1, TRUE, OriginalIrql);
166  pKeLeaveGuardedRegion();
167  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
168 
169  pKeAcquireGuardedMutexUnsafe(Mutex);
170  CheckMutex(Mutex, 0L, Thread, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
171  pKeReleaseGuardedMutex(Mutex);
172  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled + 1, OriginalIrql >= APC_LEVEL || SpecialApcsDisabled != -1, OriginalIrql);
173  pKeEnterGuardedRegion();
174  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
175 
176  /* release without acquire */
177  pKeReleaseGuardedMutexUnsafe(Mutex);
178  CheckMutex(Mutex, 0L, NULL, 0LU, 0x5555, SpecialApcsDisabled - 1, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, OriginalIrql);
179  pKeReleaseGuardedMutex(Mutex);
180  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled, KernelApcsDisabled, SpecialApcsDisabled + 1, OriginalIrql >= APC_LEVEL || SpecialApcsDisabled != -1, OriginalIrql);
181  pKeReleaseGuardedMutex(Mutex);
182  /* TODO: here we see that Mutex->Count isn't actually just a count. Test the bits correctly! */
183  CheckMutex(Mutex, 0L, NULL, 0LU, 0x5555, SpecialApcsDisabled, KernelApcsDisabled, SpecialApcsDisabled + 2, OriginalIrql >= APC_LEVEL || SpecialApcsDisabled != -2, OriginalIrql);
184  pKeReleaseGuardedMutex(Mutex);
185  CheckMutex(Mutex, 1L, NULL, 0LU, 0x5555, SpecialApcsDisabled, KernelApcsDisabled, SpecialApcsDisabled + 3, OriginalIrql >= APC_LEVEL || SpecialApcsDisabled != -3, OriginalIrql);
186  Thread->SpecialApcDisable -= 3;
187  }
188 
189  /* make sure we survive this in case of error */
190  ok_eq_long(Mutex->Count, 1L);
191  Mutex->Count = 1;
192  ok_eq_int(Thread->KernelApcDisable, KernelApcsDisabled);
193  Thread->KernelApcDisable = KernelApcsDisabled;
194  ok_eq_int(Thread->SpecialApcDisable, SpecialApcsDisabled);
195  Thread->SpecialApcDisable = SpecialApcsDisabled;
196  ok_irql(OriginalIrql);
197 }
198 
201 
202 typedef struct
203 {
204  HANDLE Handle;
206  KIRQL Irql;
208  PMUTEX_FUNCTION Acquire;
209  PMUTEX_TRY_FUNCTION TryAcquire;
211  BOOLEAN Try;
212  BOOLEAN RetExpected;
213  KEVENT InEvent;
214  KEVENT OutEvent;
216 
217 static
218 VOID
219 NTAPI
222 {
224  KIRQL Irql;
225  BOOLEAN Ret = FALSE;
227 
228  DPRINT("Thread starting\n");
229  KeRaiseIrql(ThreadData->Irql, &Irql);
230 
231  if (ThreadData->Try)
232  {
233  Ret = ThreadData->TryAcquire(ThreadData->Mutex);
234  ok_eq_bool(Ret, ThreadData->RetExpected);
235  }
236  else
237  ThreadData->Acquire(ThreadData->Mutex);
238 
239  ok_bool_false(KeSetEvent(&ThreadData->OutEvent, 0, TRUE), "KeSetEvent returned");
240  DPRINT("Thread now waiting\n");
242  DPRINT("Thread done waiting\n");
244 
245  if (!ThreadData->Try || Ret)
246  ThreadData->Release(ThreadData->Mutex);
247 
248  KeLowerIrql(Irql);
249  DPRINT("Thread exiting\n");
250 }
251 
252 static
253 VOID
257  PMUTEX_FUNCTION Acquire,
258  PMUTEX_TRY_FUNCTION TryAcquire,
260 {
261  ThreadData->Mutex = Mutex;
264  ThreadData->Acquire = Acquire;
265  ThreadData->TryAcquire = TryAcquire;
266  ThreadData->Release = Release;
267 }
268 
269 static
270 NTSTATUS
274  KIRQL Irql,
275  BOOLEAN Try,
276  BOOLEAN RetExpected)
277 {
280 
281  ThreadData->Try = Try;
282  ThreadData->Irql = Irql;
283  ThreadData->RetExpected = RetExpected;
289 
291 }
292 
293 static
294 VOID
297 {
299 
300  KeSetEvent(&ThreadData->InEvent, 0, TRUE);
303 
307  KeClearEvent(&ThreadData->InEvent);
308  KeClearEvent(&ThreadData->OutEvent);
309 }
310 
311 static
312 VOID
315 {
318  THREAD_DATA ThreadData2;
319  THREAD_DATA ThreadDataUnsafe;
320  THREAD_DATA ThreadDataTry;
323  Timeout.QuadPart = -50 * 1000 * 10; /* 50 ms */
324 
325  InitThreadData(&ThreadData, Mutex, pKeAcquireGuardedMutex, NULL, pKeReleaseGuardedMutex);
326  InitThreadData(&ThreadData2, Mutex, pKeAcquireGuardedMutex, NULL, pKeReleaseGuardedMutex);
327  InitThreadData(&ThreadDataUnsafe, Mutex, pKeAcquireGuardedMutexUnsafe, NULL, pKeReleaseGuardedMutexUnsafe);
328  InitThreadData(&ThreadDataTry, Mutex, NULL, pKeTryToAcquireGuardedMutex, pKeReleaseGuardedMutex);
329 
330  /* have a thread acquire the mutex */
333  CheckMutex(Mutex, 0L, ThreadData.Thread, 0LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
334  /* have a second thread try to acquire it -- should fail */
335  Status = StartThread(&ThreadDataTry, NULL, PASSIVE_LEVEL, TRUE, FALSE);
337  CheckMutex(Mutex, 0L, ThreadData.Thread, 0LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
338  FinishThread(&ThreadDataTry);
339 
340  /* have another thread acquire it -- should block */
341  Status = StartThread(&ThreadData2, &Timeout, APC_LEVEL, FALSE, FALSE);
343  CheckMutex(Mutex, 4L, ThreadData.Thread, 1LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
344 
345  /* finish the first thread -- now the second should become available */
349  CheckMutex(Mutex, 0L, ThreadData2.Thread, 1LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
350 
351  /* block two more threads */
352  Status = StartThread(&ThreadDataUnsafe, &Timeout, APC_LEVEL, FALSE, FALSE);
354  CheckMutex(Mutex, 4L, ThreadData2.Thread, 2LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
355 
358  CheckMutex(Mutex, 8L, ThreadData2.Thread, 3LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
359 
360  /* finish 1 */
361  FinishThread(&ThreadData2);
364  CheckMutex(Mutex, 4L, ThreadDataUnsafe.Thread, 3LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
365 
366  /* finish 2 */
367  FinishThread(&ThreadDataUnsafe);
370  CheckMutex(Mutex, 0L, ThreadData.Thread, 3LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
371 
372  /* finish 3 */
374 
375  CheckMutex(Mutex, 1L, NULL, 3LU, 0x5555, -1, 0, 0, FALSE, PASSIVE_LEVEL);
376 }
377 
378 START_TEST(KeGuardedMutex)
379 {
381  KIRQL OldIrql;
383  struct {
384  KIRQL Irql;
385  SHORT KernelApcsDisabled;
386  SHORT SpecialApcsDisabled;
387  BOOLEAN AllApcsDisabled;
388  } TestIterations[] =
389  {
390  { PASSIVE_LEVEL, 0, 0, FALSE },
391  { PASSIVE_LEVEL, -1, 0, FALSE },
392  { PASSIVE_LEVEL, -3, 0, FALSE },
393  { PASSIVE_LEVEL, 0, -1, TRUE },
394  { PASSIVE_LEVEL, -1, -1, TRUE },
395  { PASSIVE_LEVEL, -3, -2, TRUE },
396  // 6
397  { APC_LEVEL, 0, 0, TRUE },
398  { APC_LEVEL, -1, 0, TRUE },
399  { APC_LEVEL, -3, 0, TRUE },
400  { APC_LEVEL, 0, -1, TRUE },
401  { APC_LEVEL, -1, -1, TRUE },
402  { APC_LEVEL, -3, -2, TRUE },
403  // 12
404  { DISPATCH_LEVEL, 0, 0, TRUE },
405  { DISPATCH_LEVEL, -1, 0, TRUE },
406  { DISPATCH_LEVEL, -3, 0, TRUE },
407  { DISPATCH_LEVEL, 0, -1, TRUE },
408  { DISPATCH_LEVEL, -1, -1, TRUE },
409  { DISPATCH_LEVEL, -3, -2, TRUE },
410  // 18
411  { HIGH_LEVEL, 0, 0, TRUE },
412  { HIGH_LEVEL, -1, 0, TRUE },
413  { HIGH_LEVEL, -3, 0, TRUE },
414  { HIGH_LEVEL, 0, -1, TRUE },
415  { HIGH_LEVEL, -1, -1, TRUE },
416  { HIGH_LEVEL, -3, -2, TRUE },
417  };
418  int i;
419 
420  pKeAreAllApcsDisabled = KmtGetSystemRoutineAddress(L"KeAreAllApcsDisabled");
421  pKeInitializeGuardedMutex = KmtGetSystemRoutineAddress(L"KeInitializeGuardedMutex");
422  pKeAcquireGuardedMutex = KmtGetSystemRoutineAddress(L"KeAcquireGuardedMutex");
423  pKeAcquireGuardedMutexUnsafe = KmtGetSystemRoutineAddress(L"KeAcquireGuardedMutexUnsafe");
424  pKeEnterGuardedRegion = KmtGetSystemRoutineAddress(L"KeEnterGuardedRegion");
425  pKeLeaveGuardedRegion = KmtGetSystemRoutineAddress(L"KeLeaveGuardedRegion");
426  pKeReleaseGuardedMutex = KmtGetSystemRoutineAddress(L"KeReleaseGuardedMutex");
427  pKeReleaseGuardedMutexUnsafe = KmtGetSystemRoutineAddress(L"KeReleaseGuardedMutexUnsafe");
428  pKeTryToAcquireGuardedMutex = KmtGetSystemRoutineAddress(L"KeTryToAcquireGuardedMutex");
429 
430  if (skip(pKeAreAllApcsDisabled &&
431  pKeInitializeGuardedMutex &&
432  pKeAcquireGuardedMutex &&
433  pKeAcquireGuardedMutexUnsafe &&
434  pKeEnterGuardedRegion &&
435  pKeLeaveGuardedRegion &&
436  pKeReleaseGuardedMutex &&
437  pKeReleaseGuardedMutexUnsafe &&
438  pKeTryToAcquireGuardedMutex, "No guarded mutexes\n"))
439  {
440  return;
441  }
442 
443  for (i = 0; i < sizeof TestIterations / sizeof TestIterations[0]; ++i)
444  {
445  trace("Run %d\n", i);
446  KeRaiseIrql(TestIterations[i].Irql, &OldIrql);
447  Thread->KernelApcDisable = TestIterations[i].KernelApcsDisabled;
448  Thread->SpecialApcDisable = TestIterations[i].SpecialApcsDisabled;
449 
450  RtlFillMemory(&Mutex, sizeof Mutex, 0x55);
451  pKeInitializeGuardedMutex(&Mutex);
452  CheckMutex(&Mutex, 1L, NULL, 0LU, 0x5555, 0x5555, TestIterations[i].KernelApcsDisabled, TestIterations[i].SpecialApcsDisabled, TestIterations[i].AllApcsDisabled, TestIterations[i].Irql);
453  TestGuardedMutex(&Mutex, TestIterations[i].KernelApcsDisabled, TestIterations[i].SpecialApcsDisabled, TestIterations[i].AllApcsDisabled, TestIterations[i].Irql);
454 
455  Thread->SpecialApcDisable = 0;
456  Thread->KernelApcDisable = 0;
458  }
459 
460  trace("Concurrent test\n");
461  RtlFillMemory(&Mutex, sizeof Mutex, 0x55);
462  pKeInitializeGuardedMutex(&Mutex);
464 }
START_TEST(KeGuardedMutex)
return
Definition: dirsup.c:529
#define GENERIC_ALL
Definition: nt_native.h:92
#define _Must_inspect_result_
Definition: no_sal2.h:314
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
PKGUARDED_MUTEX Mutex
struct _KGUARDED_MUTEX * PKGUARDED_MUTEX
#define _IRQL_requires_max_(irql)
Definition: no_sal2.h:650
#define TRUE
Definition: types.h:120
#define ok_eq_int(value, expected)
Definition: kmt_test.h:238
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
struct THREAD_DATA * PTHREAD_DATA
static VOID NTAPI AcquireMutexThread(PVOID Parameter)
_Requires_lock_not_held_(Vcb->fcb_lock) _Acquires_shared_lock_(Vcb -> fcb_lock) static __inline void acquire_fcb_lock_shared(device_extension *Vcb)
Definition: btrfs_drv.h:967
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
_Acquires_exclusive_lock_(Vcb->Resource)) FINISHED FatAcquireExclusiveVcb_Real(IN PIRP_CONTEXT IrpContext
_In_ PVOID Parameter
Definition: ldrtypes.h:241
#define CheckMutex(Mutex, ExpectedCount, ExpectedOwner, ExpectedContention, ExpectedKernelApcDisable, ExpectedSpecialApcDisable, KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, ExpectedIrql)
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define FASTCALL
Definition: nt_native.h:50
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
_Out_ PKIRQL Irql
Definition: csq.h:179
Definition: Mutex.h:15
PKTHREAD Thread
Definition: ExFastMutex.c:143
VOID(FASTCALL * PMUTEX_FUNCTION)(PKGUARDED_MUTEX)
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KmtIsCheckedBuild
#define ok_bool_true(value, desc)
Definition: kmt_test.h:256
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
#define _Acquires_lock_(lock)
Definition: no_sal2.h:677
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
short SHORT
Definition: pedump.c:59
#define _Releases_lock_(a)
Definition: btrfs_drv.h:208
KEVENT OutEvent
Definition: ExFastMutex.c:152
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define _Out_
Definition: no_sal2.h:323
void DPRINT(...)
Definition: polytest.cpp:61
#define ok_eq_bool(value, expected)
Definition: kmt_test.h:258
_In_ HANDLE Handle
Definition: extypes.h:390
#define trace
Definition: atltest.h:70
#define _Post_satisfies_(cond)
Definition: no_sal2.h:465
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
static VOID InitThreadData(PTHREAD_DATA ThreadData, PKGUARDED_MUTEX Mutex, PMUTEX_FUNCTION Acquire, PMUTEX_TRY_FUNCTION TryAcquire, PMUTEX_FUNCTION Release)
#define _Success_(expr)
Definition: no_sal2.h:635
HANDLE Handle
Definition: drwtsn32.h:25
static VOID FinishThread(PTHREAD_DATA ThreadData)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
PVOID KmtGetSystemRoutineAddress(IN PCWSTR RoutineName)
#define _Inout_
Definition: no_sal2.h:244
POBJECT_TYPE PsThreadType
Definition: thread.c:20
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define VOID
Definition: acefi.h:82
#define SYNCHRONIZE
Definition: nt_native.h:61
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
static _IRQL_requires_min_(PASSIVE_LEVEL)
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
static ULONG Timeout
Definition: ping.c:61
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
static VOID TestGuardedMutexConcurrent(PKGUARDED_MUTEX Mutex)
static PFAST_MUTEX Mutex
Definition: timer.c:22
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
#define _When_(expr, annos)
Definition: no_sal2.h:639
#define skip(...)
Definition: atltest.h:64
#define BOOLEAN
Definition: pedump.c:73
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
static NTSTATUS StartThread(PTHREAD_DATA ThreadData, PLARGE_INTEGER Timeout, KIRQL Irql, BOOLEAN Try, BOOLEAN RetExpected)
#define ok_eq_hex(value, expected)
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define KeGetCurrentThread
Definition: hal.h:44
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
return STATUS_SUCCESS
Definition: btrfs.c:3014
BOOLEAN(FASTCALL * PMUTEX_TRY_FUNCTION)(PKGUARDED_MUTEX)
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define ok_eq_long(value, expected)
Definition: kmt_test.h:240
#define _Requires_lock_held_(a)
Definition: btrfs_drv.h:206