Global (Windows): prefers NtClose over CloseHandle

This commit is contained in:
李通洲 committed 2026-03-13 13:27:58 +08:00
1 parent ea6ad4ac86
commit ca9c67353f
5 files changed
+11 -11

No files matched your search

+2 -2
View File
@@ -116,7 +116,7 @@ const char* ffProcessSpawn(char* const argv[], bool useStdErr, FFProcessHandle*
&piProcInfo // receives PROCESS_INFORMATION
);
CloseHandle(hChildPipeWrite);
NtClose(hChildPipeWrite);
if(!success)
{
if (GetLastError() == ERROR_FILE_NOT_FOUND)
@@ -124,7 +124,7 @@ const char* ffProcessSpawn(char* const argv[], bool useStdErr, FFProcessHandle*
return "CreateProcessA() failed";
}
CloseHandle(piProcInfo.hThread); // we don't need the thread handle
NtClose(piProcInfo.hThread); // we don't need the thread handle
outHandle->pid = piProcInfo.hProcess;
outHandle->pipeRead = hChildPipeRead;
hChildPipeRead = INVALID_HANDLE_VALUE; // ownership transferred, don't close it