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 2d1c82663d..bdf2a4463c 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -146,7 +146,7 @@ @ stub ExFreeToPagedLookasideList @ stub ExGetCurrentProcessorCounts @ stub ExGetCurrentProcessorCpuUsage -@ stub ExGetExclusiveWaiterCount +@ stdcall ExGetExclusiveWaiterCount(ptr) @ stub ExGetPreviousMode @ stub ExGetSharedWaiterCount @ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long) diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index c8cae7dd89..823ff2b587 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1087,3 +1087,22 @@ void WINAPI ExReleaseResourceLite( ERESOURCE *resource ) { ExReleaseResourceForThreadLite( resource, (ERESOURCE_THREAD)KeGetCurrentThread() ); } + +/*********************************************************************** + * ExGetExclusiveWaiterCount (NTOSKRNL.EXE.@) + */ +ULONG WINAPI ExGetExclusiveWaiterCount( ERESOURCE *resource ) +{ + ULONG count; + KIRQL irql; + + TRACE("resource %p.\n", resource); + + KeAcquireSpinLock( &resource->SpinLock, &irql ); + + count = resource->NumberOfExclusiveWaiters; + + KeReleaseSpinLock( &resource->SpinLock, irql ); + + return count; +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 41c462f4a7..241f6d695e 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1524,6 +1524,7 @@ void WINAPI ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST); NTSTATUS WINAPI ExDeleteResourceLite(ERESOURCE*); void WINAPI ExFreePool(PVOID); void WINAPI ExFreePoolWithTag(PVOID,ULONG); +ULONG WINAPI ExGetExclusiveWaiterCount(ERESOURCE*); void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT); NTSTATUS WINAPI ExInitializeResourceLite(ERESOURCE*); PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);