diff --git a/sdk/xtdk/kefuncs.h b/sdk/xtdk/kefuncs.h index a55d4b7..ddf5c5a 100644 --- a/sdk/xtdk/kefuncs.h +++ b/sdk/xtdk/kefuncs.h @@ -35,6 +35,17 @@ VOID KeInitializeTimerEx(OUT PKTIMER Timer, 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 VOID KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters); diff --git a/xtoskrnl/ke/semphore.c b/xtoskrnl/ke/semphore.c index 02aff0d..2e95ce9 100644 --- a/xtoskrnl/ke/semphore.c +++ b/xtoskrnl/ke/semphore.c @@ -39,3 +39,51 @@ KeInitializeSemaphore(IN PKSEMAPHORE Semaphore, /* Initialize semaphore wait list */ 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; +} diff --git a/xtoskrnl/xtoskrnl.spec b/xtoskrnl/xtoskrnl.spec index c45b4e6..1655597 100644 --- a/xtoskrnl/xtoskrnl.spec +++ b/xtoskrnl/xtoskrnl.spec @@ -8,6 +8,8 @@ @ stdcall KeInitializeSpinLock(ptr) @ stdcall KeInitializeTimer(ptr) @ stdcall KeInitializeTimerEx(ptr long) +@ stdcall KeReadSemaphoreState(ptr) +@ stdcall KeReleaseSemaphore(ptr long long long) @ stdcall RtlCompareMemory(ptr ptr long) @ stdcall RtlCopyMemory(ptr ptr long) @ stdcall RtlFillMemory(ptr long long)