mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
- _popen/_wpopen: When overriding the default standard input/output handles, don't set 2/3 to 0 -- use the standard handles instead (fix by kjk). Fixes the 'CsrGetObject returning invalid handle' errors
svn path=/trunk/; revision=38228
This commit is contained in:
parent
9ebb5e3555
commit
0fe3a6fdff
1 changed files with 5 additions and 0 deletions
|
@ -77,14 +77,19 @@ FILE *_tpopen (const _TCHAR *cm, const _TCHAR *md) /* program name, pipe mode */
|
|||
StartupInfo.cb = sizeof(STARTUPINFO);
|
||||
|
||||
if (*md == 'r' ) {
|
||||
StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
StartupInfo.hStdOutput = hWritePipe;
|
||||
StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
|
||||
}
|
||||
else if ( *md == 'w' ) {
|
||||
StartupInfo.hStdInput = hReadPipe;
|
||||
StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
|
||||
}
|
||||
|
||||
if (StartupInfo.dwFlags & STARTF_USESTDHANDLES)
|
||||
StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
result = CreateProcess(szComSpec,
|
||||
szCmdLine,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue