Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/sync.c | 15 +++++++++++++++ include/ddk/wdm.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 841fb6dfcd..a70a74ecc5 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -448,7 +448,7 @@ @ stdcall IoRegisterShutdownNotification(ptr) @ stdcall IoReleaseCancelSpinLock(long) @ stdcall IoReleaseRemoveLockAndWaitEx(ptr ptr long) -@ stub IoReleaseRemoveLockEx +@ stdcall IoReleaseRemoveLockEx(ptr ptr long) @ stub IoReleaseVpbSpinLock @ stub IoRemoveShareAccess @ stub IoReportDetectedDevice diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index f54fe2a663..7f4d26335f 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1224,3 +1224,18 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, InterlockedIncrement( &lock->Common.IoCount ); return STATUS_SUCCESS; } + +/*********************************************************************** + * IoReleaseRemoveLockEx (NTOSKRNL.EXE.@) + */ +void WINAPI IoReleaseRemoveLockEx( IO_REMOVE_LOCK *lock, void *tag, ULONG size ) +{ + LONG count; + + TRACE("lock %p, tag %p, size %u.\n", lock, tag, size); + + 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); +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 73ead8adc6..f949433307 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 IoReleaseRemoveLockEx(IO_REMOVE_LOCK*,void*,ULONG); NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN); NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);