Author: mjansen
Date: Wed Nov 9 22:18:33 2016
New Revision: 73182
URL:
http://svn.reactos.org/svn/reactos?rev=73182&view=rev
Log:
[SHELL32] Automatically add the .exe extension for App Paths in ShellExecuteEx. Patch by
Yaroslav Veremenko. CORE-12049
Modified:
trunk/reactos/dll/win32/shell32/shlexec.cpp
Modified: trunk/reactos/dll/win32/shell32/shlexec.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlexec.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] Wed Nov 9 22:18:33 2016
@@ -576,7 +576,15 @@
wcscpy(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App
Paths\\");
wcscat(buffer, szName);
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
- if (res) goto end;
+ if (res)
+ {
+ // Add ".exe" extension, if extension does not exists
+ if (PathAddExtensionW(buffer, wszExe))
+ {
+ res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
+ }
+ if (res) goto end;
+ }
len = MAX_PATH * sizeof(WCHAR);
res = RegQueryValueW(hkApp, NULL, lpResult, &len);