Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 28 -------------------------- dlls/ntoskrnl.exe/sync.c | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 20bd401489..f2aecd8a56 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -729,34 +729,6 @@ done: return status; }
- -/*********************************************************************** - * ExAcquireFastMutexUnsafe (NTOSKRNL.EXE.@) - */ -#ifdef DEFINE_FASTCALL1_ENTRYPOINT -DEFINE_FASTCALL1_ENTRYPOINT(ExAcquireFastMutexUnsafe) -void WINAPI __regs_ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex) -#else -void WINAPI ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex) -#endif -{ - FIXME("(%p): stub\n", FastMutex); -} - - -/*********************************************************************** - * ExReleaseFastMutexUnsafe (NTOSKRNL.EXE.@) - */ -#ifdef DEFINE_FASTCALL1_ENTRYPOINT -DEFINE_FASTCALL1_ENTRYPOINT(ExReleaseFastMutexUnsafe) -void WINAPI __regs_ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex) -#else -void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex) -#endif -{ - FIXME("(%p): stub\n", FastMutex); -} - /*********************************************************************** * IoAllocateDriverObjectExtension (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 46ffc581f0..1ab37d13f6 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -562,3 +562,41 @@ LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList( LIST_ENTRY *list, KSPIN_LOCK *l
return ret; } + +/*********************************************************************** + * ExAcquireFastMutexUnsafe (NTOSKRNL.EXE.@) + */ +#ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT(ExAcquireFastMutexUnsafe) +void WINAPI __regs_ExAcquireFastMutexUnsafe( FAST_MUTEX *mutex ) +#else +void WINAPI ExAcquireFastMutexUnsafe( FAST_MUTEX *mutex ) +#endif +{ + LONG count; + + TRACE("mutex %p.\n", mutex); + + count = InterlockedDecrement( &mutex->Count ); + if (count < 0) + KeWaitForSingleObject( &mutex->Event, Executive, KernelMode, FALSE, NULL ); +} + +/*********************************************************************** + * ExReleaseFastMutexUnsafe (NTOSKRNL.EXE.@) + */ +#ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT(ExReleaseFastMutexUnsafe) +void WINAPI __regs_ExReleaseFastMutexUnsafe( FAST_MUTEX *mutex ) +#else +void WINAPI ExReleaseFastMutexUnsafe( FAST_MUTEX *mutex ) +#endif +{ + LONG count; + + TRACE("mutex %p.\n", mutex); + + count = InterlockedIncrement( &mutex->Count ); + if (count < 1) + KeSetEvent( &mutex->Event, IO_NO_INCREMENT, FALSE ); +}