Global (Windows): prefers NtClose over CloseHandle

This commit is contained in:
李通洲
2026-03-13 10:58:38 +08:00
parent ea6ad4ac86
commit ca9c67353f
5 changed files with 11 additions and 11 deletions
+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