Author: sginsberg
Date: Sun Dec 21 02:30:41 2008
New Revision: 38228
URL:
http://svn.reactos.org/svn/reactos?rev=38228&view=rev
Log:
- _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
Modified:
trunk/reactos/lib/sdk/crt/stdio/popen.c
Modified: trunk/reactos/lib/sdk/crt/stdio/popen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/popen.c?…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/popen.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/popen.c [iso-8859-1] Sun Dec 21 02:30:41 2008
@@ -77,13 +77,18 @@
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,