From 5c08d6b6c59326d7e41ef7b9dbea73acebf899b9 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 11 May 2014 18:43:51 +0000 Subject: [PATCH] [SHELL32] - attempt to resolve an widechar/multibyte mismatch in the applet name - fixes opening the mouse applet if the translated name contains a non ASCII character svn path=/trunk/; revision=63237 --- reactos/dll/win32/shell32/folders/cpanel.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/shell32/folders/cpanel.cpp b/reactos/dll/win32/shell32/folders/cpanel.cpp index 47ec5b670c3..cf0c9cf448d 100644 --- a/reactos/dll/win32/shell32/folders/cpanel.cpp +++ b/reactos/dll/win32/shell32/folders/cpanel.cpp @@ -852,9 +852,14 @@ HRESULT WINAPI CControlPanelFolder::ExecuteFromIdList(LPCITEMIDLIST pidl) } /* Build control panel applet cmd - Note: we passes applet name to Control_RunDLL to distinguish between applets in one .cpl file */ + Note: we pass the applet name to Control_RunDLL to distinguish between multiple applets in one .cpl file */ WCHAR wszCmd[2*MAX_PATH]; - StringCbPrintfW(wszCmd, sizeof(wszCmd), L"rundll32 shell32.dll,Control_RunDLL \"%hs\",\"%hs\"", pCPanel->szName, pCPanel->szName + pCPanel->offsDispName); + WCHAR wszAppletName[MAX_PATH]; + + if(!MultiByteToWideChar(CP_ACP, 0, pCPanel->szName + pCPanel->offsDispName, -1, wszAppletName, MAX_PATH)) + return E_FAIL; + + StringCbPrintfW(wszCmd, sizeof(wszCmd), L"rundll32 shell32.dll,Control_RunDLL \"%hs\",\"%ls\"", pCPanel->szName, wszAppletName); /* Start the applet */ TRACE("Run cpl %ls\n", wszCmd);