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 index 3324b3b6d8..d3e6070149 100644 --- 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 index 7009c4cfec..94b9778602 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1125,3 +1125,22 @@ ULONG WINAPI ExGetSharedWaiterCount( ERESOURCE *resource )
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 index a0219c4c1e..5a84602d43 100644 --- 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); ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);