2019-03-11 14:52:39 -07:00
|
|
|
From d121e866eaf9e480749b7a1faf863e77e67595a4 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:51:08 -0600
|
2019-03-11 14:52:39 -07:00
|
|
|
Subject: [PATCH] ntoskrnl.exe: Implement ExIsResourceAcquiredSharedLite().
|
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 | 25 +++++++++++++++++++++++++
|
|
|
|
include/ddk/wdm.h | 1 +
|
|
|
|
3 files changed, 27 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 8892b7c..f0d6da6 100644
|
2019-02-19 16:59:41 -08:00
|
|
|
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
|
|
|
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
|
|
|
@@ -166,7 +166,7 @@
|
|
|
|
@ stdcall ExInterlockedRemoveHeadList(ptr ptr)
|
|
|
|
@ stub ExIsProcessorFeaturePresent
|
|
|
|
@ stdcall ExIsResourceAcquiredExclusiveLite(ptr)
|
|
|
|
-@ stub ExIsResourceAcquiredSharedLite
|
|
|
|
+@ stdcall ExIsResourceAcquiredSharedLite(ptr)
|
|
|
|
@ stdcall ExLocalTimeToSystemTime(ptr ptr) RtlLocalTimeToSystemTime
|
|
|
|
@ stub ExNotifyCallback
|
|
|
|
@ stub ExQueryPoolBlockSize
|
|
|
|
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
|
2019-03-11 14:52:39 -07:00
|
|
|
index 0f71902..cfdc6d1 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
|
|
|
@@ -1064,3 +1064,28 @@ BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite( ERESOURCE *resource )
|
2019-02-19 16:59:41 -08:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+/***********************************************************************
|
|
|
|
+ * ExIsResourceAcquiredSharedLite (NTOSKRNL.EXE.@)
|
|
|
|
+ */
|
|
|
|
+ULONG WINAPI ExIsResourceAcquiredSharedLite( ERESOURCE *resource )
|
|
|
|
+{
|
|
|
|
+ ULONG ret;
|
|
|
|
+ KIRQL irql;
|
|
|
|
+
|
|
|
|
+ TRACE("resource %p.\n", resource);
|
|
|
|
+
|
|
|
|
+ KeAcquireSpinLock( &resource->SpinLock, &irql );
|
|
|
|
+
|
|
|
|
+ if (resource->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)KeGetCurrentThread())
|
|
|
|
+ ret = resource->ActiveEntries;
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ OWNER_ENTRY *entry = resource_get_shared_entry( resource, (ERESOURCE_THREAD)KeGetCurrentThread() );
|
|
|
|
+ ret = entry->OwnerCount;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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 80a82b0..3600bcd 100644
|
2019-02-19 16:59:41 -08:00
|
|
|
--- a/include/ddk/wdm.h
|
|
|
|
+++ b/include/ddk/wdm.h
|
|
|
|
@@ -1532,6 +1532,7 @@ 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*);
|
|
|
|
+ULONG WINAPI ExIsResourceAcquiredSharedLite(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
|
|
|
|