Index: dll/win32/shell32/folders/desktop.cpp =================================================================== --- dll/win32/shell32/folders/desktop.cpp (revision 58878) +++ dll/win32/shell32/folders/desktop.cpp (working copy) @@ -803,20 +803,8 @@ if (SUCCEEDED(hr)) { - /* Win9x always returns ANSI strings, NT always returns Unicode strings */ - if (GetVersion() & 0x80000000) - { - strRet->uType = STRRET_CSTR; - if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->cStr, MAX_PATH, - NULL, NULL)) - strRet->cStr[0] = '\0'; - CoTaskMemFree(pszPath); - } - else - { - strRet->uType = STRRET_WSTR; - strRet->pOleStr = pszPath; - } + strRet->uType = STRRET_WSTR; + strRet->pOleStr = pszPath; } else CoTaskMemFree(pszPath); Index: dll/win32/shell32/folders/fs.cpp =================================================================== --- dll/win32/shell32/folders/fs.cpp (revision 58878) +++ dll/win32/shell32/folders/fs.cpp (working copy) @@ -629,21 +629,10 @@ } else hr = SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, pszPath, MAX_PATH); - if (SUCCEEDED(hr)) { - /* Win9x always returns ANSI strings, NT always returns Unicode strings */ - if (GetVersion() & 0x80000000) - { - strRet->uType = STRRET_CSTR; - if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->cStr, MAX_PATH, - NULL, NULL)) - strRet->cStr[0] = '\0'; - CoTaskMemFree(pszPath); - } - else - { - strRet->uType = STRRET_WSTR; - strRet->pOleStr = pszPath; - } + if (SUCCEEDED(hr)) + { + strRet->uType = STRRET_WSTR; + strRet->pOleStr = pszPath; } else CoTaskMemFree(pszPath); Index: dll/win32/shell32/iconcache.cpp =================================================================== --- dll/win32/shell32/iconcache.cpp (revision 58878) +++ dll/win32/shell32/iconcache.cpp (working copy) @@ -850,9 +850,8 @@ } EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc) -{ if( SHELL_OsIsUnicode()) - return Shell_GetCachedImageIndexW((LPCWSTR)szPath, nIndex, bSimulateDoc); - return Shell_GetCachedImageIndexA((LPCSTR)szPath, nIndex, bSimulateDoc); +{ + return Shell_GetCachedImageIndexW((LPCWSTR)szPath, nIndex, bSimulateDoc); } /************************************************************************* Index: dll/win32/shell32/pidl.cpp =================================================================== --- dll/win32/shell32/pidl.cpp (revision 58878) +++ dll/win32/shell32/pidl.cpp (working copy) @@ -51,23 +51,6 @@ * RETURNS * True if the display name could be retrieved successfully, False otherwise */ -static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type) -{ - BOOL ret = FALSE; - WCHAR wPath[MAX_PATH]; - - TRACE("%p %p %p %d\n", psf, pidl, path, type); - - if (!pidl || !path) - return FALSE; - - ret = ILGetDisplayNameExW(psf, pidl, wPath, type); - WideCharToMultiByte(CP_ACP, 0, wPath, -1, path, MAX_PATH, NULL, NULL); - TRACE("%p %p %s\n", psf, pidl, debugstr_a(path)); - - return ret; -} - BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type) { CComPtr psfParent; @@ -145,9 +128,7 @@ { TRACE_(shell)("%p %p %p %d\n", psf, pidl, path, type); - if (SHELL_OsIsUnicode()) - return ILGetDisplayNameExW(psf, pidl, (LPWSTR)path, type); - return ILGetDisplayNameExA(psf, pidl, (LPSTR)path, type); + return ILGetDisplayNameExW(psf, pidl, (LPWSTR)path, type); } /************************************************************************* @@ -157,9 +138,7 @@ { TRACE_(shell)("%p %p\n", pidl, path); - if (SHELL_OsIsUnicode()) - return ILGetDisplayNameExW(NULL, pidl, (LPWSTR)path, ILGDN_FORPARSING); - return ILGetDisplayNameExA(NULL, pidl, (LPSTR)path, ILGDN_FORPARSING); + return ILGetDisplayNameExW(NULL, pidl, (LPWSTR)path, ILGDN_FORPARSING); } /************************************************************************* @@ -386,9 +365,7 @@ EXTERN_C HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * attributes) { - if ( SHELL_OsIsUnicode()) - return SHILCreateFromPathW ((LPCWSTR)path, ppidl, attributes); - return SHILCreateFromPathA ((LPCSTR)path, ppidl, attributes); + return SHILCreateFromPathW ((LPCWSTR)path, ppidl, attributes); } /************************************************************************* @@ -932,9 +909,7 @@ */ EXTERN_C LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path) { - if ( SHELL_OsIsUnicode()) - return ILCreateFromPathW ((LPCWSTR)path); - return ILCreateFromPathA ((LPCSTR)path); + return ILCreateFromPathW ((LPCWSTR)path); } /************************************************************************* @@ -1050,9 +1025,7 @@ EXTERN_C LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW(LPCVOID lpszPath) { - if ( SHELL_OsIsUnicode()) - return SHSimpleIDListFromPathW ((LPCWSTR)lpszPath); - return SHSimpleIDListFromPathA ((LPCSTR)lpszPath); + return SHSimpleIDListFromPathW ((LPCWSTR)lpszPath); } /************************************************************************* Index: dll/win32/shell32/shell32_main.h =================================================================== --- dll/win32/shell32/shell32_main.h (revision 58878) +++ dll/win32/shell32/shell32_main.h (working copy) @@ -132,12 +132,6 @@ void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState); -static BOOL __inline SHELL_OsIsUnicode(void) -{ - /* if high-bit of version is 0, we are emulating NT */ - return !(GetVersion() & 0x80000000); -} - #define __SHFreeAndNil(ptr) \ {\ SHFree(*ptr); \ Index: dll/win32/shell32/shellole.cpp =================================================================== --- dll/win32/shell32/shellole.cpp (revision 58878) +++ dll/win32/shell32/shellole.cpp (working copy) @@ -207,9 +207,7 @@ EXTERN_C DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id) { - if (SHELL_OsIsUnicode()) - return SHCLSIDFromStringW ((LPCWSTR)clsid, id); - return SHCLSIDFromStringA ((LPCSTR)clsid, id); + return SHCLSIDFromStringW ((LPCWSTR)clsid, id); } /************************************************************************* Index: dll/win32/shell32/shellord.cpp =================================================================== --- dll/win32/shell32/shellord.cpp (revision 58878) +++ dll/win32/shell32/shellord.cpp (working copy) @@ -120,9 +120,7 @@ */ EXTERN_C DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) { - if (SHELL_OsIsUnicode()) - return ParseFieldW((LPCWSTR)src, nField, (LPWSTR)dst, len); - return ParseFieldA((LPCSTR)src, nField, (LPSTR)dst, len); + return ParseFieldW((LPCWSTR)src, nField, (LPWSTR)dst, len); } /************************************************************************* @@ -1588,9 +1586,7 @@ */ DWORD WINAPI DoEnvironmentSubstAW(LPVOID x, UINT y) { - if (SHELL_OsIsUnicode()) - return DoEnvironmentSubstW((LPWSTR)x, y); - return DoEnvironmentSubstA((LPSTR)x, y); + return DoEnvironmentSubstW((LPWSTR)x, y); } /************************************************************************* Index: dll/win32/shell32/shellpath.cpp =================================================================== --- dll/win32/shell32/shellpath.cpp (revision 58878) +++ dll/win32/shell32/shellpath.cpp (working copy) @@ -39,9 +39,7 @@ LPVOID lpszPath1, LPCVOID lpszPath2) { - if (SHELL_OsIsUnicode()) - return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2); - return PathAppendA((LPSTR)lpszPath1, (LPCSTR)lpszPath2); + return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2); } /************************************************************************* @@ -49,27 +47,10 @@ */ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive) { - if(SHELL_OsIsUnicode()) - return PathBuildRootW((LPWSTR)lpszPath, drive); - return PathBuildRootA((LPSTR)lpszPath, drive); + return PathBuildRootW((LPWSTR)lpszPath, drive); } /************************************************************************* - * PathGetExtensionA [internal] - * - * NOTES - * exported by ordinal - * return value points to the first char after the dot - */ -static LPSTR PathGetExtensionA(LPCSTR lpszPath) -{ - TRACE("(%s)\n",lpszPath); - - lpszPath = PathFindExtensionA(lpszPath); - return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath); -} - -/************************************************************************* * PathGetExtensionW [internal] */ static LPWSTR PathGetExtensionW(LPCWSTR lpszPath) @@ -82,6 +63,9 @@ /************************************************************************* * SHPathGetExtension [SHELL32.158] + * NOTES + * exported by ordinal + * return value points to the first char after the dot */ EXTERN_C LPVOID WINAPI SHPathGetExtensionW(LPCWSTR lpszPath, DWORD void1, DWORD void2) { @@ -93,9 +77,7 @@ */ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) { - if (SHELL_OsIsUnicode()) - return PathRemoveFileSpecW((LPWSTR)lpszPath); - return PathRemoveFileSpecA((LPSTR)lpszPath); + return PathRemoveFileSpecW((LPWSTR)lpszPath); } /* @@ -103,21 +85,6 @@ */ /************************************************************************* - * PathGetShortPathA [internal] - */ -static void PathGetShortPathA(LPSTR pszPath) -{ - CHAR path[MAX_PATH]; - - TRACE("%s\n", pszPath); - - if (GetShortPathNameA(pszPath, path, MAX_PATH)) - { - lstrcpyA(pszPath, path); - } -} - -/************************************************************************* * PathGetShortPathW [internal] */ static void PathGetShortPathW(LPWSTR pszPath) @@ -137,9 +104,7 @@ */ EXTERN_C VOID WINAPI PathGetShortPathAW(LPVOID pszPath) { - if(SHELL_OsIsUnicode()) - PathGetShortPathW((LPWSTR)pszPath); - PathGetShortPathA((LPSTR)pszPath); + PathGetShortPathW((LPWSTR)pszPath); } /* @@ -151,30 +116,10 @@ */ BOOL WINAPI PathIsRootAW(LPCVOID lpszPath) { - if (SHELL_OsIsUnicode()) - return PathIsRootW((LPWSTR)lpszPath); - return PathIsRootA((LPSTR)lpszPath); + return PathIsRootW((LPWSTR)lpszPath); } /************************************************************************* - * PathIsExeA [internal] - */ -static BOOL PathIsExeA (LPCSTR lpszPath) -{ - LPCSTR lpszExtension = PathGetExtensionA(lpszPath); - int i; - static const char * const lpszExtensions[] = - {"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL }; - - TRACE("path=%s\n",lpszPath); - - for(i=0; lpszExtensions[i]; i++) - if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE; - - return FALSE; -} - -/************************************************************************* * PathIsExeW [internal] */ BOOL PathIsExeW (LPCWSTR lpszPath) @@ -199,9 +144,7 @@ */ BOOL WINAPI PathIsExeAW (LPCVOID path) { - if (SHELL_OsIsUnicode()) - return PathIsExeW ((LPWSTR)path); - return PathIsExeA((LPSTR)path); + return PathIsExeW ((LPWSTR)path); } /************************************************************************* @@ -209,9 +152,7 @@ */ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath) { - if (SHELL_OsIsUnicode()) - return PathFileExistsW ((LPWSTR)lpszPath); - return PathFileExistsA ((LPSTR)lpszPath); + return PathFileExistsW ((LPWSTR)lpszPath); } /************************************************************************* @@ -219,9 +160,7 @@ */ BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2) { - if (SHELL_OsIsUnicode()) - return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2); - return PathIsSameRootA((LPCSTR)lpszPath1, (LPCSTR)lpszPath2); + return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2); } /************************************************************************* @@ -253,31 +192,13 @@ */ EXTERN_C BOOL WINAPI IsLFNDriveAW(LPCVOID lpszPath) { - if (SHELL_OsIsUnicode()) - return IsLFNDriveW((LPCWSTR)lpszPath); - return IsLFNDriveA((LPCSTR)lpszPath); + return IsLFNDriveW((LPCWSTR)lpszPath); } /* ########## Creating Something Unique ########## */ /************************************************************************* - * PathMakeUniqueNameA [internal] - */ -static BOOL PathMakeUniqueNameA( - LPSTR lpszBuffer, - DWORD dwBuffSize, - LPCSTR lpszShortName, - LPCSTR lpszLongName, - LPCSTR lpszPathName) -{ - FIXME("%p %u %s %s %s stub\n", - lpszBuffer, dwBuffSize, debugstr_a(lpszShortName), - debugstr_a(lpszLongName), debugstr_a(lpszPathName)); - return TRUE; -} - -/************************************************************************* * PathMakeUniqueNameW [internal] */ static BOOL PathMakeUniqueNameW( @@ -303,9 +224,7 @@ LPCVOID lpszLongName, LPCVOID lpszPathName) { - if (SHELL_OsIsUnicode()) - return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName); - return PathMakeUniqueNameA((LPSTR)lpszBuffer, dwBuffSize, (LPCSTR)lpszShortName, (LPCSTR)lpszLongName, (LPCSTR)lpszPathName); + return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName); } /************************************************************************* @@ -341,79 +260,36 @@ DWORD rc = 0; int length = 0; - if (SHELL_OsIsUnicode()) - { - LPWSTR p = lpszFileW; + LPWSTR p = lpszFileW; - TRACE("Cleanup %s\n",debugstr_w(lpszFileW)); + TRACE("Cleanup %s\n",debugstr_w(lpszFileW)); - if (lpszPathW) - length = wcslen(lpszPathW); + if (lpszPathW) + length = wcslen(lpszPathW); - while (*p) + while (*p) + { + int gct = PathGetCharTypeW(*p); + if (gct == GCT_INVALID || gct == GCT_WILD || gct == GCT_SEPARATOR) { - int gct = PathGetCharTypeW(*p); - if (gct == GCT_INVALID || gct == GCT_WILD || gct == GCT_SEPARATOR) - { - lpszFileW[i]='-'; - rc |= PCS_REPLACEDCHAR; - } - else - lpszFileW[i]=*p; - i++; - p++; - if (length + i == MAX_PATH) - { - rc |= PCS_FATAL | PCS_PATHTOOLONG; - break; - } + lpszFileW[i]='-'; + rc |= PCS_REPLACEDCHAR; } - lpszFileW[i]=0; - } - else - { - LPSTR lpszFileA = (LPSTR)lpszFileW; - LPCSTR lpszPathA = (LPCSTR)lpszPathW; - LPSTR p = lpszFileA; - - TRACE("Cleanup %s\n",debugstr_a(lpszFileA)); - - if (lpszPathA) - length = strlen(lpszPathA); - - while (*p) + else + lpszFileW[i]=*p; + i++; + p++; + if (length + i == MAX_PATH) { - int gct = PathGetCharTypeA(*p); - if (gct == GCT_INVALID || gct == GCT_WILD || gct == GCT_SEPARATOR) - { - lpszFileA[i]='-'; - rc |= PCS_REPLACEDCHAR; - } - else - lpszFileA[i]=*p; - i++; - p++; - if (length + i == MAX_PATH) - { - rc |= PCS_FATAL | PCS_PATHTOOLONG; - break; - } + rc |= PCS_FATAL | PCS_PATHTOOLONG; + break; } - lpszFileA[i]=0; } + lpszFileW[i]=0; return rc; } /************************************************************************* - * PathQualifyA [SHELL32] - */ -static BOOL PathQualifyA(LPCSTR pszPath) -{ - FIXME("%s\n",pszPath); - return 0; -} - -/************************************************************************* * PathQualifyW [SHELL32] */ static BOOL PathQualifyW(LPCWSTR pszPath) @@ -427,25 +303,10 @@ */ BOOL WINAPI PathQualifyAW(LPCVOID pszPath) { - if (SHELL_OsIsUnicode()) - return PathQualifyW((LPCWSTR)pszPath); - return PathQualifyA((LPCSTR)pszPath); + return PathQualifyW((LPCWSTR)pszPath); } /************************************************************************* - * PathResolveA [SHELL32.51] - */ -static BOOL PathResolveA( - LPSTR lpszPath, - LPCSTR *alpszPaths, - DWORD dwFlags) -{ - FIXME("(%s,%p,0x%08x),stub!\n", - lpszPath, *alpszPaths, dwFlags); - return 0; -} - -/************************************************************************* * PathResolveW [SHELL32] */ static BOOL PathResolveW( @@ -466,28 +327,10 @@ LPCVOID *alpszPaths, DWORD dwFlags) { - if (SHELL_OsIsUnicode()) - return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags); - return PathResolveA((LPSTR)lpszPath, (LPCSTR *)alpszPaths, dwFlags); + return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags); } /************************************************************************* -* PathProcessCommandA [SHELL32.653] -*/ -static LONG PathProcessCommandA ( - LPCSTR lpszPath, - LPSTR lpszBuff, - DWORD dwBuffSize, - DWORD dwFlags) -{ - FIXME("%s %p 0x%04x 0x%04x stub\n", - lpszPath, lpszBuff, dwBuffSize, dwFlags); - if(!lpszPath) return -1; - if(lpszBuff) strcpy(lpszBuff, lpszPath); - return strlen(lpszPath); -} - -/************************************************************************* * PathProcessCommandW */ static LONG PathProcessCommandW ( @@ -512,9 +355,7 @@ DWORD dwBuffSize, DWORD dwFlags) { - if (SHELL_OsIsUnicode()) - return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags); - return PathProcessCommandA((LPCSTR)lpszPath, (LPSTR)lpszBuff, dwBuffSize, dwFlags); + return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags); } /* Index: dll/win32/shell32/shellstring.cpp =================================================================== --- dll/win32/shell32/shellstring.cpp (revision 58878) +++ dll/win32/shell32/shellstring.cpp (working copy) @@ -108,10 +108,7 @@ */ EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) { - if(SHELL_OsIsUnicode()) - return StrRetToStrNW((LPWSTR)dest, len, src, pidl); - else - return StrRetToStrNA((LPSTR)dest, len, src, pidl); + return StrRetToStrNW((LPWSTR)dest, len, src, pidl); } /************************* OLESTR functions ****************************/ @@ -120,14 +117,6 @@ * StrToOleStr [SHELL32.163] * */ -static int StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString) -{ - TRACE("(%p, %p %s)\n", - lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString)); - - return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH); - -} static int StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) { TRACE("(%p, %p %s)\n", @@ -139,9 +128,7 @@ EXTERN_C BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString) { - if (SHELL_OsIsUnicode()) - return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString); - return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString); + return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString); } /************************************************************************* @@ -149,11 +136,6 @@ * lpMulti, nMulti, nWide [IN] * lpWide [OUT] */ -static BOOL StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr) -{ - TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr); - return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide); -} static BOOL StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) { TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr); @@ -166,20 +148,12 @@ EXTERN_C BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) { - if (SHELL_OsIsUnicode()) - return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr); - return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr); + return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr); } /************************************************************************* * OleStrToStrN [SHELL32.78] */ -static BOOL OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle) -{ - TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle); - return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL); -} - static BOOL OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) { TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle); @@ -192,9 +166,7 @@ EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) { - if (SHELL_OsIsUnicode()) - return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn); - return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn); + return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn); } Index: dll/win32/shell32/shlexec.cpp =================================================================== --- dll/win32/shell32/shlexec.cpp (revision 58878) +++ dll/win32/shell32/shlexec.cpp (working copy) @@ -888,7 +888,6 @@ HCONV hConv; HDDEDATA hDdeData; unsigned ret = SE_ERR_NOASSOC; - BOOL unicode = !(GetVersion() & 0x80000000); wcscpy(regkey, key); wcscpy(endkey, L"\\application"); @@ -949,17 +948,9 @@ wcscpy(topic, L"System"); } - if (unicode) - { - if (DdeInitializeW(&ddeInst, dde_cb, APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR) - return 2; - } - else - { - if (DdeInitializeA(&ddeInst, dde_cb, APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR) - return 2; - } - + if (DdeInitializeW(&ddeInst, dde_cb, APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR) + return 2; + hszApp = DdeCreateStringHandleW(ddeInst, app, CP_WINUNICODE); hszTopic = DdeCreateStringHandleW(ddeInst, topic, CP_WINUNICODE); @@ -998,17 +989,8 @@ /* It's documented in the KB 330337 that IE has a bug and returns * error DMLERR_NOTPROCESSED on XTYP_EXECUTE request. */ - if (unicode) - hDdeData = DdeClientTransaction((LPBYTE)res, (strlenW(res) + 1) * sizeof(WCHAR), hConv, 0L, 0, XTYP_EXECUTE, 30000, &tid); - else - { - DWORD lenA = WideCharToMultiByte(CP_ACP, 0, res, -1, NULL, 0, NULL, NULL); - char *resA = (LPSTR)HeapAlloc(GetProcessHeap(), 0, lenA); - WideCharToMultiByte(CP_ACP, 0, res, -1, resA, lenA, NULL, NULL); - hDdeData = DdeClientTransaction( (LPBYTE)resA, lenA, hConv, 0L, 0, - XTYP_EXECUTE, 10000, &tid ); - HeapFree(GetProcessHeap(), 0, resA); - } + hDdeData = DdeClientTransaction((LPBYTE)res, (strlenW(res) + 1) * sizeof(WCHAR), hConv, 0L, 0, XTYP_EXECUTE, 30000, &tid); + if (hDdeData) DdeFreeDataHandle(hDdeData); else Index: dll/win32/shell32/shlmenu.cpp =================================================================== --- dll/win32/shell32/shlmenu.cpp (revision 58878) +++ dll/win32/shell32/shlmenu.cpp (working copy) @@ -374,23 +374,9 @@ HMENU hMenuPopup, int nItemHeight) { - BOOL ret; + if (!lpText) return FALSE; - if (!lpText) return FALSE; - - if (SHELL_OsIsUnicode() || lpText == FM_SEPARATOR) - ret = FileMenu_AppendItemW(hMenu, (LPWSTR)lpText, uID, icon, hMenuPopup, nItemHeight); - else - { - DWORD len = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lpText, -1, NULL, 0 ); - LPWSTR lpszText = (LPWSTR)HeapAlloc ( GetProcessHeap(), 0, len*sizeof(WCHAR) ); - if (!lpszText) return FALSE; - MultiByteToWideChar( CP_ACP, 0, (LPSTR)lpText, -1, lpszText, len ); - ret = FileMenu_AppendItemW(hMenu, lpszText, uID, icon, hMenuPopup, nItemHeight); - HeapFree( GetProcessHeap(), 0, lpszText ); - } - - return ret; + return FileMenu_AppendItemW(hMenu, (LPWSTR)lpText, uID, icon, hMenuPopup, nItemHeight); } /************************************************************************* Index: dll/win32/shell32/shpolicy.cpp =================================================================== --- dll/win32/shell32/shpolicy.cpp (revision 58878) +++ dll/win32/shell32/shpolicy.cpp (working copy) @@ -49,8 +49,7 @@ 's','o','f','t','\\','W','i','n','d','o','w','s','\\', 'C','u','r','r','e','n','t','V','e','r','s','i','o','n', '\\','P','o','l','i','c','i','e','s',0}; -static const CHAR strPolicyA[] = "Policy"; -static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0}; +static const WCHAR strPolicyW[] = L"Policy"; /* application strings */ @@ -885,20 +884,10 @@ */ if (inpRegKey != NULL) { - if (SHELL_OsIsUnicode()) - { if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) && lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW)) /* doesn't match, fail */ return 0; - } - else - { - if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) && - lstrcmpiA((LPCSTR)inpRegKey, strPolicyA)) - /* doesn't match, fail */ - return 0; - } } return TRUE;