[SHELL32] ShellExecuteW must call ShellExecuteExW (#7587)

Adds the DDEWAIT/NOASYNC flag unless compatibility info says otherwise.

CORE-19952
This commit is contained in:
Whindmar Saksit 2024-12-29 15:22:30 +01:00 committed by GitHub
parent a9e7d67427
commit fd41270d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -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;
}

View file

@ -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.