Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 9 --------- dlls/ntoskrnl.exe/sync.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index c1cfb032dd..07e9104498 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2307,15 +2307,6 @@ LONG WINAPI KeReleaseMutex(PRKMUTEX Mutex, BOOLEAN Wait) }
-/*********************************************************************** - * KeInitializeSemaphore (NTOSKRNL.EXE.@) - */ -void WINAPI KeInitializeSemaphore( PRKSEMAPHORE Semaphore, LONG Count, LONG Limit ) -{ - FIXME( "(%p %d %d) stub\n", Semaphore , Count, Limit ); -} - - /*********************************************************************** * KeInitializeSpinLock (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 8011b56754..2190faa81f 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -36,6 +36,7 @@ enum object_type { TYPE_MANUAL_EVENT = 0, TYPE_AUTO_EVENT = 1, + TYPE_SEMAPHORE = 5, };
static CRITICAL_SECTION sync_cs; @@ -172,3 +173,17 @@ LONG WINAPI KeResetEvent( PRKEVENT event )
return ret; } + +/*********************************************************************** + * KeInitializeSemaphore (NTOSKRNL.EXE.@) + */ +void WINAPI KeInitializeSemaphore( PRKSEMAPHORE semaphore, LONG count, LONG limit ) +{ + TRACE("semaphore %p, count %d, limit %d.\n", semaphore, count, limit); + + semaphore->Header.Type = TYPE_SEMAPHORE; + semaphore->Header.SignalState = count; + semaphore->Header.WaitListHead.Blink = NULL; + semaphore->Header.WaitListHead.Flink = NULL; + semaphore->Limit = limit; +}