[SHELL32] Automatically add the .exe extension for App Paths in ShellExecuteEx. Patch...
authorMark Jansen <mark.jansen@reactos.org>
Wed, 9 Nov 2016 22:18:33 +0000 (22:18 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Wed, 9 Nov 2016 22:18:33 +0000 (22:18 +0000)
svn path=/trunk/; revision=73182

reactos/dll/win32/shell32/shlexec.cpp

index f850ead..94369d6 100644 (file)
@@ -576,7 +576,15 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env)
     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);