[ZIPFLDR] Fix ShellExecute opening a .zip (#6714)

ShellExecute on a .zip file fails because the command in the registry
uses rundll32 that passes in an ANSI string, which is the default for
exported functions without a W suffix.

- This should also fix RAPPS not being able to open downloaded .zip files
- I made it use the full path to Explorer for good measure

Fixes regression introduced by 0.4.15-dev-6343-g bf2cec186c (#5411)

CORE-19506
This commit is contained in:
Whindmar Saksit 2024-04-19 23:12:56 +02:00 committed by GitHub
parent 5f3554a40c
commit dacdd80390
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -174,12 +174,17 @@ STDAPI DllUnregisterServer()
EXTERN_C
BOOL WINAPI
RouteTheCall(IN HWND hWndOwner, IN HINSTANCE hInstance, IN PCWSTR lpStringArg, IN INT Show)
RouteTheCallW(IN HWND hWndOwner, IN HINSTANCE hInstance, IN PCWSTR lpStringArg, IN INT Show)
{
CStringW path = lpStringArg;
PathRemoveBlanksW(path.GetBuffer());
path.ReleaseBuffer();
path = L"\"" + path + L"\"";
ShellExecuteW(NULL, L"open", L"explorer.exe", path.GetString(), NULL, SW_SHOWNORMAL);
WCHAR app[MAX_PATH];
GetWindowsDirectoryW(app, _countof(app));
PathAppendW(app, L"explorer.exe");
ShellExecuteW(NULL, L"open", app, path.GetString(), NULL, Show ? Show : SW_SHOWNORMAL);
return TRUE;
}

View File

@ -2,4 +2,4 @@
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
@ stdcall RouteTheCall(ptr ptr wstr long)
@ stdcall RouteTheCallW(ptr ptr wstr long)