[PATCH 3/6] hal: Implement KeReleaseSpinLock().

Zebediah Figura z.figura12 at gmail.com
Wed Jan 23 23:23:01 CST 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/hal/hal.c    | 11 +++++++++--
 dlls/hal/hal.spec |  2 +-
 include/ddk/wdm.h |  1 +
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c
index 5560d9b742..924fd9e6d9 100644
--- a/dlls/hal/hal.c
+++ b/dlls/hal/hal.c
@@ -26,6 +26,7 @@
 #include "ntstatus.h"
 #define WIN32_NO_STATUS
 #include "windef.h"
+#include "winbase.h"
 #include "winternl.h"
 #include "excpt.h"
 #include "ddk/ntddk.h"
@@ -76,9 +77,15 @@ KIRQL WINAPI DECLSPEC_HIDDEN __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock)
 }
 
 DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock )
-VOID WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql)
+void WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql )
 {
-    FIXME( "(%p %u) stub!\n", SpinLock, NewIrql );
+    KeReleaseSpinLock( lock, irql );
+}
+
+void WINAPI KeReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql )
+{
+    TRACE("lock %p, irql %u.\n", lock, irql);
+    InterlockedExchangePointer( (void **)lock, 0 );
 }
 #endif /* __i386__ */
 
diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec
index 171d9defee..9b74701401 100644
--- a/dlls/hal/hal.spec
+++ b/dlls/hal/hal.spec
@@ -76,7 +76,7 @@
 @ stub KeRaiseIrql
 @ stub KeRaiseIrqlToDpcLevel
 @ stub KeRaiseIrqlToSynchLevel
-@ stdcall -arch=i386 KeReleaseSpinLock(ptr long) ntoskrnl.exe.KeReleaseSpinLock
+@ stdcall -arch=i386 KeReleaseSpinLock(ptr long)
 @ stub KeStallExecutionProcessor
 @ stub READ_PORT_BUFFER_UCHAR
 @ stub READ_PORT_BUFFER_ULONG
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 04dbf6d359..6193c023ea 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1462,6 +1462,7 @@ ULONG     WINAPI KeQueryTimeIncrement(void);
 BOOLEAN   WINAPI KeRegisterBugCheckReasonCallback(KBUGCHECK_REASON_CALLBACK_RECORD*,KBUGCHECK_REASON_CALLBACK_ROUTINE*,KBUGCHECK_CALLBACK_REASON,UCHAR*);
 LONG      WINAPI KeReleaseMutex(PRKMUTEX,BOOLEAN);
 LONG      WINAPI KeReleaseSemaphore(PRKSEMAPHORE,KPRIORITY,LONG,BOOLEAN);
+void      WINAPI KeReleaseSpinLock(KSPIN_LOCK*,KIRQL);
 LONG      WINAPI KeResetEvent(PRKEVENT);
 LONG      WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN);
 KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
-- 
2.20.1




More information about the wine-devel mailing list