ReactOS 0.4.15-dev-8102-g108db8f
KeSpinLock.c File Reference
#include <kmt_test.h>
#include <limits.h>
#include <debug.h>
Include dependency graph for KeSpinLock.c:

Go to the source code of this file.

Macros

#define WIN9X_COMPAT_SPINLOCK
 
#define DEFINE_ACQUIRE(LocalName, SetIsAcquired, DoCall)
 
#define DEFINE_RELEASE(LocalName, SetIsAcquired, DoCall)
 
#define CheckSpinLockLock(SpinLock, CheckData, Value)
 
#define CheckSpinLockQueue(SpinLock, CheckData, Value)
 
#define CheckSpinLockQueueHandle(SpinLock, CheckData, Value)
 
#define CheckSpinLock(SpinLock, CheckData, Value)
 

Functions

 __declspec (dllimport)
 
 DEFINE_ACQUIRE (AcquireExpNoRaise, DEFINE_RELEASE(FALSE,(KeAcquireSpinLockAtDpcLevel)(SpinLock))
 
BOOLEAN TryQueuedSynch (PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
 
BOOLEAN TryNoRaise (PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
 
static VOID TestSpinLock (PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
 
 START_TEST (KeSpinLock)
 

Macro Definition Documentation

◆ CheckSpinLock

#define CheckSpinLock (   SpinLock,
  CheckData,
  Value 
)
Value:
do \
{ \
BOOLEAN Ret = SpinLock && pKeTestSpinLock ? pKeTestSpinLock(SpinLock) : TRUE; \
KIRQL ExpectedIrql = (CheckData)->OriginalIrql; \
\
switch ((CheckData)->Check) \
{ \
case CheckLock: \
CheckSpinLockLock(SpinLock, CheckData, Value); \
break; \
case CheckQueue: \
CheckSpinLockQueue(SpinLock, CheckData, Value); \
break; \
case CheckQueueHandle: \
CheckSpinLockQueueHandle(SpinLock, CheckData, Value); \
break; \
} \
\
if ((CheckData)->IsAcquired) \
ExpectedIrql = (CheckData)->IrqlWhenAcquired; \
ok_irql(ExpectedIrql); \
ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); \
ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); \
} while (0)
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KmtAreInterruptsEnabled(VOID)
int Check()
Definition: movefile.cpp:196
BOOLEAN NTAPI KeAreApcsDisabled(VOID)
Definition: apc.c:958
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228

Definition at line 221 of file KeSpinLock.c.

◆ CheckSpinLockLock

#define CheckSpinLockLock (   SpinLock,
  CheckData,
  Value 
)
Value:
do \
{ \
{ \
ok_eq_bool(Ret, (Value) == 0); \
if (SpinLock) \
{ \
ok_eq_ulongptr(*(SpinLock), (Value) ? (ULONG_PTR)Thread | 1 : 0); \
else \
ok_eq_ulongptr(*(SpinLock), (Value) ? 1 : 0); \
} \
} \
else \
{ \
ok_bool_true(Ret, "KeTestSpinLock returned"); \
if (SpinLock) \
ok_eq_ulongptr(*(SpinLock), 0); \
} \
ok_eq_uint((CheckData)->Irql, (CheckData)->OriginalIrql); \
} while (0)
#define VOID
Definition: acefi.h:82
_Out_ PKIRQL Irql
Definition: csq.h:179
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define KeGetCurrentThread
Definition: hal.h:55
BOOLEAN KmtIsCheckedBuild
BOOLEAN KmtIsMultiProcessorBuild
uint32_t ULONG_PTR
Definition: typedefs.h:65

Definition at line 167 of file KeSpinLock.c.

◆ CheckSpinLockQueue

#define CheckSpinLockQueue (   SpinLock,
  CheckData,
  Value 
)
Value:
do \
{ \
ok_eq_pointer((CheckData)->Queue->Next, NULL); \
ok_eq_pointer((CheckData)->Queue->Lock, NULL); \
ok_eq_uint((CheckData)->Irql, (CheckData)->OriginalIrql); \
} while (0)
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225

Definition at line 191 of file KeSpinLock.c.

◆ CheckSpinLockQueueHandle

#define CheckSpinLockQueueHandle (   SpinLock,
  CheckData,
  Value 
)
Value:
do \
{ \
{ \
ok_eq_bool(Ret, (Value) == 0); \
if (SpinLock) \
ok_eq_ulongptr(*(SpinLock), \
(Value) ? &(CheckData)->QueueHandle : 0); \
ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Next, NULL); \
ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Lock, \
(PVOID)((ULONG_PTR)SpinLock | ((Value) ? 2 : 0))); \
} \
else \
{ \
ok_bool_true(Ret, "KeTestSpinLock returned"); \
if (SpinLock) \
ok_eq_ulongptr(*(SpinLock), 0); \
ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Next, (CheckData)->UntouchedValue); \
ok_eq_pointer((CheckData)->QueueHandle.LockQueue.Lock, (CheckData)->UntouchedValue); \
} \
ok_eq_uint((CheckData)->QueueHandle.OldIrql, (CheckData)->OriginalIrql); \
} while (0)

