From: Alex Henrie alexhenrie24@gmail.com
--- dlls/shlwapi/msgbox.c | 8 +-- dlls/shlwapi/ordinal.c | 117 ++++++++++++----------------------------- dlls/shlwapi/path.c | 15 +++--- dlls/shlwapi/reg.c | 31 ++++------- dlls/shlwapi/string.c | 10 ++-- dlls/shlwapi/url.c | 2 +- 6 files changed, 58 insertions(+), 125 deletions(-)
diff --git a/dlls/shlwapi/msgbox.c b/dlls/shlwapi/msgbox.c index 0098e499b59..bb227a122fc 100644 --- a/dlls/shlwapi/msgbox.c +++ b/dlls/shlwapi/msgbox.c @@ -34,12 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
extern HINSTANCE shlwapi_hInstance; /* in shlwapi_main.c */
-static const WCHAR szDontShowKey[] = { 'S','o','f','t','w','a','r','e','\', - 'M','i','c','r','o','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','\', - 'E','x','p','l','o','r','e','r','\','D','o','n','t','S','h','o','w', - 'M','e','T','h','i','s','D','i','a','l','o','g','A','g','a','i','n','\0' -}; +static const WCHAR szDontShowKey[] = + L"Software\Microsoft\Windows\CurrentVersion\Explorer\DontShowMeThisDialogAgain";
INT_PTR WINAPI SHMessageBoxCheckExW(HWND,HINSTANCE,LPCWSTR,DLGPROC,LPARAM,INT_PTR,LPCWSTR); INT_PTR WINAPI SHMessageBoxCheckW(HWND,LPCWSTR,LPCWSTR,DWORD,INT_PTR,LPCWSTR); diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index f99dbf795ff..eeb57f23547 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -289,9 +289,7 @@ BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId) */ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) { - static const WCHAR szProperty[] = { '{','D','0','F','C','A','4','2','0', - '-','D','3','F','5','-','1','1','C','F', '-','B','2','1','1','-','0', - '0','A','A','0','0','4','A','E','8','3','7','}','\0' }; + static const WCHAR szProperty[] = L"{D0FCA420-D3F5-11CF-B211-00AA004AE837}"; BSTR property; IEnumFORMATETC* pIEnumFormatEtc = NULL; VARIANTARG var; @@ -491,13 +489,11 @@ INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax) { WCHAR xguid[40]; INT iLen; - static const WCHAR wszFormat[] = {'{','%','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};
TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
- swprintf(xguid, ARRAY_SIZE(xguid), wszFormat, guid->Data1, guid->Data2, guid->Data3, + swprintf(xguid, ARRAY_SIZE(xguid), L"{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
@@ -552,31 +548,10 @@ BOOL WINAPI SHAboutInfoA(LPSTR lpszDest, DWORD dwDestLen) */ BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen) { - static const WCHAR szIEKey[] = { 'S','O','F','T','W','A','R','E','\', - 'M','i','c','r','o','s','o','f','t','\','I','n','t','e','r','n','e','t', - ' ','E','x','p','l','o','r','e','r','\0' }; - static const WCHAR szWinNtKey[] = { 'S','O','F','T','W','A','R','E','\', - 'M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s',' ', - 'N','T','\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0' }; - static const WCHAR szWinKey[] = { 'S','O','F','T','W','A','R','E','\', - 'M','i','c','r','o','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','\0' }; - static const WCHAR szRegKey[] = { 'S','O','F','T','W','A','R','E','\', - 'M','i','c','r','o','s','o','f','t','\','I','n','t','e','r','n','e','t', - ' ','E','x','p','l','o','r','e','r','\', - 'R','e','g','i','s','t','r','a','t','i','o','n','\0' }; - static const WCHAR szVersion[] = { 'V','e','r','s','i','o','n','\0' }; - static const WCHAR szCustomized[] = { 'C','u','s','t','o','m','i','z','e','d', - 'V','e','r','s','i','o','n','\0' }; - static const WCHAR szOwner[] = { 'R','e','g','i','s','t','e','r','e','d', - 'O','w','n','e','r','\0' }; - static const WCHAR szOrg[] = { 'R','e','g','i','s','t','e','r','e','d', - 'O','r','g','a','n','i','z','a','t','i','o','n','\0' }; - static const WCHAR szProduct[] = { 'P','r','o','d','u','c','t','I','d','\0' }; - static const WCHAR szUpdate[] = { 'I','E','A','K', - 'U','p','d','a','t','e','U','r','l','\0' }; - static const WCHAR szHelp[] = { 'I','E','A','K', - 'H','e','l','p','S','t','r','i','n','g','\0' }; + static const WCHAR szIEKey[] = L"SOFTWARE\Microsoft\Internet Explorer"; + static const WCHAR szWinNtKey[] = L"SOFTWARE\Microsoft\Windows NT\CurrentVersion"; + static const WCHAR szWinKey[] = L"SOFTWARE\Microsoft\Windows\CurrentVersion"; + static const WCHAR szRegKey[] = L"SOFTWARE\Microsoft\Internet Explorer\Registration"; WCHAR buff[2084]; HKEY hReg; DWORD dwType, dwLen; @@ -596,25 +571,25 @@ BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen) /* OS Version */ buff[0] = '\0'; dwLen = 30; - if (!SHGetValueW(HKEY_LOCAL_MACHINE, szIEKey, szVersion, &dwType, buff, &dwLen)) + if (!SHGetValueW(HKEY_LOCAL_MACHINE, szIEKey, L"Version", &dwType, buff, &dwLen)) { DWORD dwStrLen = lstrlenW(buff); dwLen = 30 - dwStrLen; SHGetValueW(HKEY_LOCAL_MACHINE, szIEKey, - szCustomized, &dwType, buff+dwStrLen, &dwLen); + L"CustomizedVersion", &dwType, buff+dwStrLen, &dwLen); } StrCatBuffW(lpszDest, buff, dwDestLen);
/* ~Registered Owner */ buff[0] = '~'; dwLen = 256; - if (SHGetValueW(hReg, szOwner, 0, &dwType, buff+1, &dwLen)) + if (SHGetValueW(hReg, L"RegisteredOwner", 0, &dwType, buff+1, &dwLen)) buff[1] = '\0'; StrCatBuffW(lpszDest, buff, dwDestLen);
/* ~Registered Organization */ dwLen = 256; - if (SHGetValueW(hReg, szOrg, 0, &dwType, buff+1, &dwLen)) + if (SHGetValueW(hReg, L"RegisteredOrganization", 0, &dwType, buff+1, &dwLen)) buff[1] = '\0'; StrCatBuffW(lpszDest, buff, dwDestLen);
@@ -626,19 +601,19 @@ BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen)
/* ~Product Id */ dwLen = 256; - if (SHGetValueW(HKEY_LOCAL_MACHINE, szRegKey, szProduct, &dwType, buff+1, &dwLen)) + if (SHGetValueW(HKEY_LOCAL_MACHINE, szRegKey, L"ProductId", &dwType, buff+1, &dwLen)) buff[1] = '\0'; StrCatBuffW(lpszDest, buff, dwDestLen);
/* ~IE Update Url */ dwLen = 2048; - if(SHGetValueW(HKEY_LOCAL_MACHINE, szWinKey, szUpdate, &dwType, buff+1, &dwLen)) + if(SHGetValueW(HKEY_LOCAL_MACHINE, szWinKey, L"IEAKUpdateUrl", &dwType, buff+1, &dwLen)) buff[1] = '\0'; StrCatBuffW(lpszDest, buff, dwDestLen);
/* ~IE Help String */ dwLen = 256; - if(SHGetValueW(hReg, szHelp, 0, &dwType, buff+1, &dwLen)) + if(SHGetValueW(hReg, L"IEAKHelpString", 0, &dwType, buff+1, &dwLen)) buff[1] = '\0'; StrCatBuffW(lpszDest, buff, dwDestLen);
@@ -2117,12 +2092,6 @@ typedef struct tagPOLICYDATA
#define SHELL_NO_POLICY 0xffffffff
-/* default shell policy registry key */ -static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\','M','i','c','r','o', - '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}; - /************************************************************************* * @ [SHLWAPI.271] * @@ -2142,7 +2111,7 @@ DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpVal HKEY hKey;
if (!lpSubKey) - lpSubKey = strRegistryPolicyW; + lpSubKey = L"Software\Microsoft\Windows\CurrentVersion\Policies";
retval = RegOpenKeyW(HKEY_LOCAL_MACHINE, lpSubKey, &hKey); if (retval != ERROR_SUCCESS) @@ -3660,8 +3629,7 @@ HRESULT WINAPI SHCoCreateInstanceAC(REFCLSID rclsid, LPUNKNOWN pUnkOuter, */ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid) { - static WCHAR szSkipBinding[] = { 'S','k','i','p',' ', - 'B','i','n','d','i','n','g',' ','C','L','S','I','D','\0' }; + static WCHAR szSkipBinding[] = L"Skip Binding CLSID"; BOOL bRet = FALSE;
if (pbc) @@ -4304,9 +4272,6 @@ INT WINAPI SHFormatDateTimeW(const FILETIME *fileTime, DWORD *flags, /* first of all date */ if (fmt_flags & (FDTF_LONGDATE | FDTF_SHORTDATE)) { - static const WCHAR sep1[] = {',',' ',0}; - static const WCHAR sep2[] = {' ',0}; - DWORD date = fmt_flags & FDTF_LONGDATE ? DATE_LONGDATE : DATE_SHORTDATE; ret = GetDateFormatW(LOCALE_USER_DEFAULT, date, &st, NULL, buf, size); if (ret >= size) return ret; @@ -4316,12 +4281,12 @@ INT WINAPI SHFormatDateTimeW(const FILETIME *fileTime, DWORD *flags, { if ((fmt_flags & FDTF_LONGDATE) && (ret < size + 2)) { - lstrcatW(&buf[ret-1], sep1); + lstrcatW(&buf[ret-1], L", "); ret += 2; } else { - lstrcatW(&buf[ret-1], sep2); + lstrcatW(&buf[ret-1], L" "); ret++; } } @@ -4487,34 +4452,23 @@ struct objcompat_entry { };
/* expected to be sorted by name */ +#define OBJCOMPAT_ENTRY(name) { L""#name, OBJCOMPAT_##name } static const struct objcompat_entry objcompat_table[] = { - { {'C','O','C','R','E','A','T','E','S','H','E','L','L','F','O','L','D','E','R','O','N','L','Y',0}, - OBJCOMPAT_COCREATESHELLFOLDERONLY }, - { {'C','T','X','M','E','N','U','_','L','I','M','I','T','E','D','Q','I',0}, - OBJCOMPAT_CTXMENU_LIMITEDQI }, - { {'C','T','X','M','E','N','U','_','N','O','V','E','R','B','S',0}, - OBJCOMPAT_CTXMENU_LIMITEDQI }, - { {'C','T','X','M','E','N','U','_','X','P','Q','C','M','F','L','A','G','S',0}, - OBJCOMPAT_CTXMENU_XPQCMFLAGS }, - { {'N','E','E','D','S','F','I','L','E','S','Y','S','A','N','C','E','S','T','O','R',0}, - OBJCOMPAT_NEEDSFILESYSANCESTOR }, - { {'N','E','E','D','S','S','T','O','R','A','G','E','A','N','C','E','S','T','O','R',0}, - OBJCOMPAT_NEEDSSTORAGEANCESTOR }, - { {'N','O','I','P','R','O','P','E','R','T','Y','S','T','O','R','E',0}, - OBJCOMPAT_NOIPROPERTYSTORE }, - { {'N','O','L','E','G','A','C','Y','W','E','B','V','I','E','W',0}, - OBJCOMPAT_NOLEGACYWEBVIEW }, - { {'N','O','T','A','F','I','L','E','S','Y','S','T','E','M',0}, - OBJCOMPAT_NOTAFILESYSTEM }, - { {'N','O','_','W','E','B','V','I','E','W',0}, - OBJCOMPAT_NO_WEBVIEW }, - { {'O','T','N','E','E','D','S','S','F','C','A','C','H','E',0}, - OBJCOMPAT_OTNEEDSSFCACHE }, - { {'P','I','N','D','L','L',0}, - OBJCOMPAT_PINDLL }, - { {'U','N','B','I','N','D','A','B','L','E',0}, - OBJCOMPAT_UNBINDABLE } + OBJCOMPAT_ENTRY(COCREATESHELLFOLDERONLY), + OBJCOMPAT_ENTRY(CTXMENU_LIMITEDQI), + OBJCOMPAT_ENTRY(CTXMENU_NOVERBS), + OBJCOMPAT_ENTRY(CTXMENU_XPQCMFLAGS), + OBJCOMPAT_ENTRY(NEEDSFILESYSANCESTOR), + OBJCOMPAT_ENTRY(NEEDSSTORAGEANCESTOR), + OBJCOMPAT_ENTRY(NOIPROPERTYSTORE), + OBJCOMPAT_ENTRY(NOLEGACYWEBVIEW), + OBJCOMPAT_ENTRY(NOTAFILESYSTEM), + OBJCOMPAT_ENTRY(NO_WEBVIEW), + OBJCOMPAT_ENTRY(OTNEEDSSFCACHE), + OBJCOMPAT_ENTRY(PINDLL), + OBJCOMPAT_ENTRY(UNBINDABLE), }; +#undef OBJCOMPAT_ENTRY
/************************************************************************** * SHGetObjectCompatFlags (SHLWAPI.476) @@ -4532,10 +4486,7 @@ static const struct objcompat_entry objcompat_table[] = { DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid) { static const WCHAR compatpathW[] = - {'S','o','f','t','w','a','r','e','\','M','i','c','r','o','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','\', - 'S','h','e','l','l','C','o','m','p','a','t','i','b','i','l','i','t','y','\', - 'O','b','j','e','c','t','s','\','%','s',0}; + L"Software\Microsoft\Windows\CurrentVersion\ShellCompatibility\Objects\%s"; WCHAR strW[ARRAY_SIZE(compatpathW) + 38 /* { CLSID } */]; DWORD ret, length = ARRAY_SIZE(strW); OLECHAR *clsid_str; diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 7967ef4932c..307631b4dcb 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -238,8 +238,6 @@ BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath,DWORD dwWhich) */ static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) { - static const WCHAR szSystem[] = { 'S','y','s','t','e','m','\0'}; - static const WCHAR szPath[] = { 'P','A','T','H','\0'}; DWORD dwLenPATH; LPCWSTR lpszCurr; WCHAR *lpszPATH; @@ -257,7 +255,7 @@ static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) return TRUE; } GetWindowsDirectoryW(buff, MAX_PATH); - if (!PathAppendW(buff, szSystem ) || !PathAppendW(buff, lpszFile)) + if (!PathAppendW(buff, L"System" ) || !PathAppendW(buff, lpszFile)) return FALSE; if (PathFileExistsDefExtW(buff, dwWhich)) { @@ -273,12 +271,12 @@ static BOOL SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) return TRUE; } /* Try dirs listed in %PATH% */ - dwLenPATH = GetEnvironmentVariableW(szPath, buff, MAX_PATH); + dwLenPATH = GetEnvironmentVariableW(L"PATH", buff, MAX_PATH);
if (!dwLenPATH || !(lpszPATH = malloc((dwLenPATH + 1) * sizeof (WCHAR)))) return FALSE;
- GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1); + GetEnvironmentVariableW(L"PATH", lpszPATH, dwLenPATH + 1); lpszCurr = lpszPATH; while (lpszCurr) { @@ -732,7 +730,6 @@ BOOL WINAPI PathIsContentTypeA(LPCSTR path, LPCSTR content_type) */ BOOL WINAPI PathIsContentTypeW(LPCWSTR lpszPath, LPCWSTR lpszContentType) { - static const WCHAR szContentType[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0' }; LPCWSTR szExt; DWORD dwDummy; WCHAR szBuff[MAX_PATH]; @@ -740,7 +737,7 @@ BOOL WINAPI PathIsContentTypeW(LPCWSTR lpszPath, LPCWSTR lpszContentType) TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszContentType));
if (lpszPath && (szExt = PathFindExtensionW(lpszPath)) && *szExt && - !SHGetValueW(HKEY_CLASSES_ROOT, szExt, szContentType, + !SHGetValueW(HKEY_CLASSES_ROOT, szExt, L"Content Type", REG_NONE, szBuff, &dwDummy) && !wcsicmp(lpszContentType, szBuff)) { @@ -1518,8 +1515,8 @@ HRESULT WINAPI SHGetWebFolderFilePathA(LPCSTR lpszFile, LPSTR lpszPath, DWORD dw */ HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR lpszFile, LPWSTR lpszPath, DWORD dwPathLen) { - static const WCHAR szWeb[] = {'\','W','e','b','\','\0'}; - static const WCHAR szWebMui[] = {'m','u','i','\','%','0','4','x','\','\0'}; + static const WCHAR szWeb[] = L"\Web\"; + static const WCHAR szWebMui[] = L"mui\%04x\"; DWORD dwLen, dwFileLen; LANGID lidSystem, lidUser;
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index b8070f44c78..432e31096c0 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -31,19 +31,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(shell);
-/* Key/Value names for MIME content types */ -static const char lpszContentTypeA[] = "Content Type"; -static const WCHAR lpszContentTypeW[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'}; - static const char szMimeDbContentA[] = "MIME\Database\Content Type\"; -static const WCHAR szMimeDbContentW[] = { 'M', 'I', 'M','E','\', - 'D','a','t','a','b','a','s','e','\','C','o','n','t','e','n','t', - ' ','T','y','p','e','\', 0 }; +static const WCHAR szMimeDbContentW[] = L"MIME\Database\Content Type\"; static const DWORD dwLenMimeDbContent = 27; /* strlen of szMimeDbContentA/W */
-static const char szExtensionA[] = "Extension"; -static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' }; - INT WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT); HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY);
@@ -158,7 +149,7 @@ BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue) return FALSE; }
- return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA, + return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, "Content Type", REG_SZ, lpszValue, strlen(lpszValue)); }
@@ -175,7 +166,7 @@ BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue) return FALSE; }
- return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW, + return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, L"Content Type", REG_SZ, lpszValue, lstrlenW(lpszValue)); }
@@ -193,7 +184,7 @@ BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue) */ BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey) { - return !SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA); + return !SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, "Content Type"); }
/************************************************************************* @@ -203,7 +194,7 @@ BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey) */ BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey) { - return !SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW); + return !SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, L"Content Type"); }
/************************************************************************* @@ -295,7 +286,7 @@ BOOL WINAPI MIME_GetExtensionA(LPCSTR lpszType, LPSTR lpExt, INT iLen)
if (lpszType && lpExt && iLen > 2 && GetMIMETypeSubKeyA(lpszType, szSubKey, MAX_PATH) && - !SHGetValueA(HKEY_CLASSES_ROOT, szSubKey, szExtensionA, &dwType, lpExt + 1, &dwlen) && + !SHGetValueA(HKEY_CLASSES_ROOT, szSubKey, "Extension", &dwType, lpExt + 1, &dwlen) && lpExt[1]) { if (lpExt[1] == '.') @@ -323,7 +314,7 @@ BOOL WINAPI MIME_GetExtensionW(LPCWSTR lpszType, LPWSTR lpExt, INT iLen)
if (lpszType && lpExt && iLen > 2 && GetMIMETypeSubKeyW(lpszType, szSubKey, MAX_PATH) && - !SHGetValueW(HKEY_CLASSES_ROOT, szSubKey, szExtensionW, &dwType, lpExt + 1, &dwlen) && + !SHGetValueW(HKEY_CLASSES_ROOT, szSubKey, L"Extension", &dwType, lpExt + 1, &dwlen) && lpExt[1]) { if (lpExt[1] == '.') @@ -360,7 +351,7 @@ BOOL WINAPI RegisterExtensionForMIMETypeA(LPCSTR lpszExt, LPCSTR lpszType)
dwLen = strlen(lpszExt) + 1;
- if (SHSetValueA(HKEY_CLASSES_ROOT, szKey, szExtensionA, REG_SZ, lpszExt, dwLen)) + if (SHSetValueA(HKEY_CLASSES_ROOT, szKey, "Extension", REG_SZ, lpszExt, dwLen)) return FALSE; return TRUE; } @@ -383,7 +374,7 @@ BOOL WINAPI RegisterExtensionForMIMETypeW(LPCWSTR lpszExt, LPCWSTR lpszType)
dwLen = (lstrlenW(lpszExt) + 1) * sizeof(WCHAR);
- if (SHSetValueW(HKEY_CLASSES_ROOT, szKey, szExtensionW, REG_SZ, lpszExt, dwLen)) + if (SHSetValueW(HKEY_CLASSES_ROOT, szKey, L"Extension", REG_SZ, lpszExt, dwLen)) return FALSE; return TRUE; } @@ -412,7 +403,7 @@ BOOL WINAPI UnregisterExtensionForMIMETypeA(LPCSTR lpszType) if (!GetMIMETypeSubKeyA(lpszType, szKey, MAX_PATH)) /* Get full path to the key */ return FALSE;
- if (!SHDeleteValueA(HKEY_CLASSES_ROOT, szKey, szExtensionA)) + if (!SHDeleteValueA(HKEY_CLASSES_ROOT, szKey, "Extension")) return FALSE;
if (!SHDeleteOrphanKeyA(HKEY_CLASSES_ROOT, szKey)) @@ -434,7 +425,7 @@ BOOL WINAPI UnregisterExtensionForMIMETypeW(LPCWSTR lpszType) if (!GetMIMETypeSubKeyW(lpszType, szKey, MAX_PATH)) /* Get full path to the key */ return FALSE;
- if (!SHDeleteValueW(HKEY_CLASSES_ROOT, szKey, szExtensionW)) + if (!SHDeleteValueW(HKEY_CLASSES_ROOT, szKey, L"Extension")) return FALSE;
if (!SHDeleteOrphanKeyW(HKEY_CLASSES_ROOT, szKey)) diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 4bf95f98170..7aeeef246d6 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -122,12 +122,11 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) */ static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf) { - static const WCHAR flfmt[] = {'%','f',0}; WCHAR buf[64]; NUMBERFMTW fmt; WCHAR decimal[8], thousand[8]; - - swprintf(buf, 64, flfmt, value); + + swprintf(buf, 64, L"%f", value);
FillNumberFmt(&fmt, decimal, ARRAY_SIZE(decimal), thousand, ARRAY_SIZE(thousand)); fmt.NumDigits = decimals; @@ -464,7 +463,6 @@ LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) */ LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) { - static const WCHAR kb[] = {' ','K','B',0}; LONGLONG llKB = (llBytes + 1023) >> 10; int len;
@@ -476,7 +474,7 @@ LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) len = lstrlenW(lpszDest); if (cchMax - len < 4) return NULL; - lstrcatW(lpszDest, kb); + lstrcatW(lpszDest, L" KB"); return lpszDest; }
@@ -888,7 +886,7 @@ HRESULT WINAPI StrFormatByteSizeEx(LONGLONG llBytes, SFBS_FLAGS flags, LPWSTR lp { 1000*PB, 1073741824.0, 1.00, 0, 'P' }, /* 1000 PB */ { 0, 10995116277.76, 100.00, 2, 'E' } /* EB's, catch all */ }; - WCHAR wszAdd[] = {' ','?','B',0}; + WCHAR wszAdd[] = L" ?B"; double dBytes; UINT i = 0;
diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index f657d6c007c..5c18306624d 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -107,7 +107,7 @@ HRESULT WINAPI MLBuildResURLA(LPCSTR lpszLibName, HMODULE hMod, DWORD dwFlags, HRESULT WINAPI MLBuildResURLW(LPCWSTR lpszLibName, HMODULE hMod, DWORD dwFlags, LPCWSTR lpszRes, LPWSTR lpszDest, DWORD dwDestLen) { - static const WCHAR szRes[] = { 'r','e','s',':','/','/','\0' }; + static const WCHAR szRes[] = L"res://"; static const unsigned int szResLen = ARRAY_SIZE(szRes) - 1; HRESULT hRet = E_FAIL;