From dacdd8039022dd5134a17a125e2c07c294f060e1 Mon Sep 17 00:00:00 2001 From: Whindmar Saksit Date: Fri, 19 Apr 2024 23:12:56 +0200 Subject: [PATCH] [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 bf2cec186cc (#5411) CORE-19506 --- dll/shellext/zipfldr/zipfldr.cpp | 9 +++++++-- dll/shellext/zipfldr/zipfldr.spec | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dll/shellext/zipfldr/zipfldr.cpp b/dll/shellext/zipfldr/zipfldr.cpp index 04f7e73d995..fc1cd5682c7 100644 --- a/dll/shellext/zipfldr/zipfldr.cpp +++ b/dll/shellext/zipfldr/zipfldr.cpp @@ -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; } diff --git a/dll/shellext/zipfldr/zipfldr.spec b/dll/shellext/zipfldr/zipfldr.spec index 8b689b5e122..f9f0c5d92f9 100644 --- a/dll/shellext/zipfldr/zipfldr.spec +++ b/dll/shellext/zipfldr/zipfldr.spec @@ -2,4 +2,4 @@ @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() -@ stdcall RouteTheCall(ptr ptr wstr long) \ No newline at end of file +@ stdcall RouteTheCallW(ptr ptr wstr long)