Module: wine
Branch: master
Commit: 30230fae5f74bf0f2233f4b6eb9b09f086a21bc4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=30230fae5f74bf0f2233f4b6e…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Fri Jan 29 00:19:42 2016 +0100
shell32/tests: Check the child process exit code and close the process handle.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/shell32/tests/shlexec.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index a950cde..0630815 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -26,8 +26,6 @@
* - ShellExecute("foo.shlexec") with no path should work if foo.shlexec is
* in the PATH
* - test associations that use %l, %L or "%1" instead of %1
- * - we may want to test ShellExecuteEx() instead of ShellExecute()
- * and then we could also check its return value
* - ShellExecuteEx() also calls SetLastError() with meaningful values which
* we could check
*/
@@ -597,13 +595,20 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
if (rc > 32)
{
- int wait_rc;
+ DWORD wait_rc, rc;
if (sei.hProcess!=NULL)
{
wait_rc=WaitForSingleObject(sei.hProcess, 5000);
okShell_(file, line)(wait_rc==WAIT_OBJECT_0,
"WaitForSingleObject(hProcess) returned %d\n",
wait_rc);
+ wait_rc = GetExitCodeProcess(sei.hProcess, &rc);
+ okShell_(file, line)(wait_rc, "GetExitCodeProcess() failed le=%u\n", GetLastError());
+ if (!_todo_wait)
+ okShell_(file, line)(rc == 0, "child returned %u\n", rc);
+ else todo_wine
+ okShell_(file, line)(rc == 0, "child returned %u\n", rc);
+ CloseHandle(sei.hProcess);
}
wait_rc=WaitForSingleObject(hEvent, 5000);
if (!_todo_wait)