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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 8 10:09:21 CST 2016


Module: wine
Branch: master
Commit: f4130de33e90321cd07893295e41ef757cb9974d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4130de33e90321cd07893295e41ef757cb9974d

Author: Francois Gouget <fgouget at free.fr>
Date:   Mon Feb  8 05:24:45 2016 +0100

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

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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");




More information about the wine-cvs mailing list