[3/6] shell32/tests: Check the child process exit code and close the process handle.
Francois Gouget
fgouget at codeweavers.com
Thu Jan 28 17:19:42 CST 2016
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
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 25aa5d4..a201159 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)
--
2.7.0.rc3
More information about the wine-patches
mailing list