Definition at line 198 of file KeSpinLock.c.

◆ DEFINE_ACQUIRE

#define DEFINE_ACQUIRE (   LocalName,
  SetIsAcquired,
  DoCall 
)
Value:
static VOID LocalName(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) \
{ \
ASSERT(!CheckData->IsAcquired); \
DoCall; \
if (SetIsAcquired) CheckData->IsAcquired = TRUE; \
}
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73

Definition at line 92 of file KeSpinLock.c.

◆ DEFINE_RELEASE

#define DEFINE_RELEASE (   LocalName,
  SetIsAcquired,
  DoCall 
)
Value:
static VOID LocalName(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) \
{ \
DoCall; \
if (SetIsAcquired) CheckData->IsAcquired = FALSE; \
}
#define FALSE
Definition: types.h:117

Definition at line 100 of file KeSpinLock.c.

◆ WIN9X_COMPAT_SPINLOCK

#define WIN9X_COMPAT_SPINLOCK

Function Documentation

◆ __declspec()

__declspec ( dllimport  )

Definition at line 10 of file KeSpinLock.c.

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};
BOOLEAN(NTAPI * PACQUIRE_FUNCTION)(PERESOURCE, BOOLEAN)
Definition: ExResource.c:263
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define DUMMYUNIONNAME
Definition: ntbasedef.h:32
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
enum _KSPIN_LOCK_QUEUE_NUMBER KSPIN_LOCK_QUEUE_NUMBER

◆ DEFINE_ACQUIRE()

DEFINE_ACQUIRE ( AcquireExpNoRaise  ,
DEFINE_RELEASE FALSE,
(KeAcquireSpinLockAtDpcLevel)(SpinLock  
)

Definition at line 128 of file KeSpinLock.c.

151 {
152 LOGICAL Ret = KeTryToAcquireQueuedSpinLock(CheckData->QueueNumber, &CheckData->Irql);
153 CheckData->IsAcquired = TRUE;
154 ASSERT(Ret == FALSE || Ret == TRUE);
155 return (BOOLEAN)Ret;
156}
LOGICAL FASTCALL KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, OUT PKIRQL OldIrql)
Definition: spinlock.c:192
#define ASSERT(a)
Definition: mode.c:44

◆ START_TEST()

START_TEST ( KeSpinLock  )

Definition at line 346 of file KeSpinLock.c.

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}
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
BOOLEAN TryQueuedSynch(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData)
Definition: KeSpinLock.c:157
#define ok_bool_false(value, desc)
Definition: apitest.h:79
#define ok_bool_true(value, desc)
Definition: apitest.h:78
#define ok_eq_ulongptr(value, expected)
Definition: apitest.h:71
#define skip(...)
Definition: atltest.h:64
#define CHAR_BIT
Definition: urlcache.c:62
#define ULONG_PTR
Definition: config.h:101
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define IPI_LEVEL
Definition: env_spec_w32.h:701
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
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#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
PVOID KmtGetSystemRoutineAddress(IN PCWSTR RoutineName)
VOID KmtSetIrql(IN KIRQL NewIrql)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1161
#define L(x)
Definition: ntvdm.h:50
#define memset(x, y, z)
Definition: compat.h:39
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]
Definition: ketypes.h:707
void * PVOID
Definition: typedefs.h:50
@ LockQueuePfnLock
Definition: ketypes.h:660

◆ TestSpinLock()

static VOID TestSpinLock ( PKSPIN_LOCK  SpinLock,
PCHECK_DATA  CheckData 
)
static

Definition at line 248 of file KeSpinLock.c.

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}
#define CheckSpinLock(SpinLock, CheckData, Value)
Definition: KeSpinLock.c:221
#define ok_eq_uint(value, expected)
Definition: apitest.h:61
#define trace
Definition: atltest.h:70
Definition: bidi.c:434
int32_t INT
Definition: typedefs.h:58

Referenced by START_TEST().

◆ TryNoRaise()

BOOLEAN TryNoRaise ( PKSPIN_LOCK  SpinLock,
PCHECK_DATA  CheckData 
)

Definition at line 162 of file KeSpinLock.c.

162 {
163 BOOLEAN Ret = pKeTryToAcquireSpinLockAtDpcLevel(SpinLock);
164 return Ret;
165}

Referenced by START_TEST().

◆ TryQueuedSynch()

BOOLEAN TryQueuedSynch ( PKSPIN_LOCK  SpinLock,
PCHECK_DATA  CheckData 
)

Definition at line 157 of file KeSpinLock.c.

157 {
158 BOOLEAN Ret = KeTryToAcquireQueuedSpinLockRaiseToSynch(CheckData->QueueNumber, &CheckData->Irql);
159 CheckData->IsAcquired = TRUE;
160 return Ret;
161}
BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN PKIRQL OldIrql)
Definition: spinlock.c:177

Referenced by START_TEST().