Module: wine Branch: master Commit: 8d51235dbeca036f91d6b6022944894f6abe962b URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d51235dbeca036f91d6b60229...
Author: Francois Gouget fgouget@codeweavers.com Date: Fri Feb 28 19:50:32 2014 +0100
xcopy/tests: Fix the test in case stdin has been redirected.
---
programs/xcopy/tests/xcopy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/programs/xcopy/tests/xcopy.c b/programs/xcopy/tests/xcopy.c index 4cd6b1a..ec7683a 100644 --- a/programs/xcopy/tests/xcopy.c +++ b/programs/xcopy/tests/xcopy.c @@ -31,7 +31,11 @@ static DWORD runcmd(const char* cmd) /* Create a writable copy for CreateProcessA() */ wcmd = HeapAlloc(GetProcessHeap(), 0, strlen(cmd) + 1); strcpy(wcmd, cmd); - rc = CreateProcessA(NULL, wcmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + + /* On Windows 2003 and older, xcopy.exe fails if stdin is not a console + * handle, even with '/I /Y' options. + */ + rc = CreateProcessA(NULL, wcmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi); HeapFree(GetProcessHeap(), 0, wcmd); if (!rc) return 260;