https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd41270d6db3bcd2fafe84d49061a4f5f1874428

commit fd41270d6db3bcd2fafe84d49061a4f5f1874428
Author:     Whindmar Saksit <whinds...@proton.me>
AuthorDate: Sun Dec 29 15:22:30 2024 +0100
Commit:     GitHub <nore...@github.com>
CommitDate: Sun Dec 29 15:22:30 2024 +0100

    [SHELL32] ShellExecuteW must call ShellExecuteExW (#7587)
    
    Adds the DDEWAIT/NOASYNC flag unless compatibility info says otherwise.
    
    CORE-19952
---
 dll/win32/shell32/shlexec.cpp       | 9 +++++----
 sdk/include/reactos/shlwapi_undoc.h | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp
index 68befd32925..6af8844632e 100644
--- a/dll/win32/shell32/shlexec.cpp
+++ b/dll/win32/shell32/shlexec.cpp
@@ -2341,6 +2341,8 @@ HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpVerb, 
LPCSTR lpFile,
     sei.dwHotKey = 0;
     sei.hProcess = 0;
 
+    if (!(SHGetAppCompatFlags(SHACF_WIN95SHLEXEC) & SHACF_WIN95SHLEXEC))
+        sei.fMask |= SEE_MASK_NOASYNC;
     ShellExecuteExA(&sei);
     return sei.hInstApp;
 }
@@ -2479,9 +2481,6 @@ ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
 
 /*************************************************************************
  * ShellExecuteW            [SHELL32.294]
- * from shellapi.h
- * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpVerb,
- * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
  */
 HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile,
                                LPCWSTR lpParameters, LPCWSTR lpDirectory, INT 
nShowCmd)
@@ -2503,7 +2502,9 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, 
LPCWSTR lpFile,
     sei.dwHotKey = 0;
     sei.hProcess = 0;
 
-    SHELL_execute(&sei, SHELL_ExecuteW);
+    if (!(SHGetAppCompatFlags(SHACF_WIN95SHLEXEC) & SHACF_WIN95SHLEXEC))
+        sei.fMask |= SEE_MASK_NOASYNC;
+    ShellExecuteExW(&sei);
     return sei.hInstApp;
 }
 
diff --git a/sdk/include/reactos/shlwapi_undoc.h 
b/sdk/include/reactos/shlwapi_undoc.h
index def0725cdd2..c3ffe8c93df 100644
--- a/sdk/include/reactos/shlwapi_undoc.h
+++ b/sdk/include/reactos/shlwapi_undoc.h
@@ -364,6 +364,9 @@ IContextMenu_Invoke(
 
 DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid);
 
+#define SHACF_WIN95SHLEXEC 0x00000200 /* Geoff Chappell */
+DWORD WINAPI SHGetAppCompatFlags(DWORD dwMask);
+
 /*
  * HACK! These functions are conflicting with <shobjidl.h> inline functions...
  * We provide a macro option SHLWAPI_ISHELLFOLDER_HELPERS for using these 
functions.

Reply via email to