From 3080412dc0228db2eb504465f3081af2591068a4 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:18:12 +0300 Subject: [PATCH] Change spin lock release functions to do an interlocked exchange. --- UnleashedRecomp/kernel/imports.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnleashedRecomp/kernel/imports.cpp b/UnleashedRecomp/kernel/imports.cpp index 6821b7b..c5b05f9 100644 --- a/UnleashedRecomp/kernel/imports.cpp +++ b/UnleashedRecomp/kernel/imports.cpp @@ -664,7 +664,7 @@ void RtlRaiseException_x() void KfReleaseSpinLock(uint32_t* spinLock) { //printf("!!! STUB !!! KfReleaseSpinLock\n"); - *spinLock = 0; + InterlockedExchange((volatile long*)spinLock, 0); } void KfAcquireSpinLock(uint32_t* spinLock) @@ -711,7 +711,7 @@ void VdGetSystemCommandBuffer() void KeReleaseSpinLockFromRaisedIrql(uint32_t* spinLock) { //printf("!!! STUB !!! KeReleaseSpinLockFromRaisedIrql\n"); - *spinLock = 0; + InterlockedExchange((volatile long*)spinLock, 0); } void KeAcquireSpinLockAtRaisedIrql(uint32_t* spinLock)