Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/sync.c | 10 ++++++++++ include/ddk/wdm.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index e861000f26..33aa108cd7 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -510,7 +510,7 @@ @ stub Ke386QueryIoAccessMap @ stdcall Ke386SetIoAccessMap(long ptr) @ stub KeAcquireInterruptSpinLock -@ stub KeAcquireSpinLockAtDpcLevel +@ stdcall KeAcquireSpinLockAtDpcLevel(ptr) @ stdcall -arch=arm,arm64,x86_64 KeAcquireSpinLockRaiseToDpc(ptr) @ stub KeAddSystemServiceTable @ stub KeAreApcsDisabled diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index b439695fd7..31a3ad7209 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -395,6 +395,16 @@ static inline void small_pause(void) #endif }
+/*********************************************************************** + * KeAcquireSpinLockAtDpcLevel (NTOSKRNL.EXE.@) + */ +void WINAPI KeAcquireSpinLockAtDpcLevel( KSPIN_LOCK *lock ) +{ + TRACE("lock %p.\n", lock); + while (!InterlockedCompareExchangePointer( (void **)lock, (void *)1, (void *)0 )) + small_pause(); +} + /*********************************************************************** * KeReleaseSpinLockFromDpcLevel (NTOSKRNL.EXE.@) */ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 908e71c72d..81f41f5a97 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1454,6 +1454,7 @@ void WINAPI KeAcquireSpinLock(KSPIN_LOCK*,KIRQL*); #define KeAcquireSpinLock( lock, irql ) *(irql) = KeAcquireSpinLockRaiseToDpc( lock ) KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK*); #endif +void WINAPI KeAcquireSpinLockAtDpcLevel(KSPIN_LOCK*); BOOLEAN WINAPI KeCancelTimer(KTIMER*); void WINAPI KeClearEvent(PRKEVENT); NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);