2019-03-11 14:52:39 -07:00
|
|
|
From 29d57097b8a1915d1fdbd8822117c096bb9e8dae Mon Sep 17 00:00:00 2001
|
2019-02-19 16:59:41 -08:00
|
|
|
From: Zebediah Figura <z.figura12@gmail.com>
|
|
|
|
Date: Tue, 29 Jan 2019 21:50:37 -0600
|
2019-03-11 14:52:39 -07:00
|
|
|
Subject: [PATCH] ntoskrnl.exe: Implement ExIsResourceAcquiredExclusiveLite().
|
2019-02-19 16:59:41 -08:00
|
|
|
|
|
|
|
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
|
|
|
---
|
|
|
|
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +-
|
|
|
|
dlls/ntoskrnl.exe/sync.c | 19 +++++++++++++++++++
|
|
|
|
include/ddk/wdm.h | 1 +
|
|
|
|
3 files changed, 21 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
2019-03-11 14:52:39 -07:00
|
|
|
index 51ba575..8892b7c 100644
|
2019-02-19 16:59:41 -08:00
|
|
|
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
|
|
|
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
|
|
|
@@ -165,7 +165,7 @@
|
|
|
|
@ stub ExInterlockedPushEntryList
|
|
|
|
@ stdcall ExInterlockedRemoveHeadList(ptr ptr)
|
|
|
|
@ stub ExIsProcessorFeaturePresent
|
|
|
|
-@ stub ExIsResourceAcquiredExclusiveLite
|
|
|
|
+@ stdcall ExIsResourceAcquiredExclusiveLite(ptr)
|
|
|
|
@ stub ExIsResourceAcquiredSharedLite
|
|
|
|
@ stdcall ExLocalTimeToSystemTime(ptr ptr) RtlLocalTimeToSystemTime
|
|
|
|
@ stub ExNotifyCallback
|
|
|
|
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
|
2019-03-11 14:52:39 -07:00
|
|
|
index c63d739..0f71902 100644
|
2019-02-19 16:59:41 -08:00
|
|
|
--- a/dlls/ntoskrnl.exe/sync.c
|
|
|
|
+++ b/dlls/ntoskrnl.exe/sync.c
|
2019-03-11 14:52:39 -07:00
|
|
|
@@ -1045,3 +1045,22 @@ ULONG WINAPI ExGetSharedWaiterCount( ERESOURCE *resource )
|
2019-02-19 16:59:41 -08:00
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+/***********************************************************************
|
|
|
|
+ * ExIsResourceAcquiredExclusiveLite (NTOSKRNL.EXE.@)
|
|
|
|
+ */
|
|
|
|
+BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite( ERESOURCE *resource )
|
|
|
|
+{
|
|
|
|
+ BOOLEAN ret;
|
|
|
|
+ KIRQL irql;
|
|
|
|
+
|
|
|
|
+ TRACE("resource %p.\n", resource);
|
|
|
|
+
|
|
|
|
+ KeAcquireSpinLock( &resource->SpinLock, &irql );
|
|
|
|
+
|
|
|
|
+ ret = (resource->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)KeGetCurrentThread());
|
|
|
|
+
|
|
|
|
+ KeReleaseSpinLock( &resource->SpinLock, irql );
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
2019-03-11 14:52:39 -07:00
|
|
|
index 1c58ab9..80a82b0 100644
|
2019-02-19 16:59:41 -08:00
|
|
|
--- a/include/ddk/wdm.h
|
|
|
|
+++ b/include/ddk/wdm.h
|
|
|
|
@@ -1531,6 +1531,7 @@ NTSTATUS WINAPI ExInitializeResourceLite(ERESOURCE*);
|
|
|
|
PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
|
|
|
|
PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK);
|
|
|
|
LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*);
|
|
|
|
+BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite(ERESOURCE*);
|
|
|
|
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
|
|
|
|
void WINAPI ExReleaseResourceForThreadLite(ERESOURCE*,ERESOURCE_THREAD);
|
2019-03-11 14:52:39 -07:00
|
|
|
ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);
|
2019-02-19 16:59:41 -08:00
|
|
|
--
|
2019-03-11 14:52:39 -07:00
|
|
|
1.9.1
|
2019-02-19 16:59:41 -08:00
|
|
|
|