From 2843de3f25bc08b8344b3e79f4e9ff523b0987e9 Mon Sep 17 00:00:00 2001 From: Juan Lang <juan_lang@yahoo.com> Date: Mon, 5 Apr 2004 22:22:00 +0000 Subject: [PATCH] Get rid of a few pointless A/W conversions. --- dlls/shell32/folders.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index 35cdd5e1cbb..51a4de175fd 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -186,16 +186,19 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( /* my computer and other shell extensions */ else if ((riid = _ILGetGUIDPointer(pSimplePidl))) { - char xriid[50]; + static WCHAR fmt[] = { 'C','L','S','I','D','\\','{','%','0','8','l','x', + '-','%','0','4','x','-','%','0','4','x','-','%','0','2','x', + '%','0','2','x','-','%','0','2','x', '%','0','2','x', '%','0','2','x', + '%','0','2','x','%','0','2','x','%','0','2','x','}',0 }; + WCHAR xriid[50]; - sprintf(xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + sprintfW(xriid, fmt, riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]); - if (HCR_GetDefaultIconA(xriid, sTemp, MAX_PATH, &dwNr)) + if (HCR_GetDefaultIconW(xriid, szIconFile, cchMax, &dwNr)) { - MultiByteToWideChar(CP_ACP, 0, sTemp, -1, szIconFile, cchMax); *piIndex = dwNr; } else @@ -207,9 +210,10 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( else if (_ILIsDrive (pSimplePidl)) { - if (HCR_GetDefaultIconA("Drive", sTemp, MAX_PATH, &dwNr)) + static WCHAR drive[] = { 'D','r','i','v','e',0 }; + + if (HCR_GetDefaultIconW(drive, szIconFile, cchMax, &dwNr)) { - MultiByteToWideChar(CP_ACP, 0, sTemp, -1, szIconFile, cchMax); *piIndex = dwNr; } else @@ -220,11 +224,9 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( } else if (_ILIsFolder (pSimplePidl)) { - if (HCR_GetDefaultIconA("Folder", sTemp, MAX_PATH, &dwNr)) - { - MultiByteToWideChar(CP_ACP, 0, sTemp, -1, szIconFile, cchMax); - } - else + static WCHAR folder[] = { 'F','o','l','d','e','r',0 }; + + if (!HCR_GetDefaultIconW(folder, szIconFile, cchMax, &dwNr)) { lstrcpynW(szIconFile, swShell32Name, cchMax); dwNr = 3; -- GitLab