Global (Windows): makes NtWaitForSingleObject not alertable

This commit is contained in:
李通洲
2026-03-27 14:37:41 +08:00
parent f50059dc7b
commit 57440a7a45
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -419,7 +419,7 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
while (true)
{
if (NtWaitForSingleObject(hInput, TRUE, &(LARGE_INTEGER) { .QuadPart = (int64_t) FF_IO_TERM_RESP_WAIT_MS * -10000 }) != STATUS_WAIT_0)
if (NtWaitForSingleObject(hInput, FALSE, &(LARGE_INTEGER) { .QuadPart = (int64_t) FF_IO_TERM_RESP_WAIT_MS * -10000 }) != STATUS_WAIT_0)
{
SetConsoleMode(hInput, inputMode);
return "NtWaitForSingleObject() failed or timeout";
+2 -2
View File
@@ -146,7 +146,7 @@ static void terminateChildProcess(HANDLE hProcess, HANDLE hChildPipeRead, HANDLE
if (NT_SUCCESS(NtCancelIoFileEx(hChildPipeRead, piosb, &cancelIosb)))
{
if (hReadEvent)
NtWaitForSingleObject(hReadEvent, TRUE, &(LARGE_INTEGER) { .QuadPart = -100000 }); // wait for cancellation to complete
NtWaitForSingleObject(hReadEvent, FALSE, &(LARGE_INTEGER) { .QuadPart = -100000 }); // wait for cancellation to complete
}
NtTerminateProcess(hProcess, 1);
}
@@ -184,7 +184,7 @@ const char* ffProcessReadOutput(FFProcessHandle* handle, FFstrbuf* buffer)
);
if (status == STATUS_PENDING)
{
switch (NtWaitForSingleObject(hReadEvent, TRUE, &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }))
switch (NtWaitForSingleObject(hReadEvent, FALSE, &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }))
{
case STATUS_WAIT_0:
status = iosb.Status;
+1 -1
View File
@@ -21,7 +21,7 @@
static inline void ffThreadDetach(FFThreadType thread) { NtClose(thread); }
static inline bool ffThreadJoin(FFThreadType thread, uint32_t timeout)
{
if (NtWaitForSingleObject(thread, TRUE, timeout == 0 ? NULL : &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }) != STATUS_WAIT_0)
if (NtWaitForSingleObject(thread, FALSE, timeout == 0 ? NULL : &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }) != STATUS_WAIT_0)
{
TerminateThread(thread, (DWORD) -1);
NtClose(thread);