[Kernel] Fix NtReleaseSemaphore returning wrong status code

This commit is contained in:
Herman S.
2026-04-13 12:59:36 +09:00
parent c17a3b19fb
commit d42411ec2a
2 changed files with 2 additions and 3 deletions

View File

@@ -775,13 +775,11 @@ dword_result_t NtReleaseSemaphore_entry(dword_t sem_handle,
bool success =
sem->ReleaseSemaphore((int32_t)release_count, &previous_count);
if (!success) {
// Releasing would exceed the semaphore's maximum count
// Windows returns STATUS_SEMAPHORE_LIMIT_EXCEEDED (0x0000012B)
XELOGW(
"NtReleaseSemaphore: release_count={} would exceed maximum (current "
"count={})",
uint32_t(release_count), previous_count);
result = 0x0000012B;
result = X_STATUS_SEMAPHORE_LIMIT_EXCEEDED;
}
} else {
result = X_STATUS_INVALID_HANDLE;