X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=83fd4bdcd2c32c6e0cc6efc06e065692c7b3c139;hb=4d04bc8a6c2d5e410d519b25164613c5e5c2d160;hp=223a6f873a5583db9bc20b57e3c1d056659665b6;hpb=444104622a627bfee533f8828b35f2acc68c8579;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index 223a6f8..83fd4bd 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -8853,6 +8853,37 @@ IDLE_PRIORITY_CLASS 0x00000040 return 0x00000040; } +void RunCommand(char *cmdLine) +{ + /* Now create the child process. */ + STARTUPINFO siStartInfo; + PROCESS_INFORMATION piProcInfo; + + siStartInfo.cb = sizeof(STARTUPINFO); + siStartInfo.lpReserved = NULL; + siStartInfo.lpDesktop = NULL; + siStartInfo.lpTitle = NULL; + siStartInfo.dwFlags = STARTF_USESTDHANDLES; + siStartInfo.cbReserved2 = 0; + siStartInfo.lpReserved2 = NULL; + siStartInfo.hStdInput = NULL; + siStartInfo.hStdOutput = NULL; + siStartInfo.hStdError = NULL; + + CreateProcess(NULL, + cmdLine, /* command line */ + NULL, /* process security attributes */ + NULL, /* primary thread security attrs */ + TRUE, /* handles are inherited */ + DETACHED_PROCESS|CREATE_NEW_PROCESS_GROUP, + NULL, /* use parent's environment */ + NULL, + &siStartInfo, /* STARTUPINFO pointer */ + &piProcInfo); /* receives PROCESS_INFORMATION */ + + CloseHandle(piProcInfo.hThread); +} + /* Start a child process running the given program. The process's standard output can be read from "from", and its standard input can be written to "to".