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 bdf2a4463c..3324b3b6d8 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -148,7 +148,7 @@ @ stub ExGetCurrentProcessorCpuUsage @ stdcall ExGetExclusiveWaiterCount(ptr) @ stub ExGetPreviousMode -@ stub ExGetSharedWaiterCount +@ stdcall ExGetSharedWaiterCount(ptr) @ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long) @ stdcall ExInitializePagedLookasideList(ptr ptr ptr long long long long) @ stdcall ExInitializeResourceLite(ptr) diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 823ff2b587..7009c4cfec 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1106,3 +1106,22 @@ ULONG WINAPI ExGetExclusiveWaiterCount( ERESOURCE *resource )
return count; } + +/*********************************************************************** + * ExGetSharedWaiterCount (NTOSKRNL.EXE.@) + */ +ULONG WINAPI ExGetSharedWaiterCount( ERESOURCE *resource ) +{ + ULONG count; + KIRQL irql; + + TRACE("resource %p.\n", resource); + + KeAcquireSpinLock( &resource->SpinLock, &irql ); + + count = resource->NumberOfSharedWaiters; + + KeReleaseSpinLock( &resource->SpinLock, irql ); + + return count; +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 241f6d695e..a0219c4c1e 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1525,6 +1525,7 @@ NTSTATUS WINAPI ExDeleteResourceLite(ERESOURCE*); void WINAPI ExFreePool(PVOID); void WINAPI ExFreePoolWithTag(PVOID,ULONG); ULONG WINAPI ExGetExclusiveWaiterCount(ERESOURCE*); +ULONG WINAPI ExGetSharedWaiterCount(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);