Ad more routines for semaphores support
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Rafal Kupiec 2023-02-17 09:40:18 +01:00
parent 03bae53fb9
commit 08405e7bdc
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 61 additions and 0 deletions

View File

@ -35,6 +35,17 @@ VOID
KeInitializeTimerEx(OUT PKTIMER Timer, KeInitializeTimerEx(OUT PKTIMER Timer,
IN KTIMER_TYPE Type); IN KTIMER_TYPE Type);
XTAPI
LONG
KeReadSemaphoreState(IN PKSEMAPHORE Semaphore);
XTAPI
LONG
KeReleaseSemaphore(IN PKSEMAPHORE Semaphore,
IN KPRIORITY Increment,
IN LONG Adjustment,
IN BOOLEAN Wait);
XTAPI XTAPI
VOID VOID
KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters); KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters);

View File

@ -39,3 +39,51 @@ KeInitializeSemaphore(IN PKSEMAPHORE Semaphore,
/* Initialize semaphore wait list */ /* Initialize semaphore wait list */
RtlInitializeListHead(&Semaphore->Header.WaitListHead); RtlInitializeListHead(&Semaphore->Header.WaitListHead);
} }
/**
* Reads semaphore's current signal state.
*
* @param Semaphore
* Supplies a pointer to a semaphore object.
*
* @return This routine returns the current signal state of the semaphore.
*
* @since XT 1.0
*/
XTAPI
LONG
KeReadSemaphoreState(IN PKSEMAPHORE Semaphore)
{
/* Return semaphore's signal state */
return Semaphore->Header.SignalState;
}
/**
* Releases a semaphore.
*
* @param Semaphore
* Supplies a pointer to a semaphore object.
*
* @param Increment
* Specifies the priority increment value of the semaphore.
*
* @param Adjustment
* Specifies adjustment value added to the semaphore's initial count value.
*
* @param Wait
* Determines whether release of the semaphore will be followed by a kernel wait routine call or not.
*
* @return This routine returns a previous signal state of the semaphore.
*
* @since NT 3.5
*/
XTAPI
LONG
KeReleaseSemaphore(IN PKSEMAPHORE Semaphore,
IN KPRIORITY Increment,
IN LONG Adjustment,
IN BOOLEAN Wait)
{
UNIMPLEMENTED;
return 0;
}

View File

@ -8,6 +8,8 @@
@ stdcall KeInitializeSpinLock(ptr) @ stdcall KeInitializeSpinLock(ptr)
@ stdcall KeInitializeTimer(ptr) @ stdcall KeInitializeTimer(ptr)
@ stdcall KeInitializeTimerEx(ptr long) @ stdcall KeInitializeTimerEx(ptr long)
@ stdcall KeReadSemaphoreState(ptr)
@ stdcall KeReleaseSemaphore(ptr long long long)
@ stdcall RtlCompareMemory(ptr ptr long) @ stdcall RtlCompareMemory(ptr ptr long)
@ stdcall RtlCopyMemory(ptr ptr long) @ stdcall RtlCopyMemory(ptr ptr long)
@ stdcall RtlFillMemory(ptr long long) @ stdcall RtlFillMemory(ptr long long)