2 Commits cb0ba020d4 ... 18d367afd2

Author SHA1 Message Date
  Sam Lantinga 18d367afd2 Fixed process I/O redirection to NUL on Windows 1 week ago
  Sam Lantinga 9a4faf9ab9 Add the CREATE_NO_WINDOW flag for background processes 1 week ago
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/process/windows/SDL_windowsprocess.c

+ 4 - 3
src/process/windows/SDL_windowsprocess.c

@@ -304,6 +304,7 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
         if (stderr_option == SDL_PROCESS_STDIO_INHERITED) {
             stderr_option = SDL_PROCESS_STDIO_NULL;
         }
+        creation_flags |= CREATE_NO_WINDOW;
     }
 
     switch (stdin_option) {
@@ -329,7 +330,7 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
         startup_info.hStdInput = stdin_pipe[READ_END];
         break;
     case SDL_PROCESS_STDIO_NULL:
-        startup_info.hStdInput = CreateFile(TEXT("\\\\.\\NUL"), GENERIC_ALL, 0, &security_attributes, OPEN_EXISTING, 0, NULL);
+        startup_info.hStdInput = CreateFile(TEXT("\\\\.\\NUL"), (GENERIC_READ | GENERIC_WRITE), 0, &security_attributes, OPEN_EXISTING, 0, NULL);
         break;
     case SDL_PROCESS_STDIO_INHERITED:
     default:
@@ -366,7 +367,7 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
         startup_info.hStdOutput = stdout_pipe[WRITE_END];
         break;
     case SDL_PROCESS_STDIO_NULL:
-        startup_info.hStdOutput = CreateFile(TEXT("\\\\.\\NUL"), GENERIC_ALL, 0, &security_attributes, OPEN_EXISTING, 0, NULL);
+        startup_info.hStdOutput = CreateFile(TEXT("\\\\.\\NUL"), (GENERIC_READ | GENERIC_WRITE), 0, &security_attributes, OPEN_EXISTING, 0, NULL);
         break;
     case SDL_PROCESS_STDIO_INHERITED:
     default:
@@ -412,7 +413,7 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
             startup_info.hStdError = stderr_pipe[WRITE_END];
             break;
         case SDL_PROCESS_STDIO_NULL:
-            startup_info.hStdError = CreateFile(TEXT("\\\\.\\NUL"), GENERIC_ALL, 0, &security_attributes, OPEN_EXISTING, 0, NULL);
+            startup_info.hStdError = CreateFile(TEXT("\\\\.\\NUL"), (GENERIC_READ | GENERIC_WRITE), 0, &security_attributes, OPEN_EXISTING, 0, NULL);
             break;
         case SDL_PROCESS_STDIO_INHERITED:
         default: