shell32/tests: Fix a ShellExecute() race condition.

Francois Gouget fgouget at free.fr
Sun Feb 7 22:24:45 CST 2016


On Windows XP SP1 a ShellExecute() call that is supposed to fail succeeds instead. This means the child process is started but ShellExecute() returns without waiting for it, resulting in a race condition on the child's results file. So use our shell_execute_ex() wrapper instead as it always waits for the child process.

Signed-off-by: Francois Gouget <fgouget at free.fr>
---
 dlls/shell32/tests/shlexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 9d57ca9..259ba06 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -1844,7 +1844,8 @@ static void test_fileurls(void)
         return;
     }
 
-    rc = (INT_PTR)ShellExecuteA(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL);
+    rc = shell_execute_ex(SEE_MASK_FLAG_NO_UI, NULL,
+                          "file:///nosuchfile.shlexec", NULL, NULL, NULL);
     if (rc > 32)
     {
         win_skip("shell32 is too old (likely < 4.72). Skipping the file URL tests\n");
-- 
2.7.0




More information about the wine-patches mailing list