Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 8 -------- dlls/ntoskrnl.exe/sync.c | 19 +++++++++++++++++++ include/ddk/wdm.h | 1 + 3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 6ce262c96c..b04e49eea7 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3796,14 +3796,6 @@ void WINAPI KeFlushQueuedDpcs(void) FIXME("stub!\n"); }
-/********************************************************************* - * IoReleaseRemoveLockAndWaitEx (NTOSKRNL.@) - */ -void WINAPI IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK lock, PVOID tag, ULONG size) -{ - FIXME("stub: %p %p %u\n", lock, tag, size); -} - /********************************************************************* * DbgQueryDebugFilterState (NTOSKRNL.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 7f4d26335f..4ab8b49724 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1239,3 +1239,22 @@ void WINAPI IoReleaseRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, ULONG size ) else if (count < 0) ERR("Lock %p is not acquired!\n", lock); } + +/*********************************************************************** + * IoReleaseRemoveLockAndWaitEx (NTOSKRNL.EXE.@) + */ +void WINAPI IoReleaseRemoveLockAndWaitEx( IO_REMOVE_LOCK *lock, void *tag, ULONG size ) +{ + LONG count; + + TRACE("lock %p, tag %p, size %u.\n", lock, tag, size); + + lock->Common.Removed = TRUE; + + if (!(count = InterlockedDecrement( &lock->Common.IoCount ))) + KeSetEvent( &lock->Common.RemoveEvent, IO_NO_INCREMENT, FALSE ); + else if (count < 0) + ERR("Lock %p is not acquired!\n", lock); + else + KeWaitForSingleObject( &lock->Common.RemoveEvent, Executive, KernelMode, FALSE, NULL ); +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index f949433307..80eca5406e 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1604,6 +1604,7 @@ NTSTATUS WINAPI IoOpenDeviceRegistryKey(DEVICE_OBJECT*,ULONG,ACCESS_MASK,HANDLE void WINAPI IoQueueWorkItem(PIO_WORKITEM,PIO_WORKITEM_ROUTINE,WORK_QUEUE_TYPE,void*); NTSTATUS WINAPI IoRegisterDeviceInterface(PDEVICE_OBJECT,const GUID*,PUNICODE_STRING,PUNICODE_STRING); void WINAPI IoReleaseCancelSpinLock(KIRQL); +void WINAPI IoReleaseRemoveLockAndWaitEx(IO_REMOVE_LOCK*,void*,ULONG); void WINAPI IoReleaseRemoveLockEx(IO_REMOVE_LOCK*,void*,ULONG); NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN); NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);