diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 8a4fc939789..45d1e4ce827 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -40,10 +40,6 @@ TODO: WINE_DEFAULT_DEBUG_CHANNEL(shell); -#undef SV_CLASS_NAME - -static const WCHAR SV_CLASS_NAME[] = {'S', 'H', 'E', 'L', 'L', 'D', 'L', 'L', '_', 'D', 'e', 'f', 'V', 'i', 'e', 'w', 0}; - typedef struct { BOOL bIsAscending; @@ -298,7 +294,7 @@ class CDefView : { { sizeof(WNDCLASSEX), CS_PARENTDC, StartWindowProc, 0, 0, NULL, NULL, - LoadCursor(NULL, IDC_ARROW), NULL, NULL, SV_CLASS_NAME, NULL + LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"SHELLDLL_DefView", NULL }, NULL, NULL, IDC_ARROW, TRUE, 0, _T("") }; diff --git a/dll/win32/shell32/CQueryAssociations.cpp b/dll/win32/shell32/CQueryAssociations.cpp index a11a79a65fd..093a536b4a1 100644 --- a/dll/win32/shell32/CQueryAssociations.cpp +++ b/dll/win32/shell32/CQueryAssociations.cpp @@ -73,8 +73,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init( HKEY hkeyProgid, HWND hWnd) { - static const WCHAR szProgID[] = L"ProgID"; - TRACE("(%p)->(%d,%s,%p,%p)\n", this, cfFlags, debugstr_w(pszAssoc), @@ -128,11 +126,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init( { HKEY progIdKey; /* for a clsid, the progid is the default value of the ProgID subkey */ - ret = RegOpenKeyExW(this->hkeySource, - szProgID, - 0, - KEY_READ, - &progIdKey); + ret = RegOpenKeyExW(this->hkeySource, L"ProgID", 0, KEY_READ, &progIdKey); if (ret != ERROR_SUCCESS) return S_OK; hr = this->GetValue(progIdKey, NULL, (void**)&progId, NULL); @@ -274,8 +268,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( DWORD size, retval = 0; UINT flen; WCHAR *bufW; - static const WCHAR translationW[] = L"\\VarFileInfo\\Translation"; - static const WCHAR fileDescFmtW[] = L"\\StringFileInfo\\%04x%04x\\FileDescription"; WCHAR fileDescW[41]; hr = this->GetExecutable(pszExtra, path, MAX_PATH, &len); @@ -297,13 +289,14 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( { goto get_friendly_name_fail; } - if (VerQueryValueW(verinfoW, translationW, (LPVOID *)&bufW, &flen)) + if (VerQueryValueW(verinfoW, L"\\VarFileInfo\\Translation", (LPVOID *)&bufW, &flen)) { UINT i; DWORD *langCodeDesc = (DWORD *)bufW; for (i = 0; i < flen / sizeof(DWORD); i++) { - sprintfW(fileDescW, fileDescFmtW, LOWORD(langCodeDesc[i]), HIWORD(langCodeDesc[i])); + sprintfW(fileDescW, L"\\StringFileInfo\\%04x%04x\\FileDescription", + LOWORD(langCodeDesc[i]), HIWORD(langCodeDesc[i])); if (VerQueryValueW(verinfoW, fileDescW, (LPVOID *)&bufW, &flen)) { /* Does strlenW(bufW) == 0 mean we use the filename? */ @@ -325,10 +318,8 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_CONTENTTYPE: { - static const WCHAR Content_TypeW[] = L"Content Type"; - DWORD size = 0; - DWORD ret = RegGetValueW(this->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, NULL, &size); + DWORD ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, NULL, &size); if (ret != ERROR_SUCCESS) { return HRESULT_FROM_WIN32(ret); @@ -336,7 +327,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( WCHAR *contentType = static_cast(HeapAlloc(GetProcessHeap(), 0, size)); if (contentType != NULL) { - ret = RegGetValueW(this->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, contentType, &size); + ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, contentType, &size); if (ret == ERROR_SUCCESS) { hr = this->ReturnString(flags, pszOut, pcchOut, contentType, strlenW(contentType) + 1); @@ -355,16 +346,15 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_DEFAULTICON: { - static const WCHAR DefaultIconW[] = L"DefaultIcon"; DWORD ret; DWORD size = 0; - ret = RegGetValueW(this->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); + ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, NULL, &size); if (ret == ERROR_SUCCESS) { WCHAR *icon = static_cast(HeapAlloc(GetProcessHeap(), 0, size)); if (icon) { - ret = RegGetValueW(this->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size); + ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, icon, &size); if (ret == ERROR_SUCCESS) { hr = this->ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1); @@ -388,8 +378,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( } case ASSOCSTR_SHELLEXTENSION: { - static const WCHAR shellexW[] = L"ShellEx\\"; - WCHAR keypath[sizeof(shellexW) / sizeof(shellexW[0]) + 39], guid[39]; + WCHAR keypath[ARRAY_SIZE(L"ShellEx\\") + 39], guid[39]; CLSID clsid; HKEY hkey; @@ -398,7 +387,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString( { return hr; } - strcpyW(keypath, shellexW); + strcpyW(keypath, L"ShellEx\\"); strcatW(keypath, pszExtra); LONG ret = RegOpenKeyExW(this->hkeySource, keypath, 0, KEY_READ, &hkey); if (ret) @@ -467,8 +456,6 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetKey( */ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA assocdata, LPCWSTR pszExtra, LPVOID pvOut, DWORD *pcbOut) { - static const WCHAR edit_flags[] = L"EditFlags"; - TRACE("(%p,0x%8x,0x%8x,%s,%p,%p)\n", this, cfFlags, assocdata, debugstr_w(pszExtra), pvOut, pcbOut); @@ -488,7 +475,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA void *data; DWORD size; - HRESULT hres = this->GetValue(this->hkeyProgID, edit_flags, &data, &size); + HRESULT hres = this->GetValue(this->hkeyProgID, L"EditFlags", &data, &size); if(FAILED(hres)) { return hres; @@ -582,8 +569,6 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) LONG ret; WCHAR *extra_from_reg = NULL; WCHAR *filetype; - static const WCHAR commandW[] = L"command"; - static const WCHAR shellW[] = L"shell"; /* When looking for file extension it's possible to have a default value that points to another key that contains 'shell//command' subtree. */ @@ -597,17 +582,17 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) if (ret == ERROR_SUCCESS) { - ret = RegOpenKeyExW(hkeyFile, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(hkeyFile, L"shell", 0, KEY_READ, &hkeyShell); RegCloseKey(hkeyFile); } else { - ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell); } } else { - ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell); + ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell); } if (ret) @@ -659,7 +644,7 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command) return HRESULT_FROM_WIN32(ret); } /* open command subkey */ - ret = RegOpenKeyExW(hkeyVerb, commandW, 0, KEY_READ, &hkeyCommand); + ret = RegOpenKeyExW(hkeyVerb, L"command", 0, KEY_READ, &hkeyCommand); RegCloseKey(hkeyVerb); if (ret) { diff --git a/dll/win32/shell32/dialogs/dialogs.cpp b/dll/win32/shell32/dialogs/dialogs.cpp index 832e32c8a96..73de2f363ac 100644 --- a/dll/win32/shell32/dialogs/dialogs.cpp +++ b/dll/win32/shell32/dialogs/dialogs.cpp @@ -435,7 +435,6 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) { const WCHAR *src; WCHAR *dest, *result, *result_end=NULL; - static const WCHAR dotexeW[] = L".exe"; result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5)); @@ -466,7 +465,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) *dest = 0; if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) break; - strcatW(dest, dotexeW); + strcatW(dest, L".exe"); if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) break; } diff --git a/dll/win32/shell32/dialogs/view.cpp b/dll/win32/shell32/dialogs/view.cpp index 648915a0441..e8603d345d3 100644 --- a/dll/win32/shell32/dialogs/view.cpp +++ b/dll/win32/shell32/dialogs/view.cpp @@ -441,9 +441,6 @@ ViewTree_LoadTree(HKEY hKey, LPCWSTR pszKeyName, DWORD dwParentID) static BOOL ViewTree_LoadAll(VOID) { - static const WCHAR s_szAdvanced[] = - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"; - // free if already existed if (s_ViewTreeEntries) { @@ -453,8 +450,9 @@ static BOOL ViewTree_LoadAll(VOID) s_ViewTreeEntryCount = 0; HKEY hKey; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szAdvanced, 0, - KEY_READ, &hKey) != ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", + 0, KEY_READ, &hKey) != ERROR_SUCCESS) { return FALSE; // failure } diff --git a/dll/win32/shell32/folders/CControlPanelFolder.cpp b/dll/win32/shell32/folders/CControlPanelFolder.cpp index e4133520100..c4d9eddf670 100644 --- a/dll/win32/shell32/folders/CControlPanelFolder.cpp +++ b/dll/win32/shell32/folders/CControlPanelFolder.cpp @@ -623,10 +623,9 @@ HRESULT WINAPI CControlPanelFolder::Initialize(PCIDLIST_ABSOLUTE pidl) /* Create the inner reg folder */ HRESULT hr; - static const WCHAR* pszCPanelPath = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"; hr = CRegFolder_CreateInstance(&CLSID_ControlPanel, pidlRoot, - pszCPanelPath, + L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", L"ControlPanel", IID_PPV_ARG(IShellFolder2, &m_regFolder)); if (FAILED_UNEXPECTEDLY(hr)) diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index 35c4952c060..a64182e1dc9 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -411,8 +411,6 @@ getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, WCHAR wszPath[MAX_PATH]; WCHAR wszAutoRunInfPath[MAX_PATH]; WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH]; - static const WCHAR wszAutoRunInf[] = { 'a','u','t','o','r','u','n','.','i','n','f',0 }; - static const WCHAR wszAutoRun[] = { 'a','u','t','o','r','u','n',0 }; // get path if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0)) @@ -422,10 +420,10 @@ getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, // build the full path of autorun.inf StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath); - PathAppendW(wszAutoRunInfPath, wszAutoRunInf); + PathAppendW(wszAutoRunInfPath, L"autorun.inf"); // autorun.inf --> wszValue - if (GetPrivateProfileStringW(wszAutoRun, L"icon", NULL, wszValue, _countof(wszValue), + if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue), wszAutoRunInfPath) && wszValue[0] != 0) { // wszValue --> wszTemp @@ -977,8 +975,6 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla { WCHAR wszDrive[18] = {0}; DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags; - static const WCHAR wszOpenBracket[] = {' ', '(', 0}; - static const WCHAR wszCloseBracket[] = {')', 0}; lstrcpynW(wszDrive, pszPath, 4); pszPath[0] = L'\0'; @@ -1012,10 +1008,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla pszPath[MAX_PATH-7] = L'\0'; } } - wcscat (pszPath, wszOpenBracket); + wcscat (pszPath, L" ("); wszDrive[2] = L'\0'; wcscat (pszPath, wszDrive); - wcscat (pszPath, wszCloseBracket); + wcscat (pszPath, L")"); } if (SUCCEEDED(hr)) diff --git a/dll/win32/shell32/folders/CFSFolder.cpp b/dll/win32/shell32/folders/CFSFolder.cpp index b1c578ada8b..72325d3973b 100644 --- a/dll/win32/shell32/folders/CFSFolder.cpp +++ b/dll/win32/shell32/folders/CFSFolder.cpp @@ -136,9 +136,7 @@ HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID* pcl static HRESULT getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags) { - static const WCHAR folder[] = { 'F', 'o', 'l', 'd', 'e', 'r', 0 }; - - if (!HCR_GetIconW(folder, szIconFile, NULL, cchMax, piIndex)) + if (!HCR_GetIconW(L"Folder", szIconFile, NULL, cchMax, piIndex)) { lstrcpynW(szIconFile, swShell32Name, cchMax); *piIndex = -IDI_SHELL_FOLDER; @@ -156,12 +154,10 @@ getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags return S_OK; } -static const WCHAR s_shellClassInfo[] = { '.', 'S', 'h', 'e', 'l', 'l', 'C', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 }; - static BOOL getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile) { - return GetPrivateProfileStringW(s_shellClassInfo, Entry, NULL, pszValue, cchValueLen, IniFile); + return GetPrivateProfileStringW(L".ShellClassInfo", Entry, NULL, pszValue, cchValueLen, IniFile); } static HRESULT @@ -171,12 +167,6 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, DWORD dwFileAttrs; WCHAR wszPath[MAX_PATH]; WCHAR wszIniFullPath[MAX_PATH]; - static const WCHAR iconFile[] = { 'I', 'c', 'o', 'n', 'F', 'i', 'l', 'e', 0 }; - static const WCHAR clsid[] = { 'C', 'L', 'S', 'I', 'D', 0 }; - static const WCHAR clsid2[] = { 'C', 'L', 'S', 'I', 'D', '2', 0 }; - static const WCHAR iconIndex[] = { 'I', 'c', 'o', 'n', 'I', 'n', 'd', 'e', 'x', 0 }; - static const WCHAR iconResource[] = { 'I', 'c', 'o', 'n', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 0 }; - static const WCHAR wszDesktopIni[] = { 'd','e','s','k','t','o','p','.','i','n','i',0 }; if (uFlags & GIL_DEFAULTICON) goto Quit; @@ -194,10 +184,10 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, // build the full path of ini file StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath); - PathAppendW(wszIniFullPath, wszDesktopIni); + PathAppendW(wszIniFullPath, L"desktop.ini"); WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH]; - if (getShellClassInfo(iconFile, wszValue, _countof(wszValue), wszIniFullPath)) + if (getShellClassInfo(L"IconFile", wszValue, _countof(wszValue), wszIniFullPath)) { // wszValue --> wszTemp ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp)); @@ -211,20 +201,20 @@ getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, // wszPath --> szIconFile GetFullPathNameW(wszPath, cchMax, szIconFile, NULL); - *piIndex = GetPrivateProfileIntW(s_shellClassInfo, iconIndex, 0, wszIniFullPath); + *piIndex = GetPrivateProfileIntW(L".ShellClassInfo", L"IconIndex", 0, wszIniFullPath); return S_OK; } - else if (getShellClassInfo(clsid, wszValue, _countof(wszValue), wszIniFullPath) && + else if (getShellClassInfo(L"CLSID", wszValue, _countof(wszValue), wszIniFullPath) && HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex)) { return S_OK; } - else if (getShellClassInfo(clsid2, wszValue, _countof(wszValue), wszIniFullPath) && + else if (getShellClassInfo(L"CLSID2", wszValue, _countof(wszValue), wszIniFullPath) && HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex)) { return S_OK; } - else if (getShellClassInfo(iconResource, wszValue, _countof(wszValue), wszIniFullPath)) + else if (getShellClassInfo(L"IconResource", wszValue, _countof(wszValue), wszIniFullPath)) { // wszValue --> wszTemp ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp)); @@ -590,6 +580,7 @@ static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CL { WCHAR wszCLSIDValue[CHARS_IN_GUID]; WCHAR wszDesktopIni[MAX_PATH]; + StringCchCopyW(wszDesktopIni, MAX_PATH, pwszDir); StringCchCatW(wszDesktopIni, MAX_PATH, L"\\desktop.ini"); @@ -1265,10 +1256,6 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner, return hr; } -static const WCHAR AdvancedW[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"; -static const WCHAR HideFileExtW[] = L"HideFileExt"; -static const WCHAR NeverShowExtW[] = L"NeverShowExt"; - /****************************************************************************** * SHELL_FS_HideExtension [Internal] * @@ -1289,11 +1276,12 @@ BOOL SHELL_FS_HideExtension(LPCWSTR szPath) BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */ LONG lError; - lError = RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + lError = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", + 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL); if (lError == ERROR_SUCCESS) { - lError = RegQueryValueExW(hKey, HideFileExtW, NULL, NULL, (LPBYTE)&dwData, &dwDataSize); + lError = RegQueryValueExW(hKey, L"HideFileExt", NULL, NULL, (LPBYTE)&dwData, &dwDataSize); if (lError == ERROR_SUCCESS) doHide = dwData; RegCloseKey(hKey); @@ -1312,7 +1300,7 @@ BOOL SHELL_FS_HideExtension(LPCWSTR szPath) lError = RegOpenKeyW(HKEY_CLASSES_ROOT, classname, &hKey); if (lError == ERROR_SUCCESS) { - lError = RegQueryValueExW(hKey, NeverShowExtW, NULL, NULL, NULL, NULL); + lError = RegQueryValueExW(hKey, L"NeverShowExt", NULL, NULL, NULL, NULL); if (lError == ERROR_SUCCESS) doHide = TRUE; @@ -1716,13 +1704,10 @@ HRESULT WINAPI CFSFolder::GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO * ppfti HRESULT CFSFolder::_CreateExtensionUIObject(PCUIDLIST_RELATIVE pidl, REFIID riid, LPVOID *ppvOut) { - static const WCHAR formatW[] = {'S','h','e','l','l','E','x','\\', - '{','%','0','8','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 buf[MAX_PATH]; - sprintfW(buf, formatW, riid.Data1, riid.Data2, riid.Data3, + sprintfW(buf, L"ShellEx\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + 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]); diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index 77a2b323a8b..71e5e062eb8 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -141,14 +141,9 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO return E_FAIL; /* my computer and other shell extensions */ - static const 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]; - swprintf(xriid, fmt, + swprintf(xriid, L"CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", 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]); @@ -156,8 +151,6 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO const WCHAR* iconname = NULL; if (_ILIsBitBucket(pidl)) { - static const WCHAR szFull[] = {'F','u','l','l',0}; - static const WCHAR szEmpty[] = {'E','m','p','t','y',0}; CComPtr EnumIDList; CoInitialize(NULL); @@ -175,9 +168,9 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO if (SUCCEEDED(hr) && (hr = EnumIDList->Next(1, &pidl, &itemcount)) == S_OK) { CoTaskMemFree(pidl); - iconname = szFull; + iconname = L"Full"; } else { - iconname = szEmpty; + iconname = L"Empty"; } } @@ -225,12 +218,13 @@ CRegFolderEnum::~CRegFolderEnum() HRESULT CRegFolderEnum::Initialize(LPCWSTR lpszEnumKeyName, DWORD dwFlags) { WCHAR KeyName[MAX_PATH]; - static const WCHAR KeyNameFormat[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace"; if (!(dwFlags & SHCONTF_FOLDERS)) return S_OK; - HRESULT hr = StringCchPrintfW(KeyName, MAX_PATH, KeyNameFormat, lpszEnumKeyName); + HRESULT hr = StringCchPrintfW(KeyName, MAX_PATH, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace", + lpszEnumKeyName); if (FAILED_UNEXPECTEDLY(hr)) return hr; diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp index 6560bae2de2..9a55f0f9fc0 100644 --- a/dll/win32/shell32/iconcache.cpp +++ b/dll/win32/shell32/iconcache.cpp @@ -659,32 +659,26 @@ static int SIC_LoadOverlayIcon(int icon_idx) LPCWSTR iconPath; int iconIdx; - static const WCHAR wszShellIcons[] = { - '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','\\','S','h','e','l','l',' ','I','c','o','n','s',0 - }; - static const WCHAR wszNumFmt[] = {'%','d',0}; - iconPath = swShell32Name; /* default: load icon from shell32.dll */ iconIdx = icon_idx; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszShellIcons, 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", + 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS) { DWORD count = sizeof(buffer); - swprintf(wszIdx, wszNumFmt, icon_idx); + swprintf(wszIdx, L"%d", icon_idx); /* read icon path and index */ if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) { - LPWSTR p = wcschr(buffer, ','); + LPWSTR p = wcschr(buffer, ','); - if (p) - *p++ = 0; + if (p) + *p++ = 0; - iconPath = buffer; - iconIdx = _wtoi(p); + iconPath = buffer; + iconIdx = _wtoi(p); } RegCloseKey(hKeyShellIcons); diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index d5bdf5452e6..955d2af840e 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -25,10 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec); -static const WCHAR wszOpen[] = L"open"; -static const WCHAR wszExe[] = L".exe"; -static const WCHAR wszCom[] = L".com"; - #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, @@ -270,7 +266,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* if (!done || (*fmt == '1')) { /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */ - if (SearchPathW(lpDir, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(lpDir, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) cmd = xlpFile; else cmd = lpFile; @@ -353,7 +349,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* pv = SHLockShared(hmem, 0); chars = swprintf(buf, L":%p", pv); - if (chars >= sizeof(buf) / sizeof(WCHAR)) + if (chars >= ARRAY_SIZE(buf)) ERR("pidl format buffer too small!\n"); used += chars; @@ -547,7 +543,6 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, */ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) { - static const WCHAR wPath[] = L"PATH="; WCHAR *strings, *new_env; WCHAR *p, *p2; int total = wcslen(path) + 1; @@ -558,7 +553,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) while (*p) { int len = wcslen(p) + 1; - if (!_wcsnicmp( p, wPath, 5 )) got_path = TRUE; + if (!_wcsnicmp( p, L"PATH=", 5 )) got_path = TRUE; total += len; p += len; } @@ -576,7 +571,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) { int len = wcslen(p) + 1; memcpy(p2, p, len * sizeof(WCHAR)); - if (!_wcsnicmp( p, wPath, 5 )) + if (!_wcsnicmp( p, L"PATH=", 5 )) { p2[len - 1] = ';'; wcscpy( p2 + len, path ); @@ -587,7 +582,7 @@ static LPWSTR SHELL_BuildEnvW( const WCHAR *path ) } if (!got_path) { - wcscpy(p2, wPath); + wcscpy(p2, L"PATH="); wcscat(p2, path); p2 += wcslen(p2) + 1; } @@ -620,7 +615,7 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) if (res) { // Add ".exe" extension, if extension does not exists - if (PathAddExtensionW(buffer, wszExe)) + if (PathAddExtensionW(buffer, L".exe")) { res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); } @@ -664,20 +659,19 @@ end: */ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classname, LPWSTR command, LONG commandlen) { - static const WCHAR wCommand[] = L"\\command"; HKEY hkeyClass; WCHAR verb[MAX_PATH]; if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass)) return SE_ERR_NOASSOC; - if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, sizeof(verb) / sizeof(verb[0]))) + if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, ARRAY_SIZE(verb))) return SE_ERR_NOASSOC; RegCloseKey(hkeyClass); /* Looking for ...buffer\shell\\command */ wcscat(classname, L"\\shell\\"); wcscat(classname, verb); - wcscat(classname, wCommand); + wcscat(classname, L"\\command"); if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, command, &commandlen) == ERROR_SUCCESS) @@ -688,7 +682,6 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn LPWSTR tmp; WCHAR param[256]; LONG paramlen = sizeof(param); - static const WCHAR wSpace[] = {' ', 0}; /* FIXME: it seems all Windows version don't behave the same here. * the doc states that this ddeexec information can be found after @@ -697,14 +690,14 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn */ /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = strstrW(classname, wCommand); + tmp = strstrW(classname, L"\\command"); tmp[0] = '\0'; wcscat(classname, wDdeexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, param, ¶mlen) == ERROR_SUCCESS) { paramlen /= sizeof(WCHAR); - wcscat(command, wSpace); + wcscat(command, L" "); wcscat(command, param); commandlen += paramlen; } @@ -768,13 +761,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, return 33; } - if (SearchPathW(lpPath, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) + if (SearchPathW(lpPath, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; /* The file was found in the application-supplied default directory (or the system search path) */ } - else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) + else if (lpPath && SearchPathW(NULL, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; @@ -817,7 +810,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, /* See if it's a program - if GetProfileString fails, we skip this * section. Actually, if GetProfileString fails, we've probably * got a lot more to worry about than running a program... */ - if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, sizeof(wBuffer) / sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, ARRAY_SIZE(wBuffer)) > 0) { CharLowerW(wBuffer); tok = wBuffer; @@ -849,7 +842,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, &classnamelen) == ERROR_SUCCESS) { classnamelen /= sizeof(WCHAR); - if (classnamelen == sizeof(classname) / sizeof(WCHAR)) + if (classnamelen == ARRAY_SIZE(classname)) classnamelen--; classname[classnamelen] = '\0'; @@ -897,7 +890,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, { /* Toss the leading dot */ extension++; - if (GetProfileStringW(L"extensions", extension, L"", command, sizeof(command) / sizeof(WCHAR)) > 0) + if (GetProfileStringW(L"extensions", extension, L"", command, ARRAY_SIZE(command)) > 0) { if (wcslen(command) != 0) { @@ -966,33 +959,30 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec unsigned ret = SE_ERR_NOASSOC; BOOL unicode = !(GetVersion() & 0x80000000); - if (strlenW(key) + 1 > sizeof(regkey) / sizeof(regkey[0])) + if (strlenW(key) + 1 > ARRAY_SIZE(regkey)) { FIXME("input parameter %s larger than buffer\n", debugstr_w(key)); return 2; } wcscpy(regkey, key); - static const WCHAR wApplication[] = L"\\application"; - endkeyLen = sizeof(regkey) / sizeof(regkey[0]) - (endkey - regkey); - if (strlenW(wApplication) + 1 > endkeyLen) + endkeyLen = ARRAY_SIZE(regkey) - (endkey - regkey); + if (strlenW(L"\\application") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\application")); return 2; } - wcscpy(endkey, wApplication); + wcscpy(endkey, L"\\application"); applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS) { WCHAR command[1024], fullpath[MAX_PATH]; - static const WCHAR wSo[] = L".so"; - DWORD sizeSo = sizeof(wSo) / sizeof(WCHAR); LPWSTR ptr = NULL; DWORD ret = 0; /* Get application command from start string and find filename of application */ if (*start == '"') { - if (strlenW(start + 1) + 1 > sizeof(command) / sizeof(command[0])) + if (strlenW(start + 1) + 1 > ARRAY_SIZE(command)) { FIXME("size of input parameter %s larger than buffer\n", debugstr_w(start + 1)); @@ -1001,7 +991,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec wcscpy(command, start + 1); if ((ptr = wcschr(command, '"'))) * ptr = 0; - ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); + ret = SearchPathW(NULL, command, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr); } else { @@ -1012,11 +1002,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec int idx = space - start; memcpy(command, start, idx * sizeof(WCHAR)); command[idx] = '\0'; - if ((ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr))) + if ((ret = SearchPathW(NULL, command, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr))) break; } if (!ret) - ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); + ret = SearchPathW(NULL, start, L".exe", ARRAY_SIZE(fullpath), fullpath, &ptr); } if (!ret) @@ -1024,7 +1014,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ERR("Unable to find application path for command %s\n", debugstr_w(start)); return ERROR_ACCESS_DENIED; } - if (strlenW(ptr) + 1 > sizeof(app) / sizeof(app[0])) + if (strlenW(ptr) + 1 > ARRAY_SIZE(app)) { FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr)); return 2; @@ -1032,9 +1022,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec wcscpy(app, ptr); /* Remove extensions (including .so) */ - ptr = app + wcslen(app) - (sizeSo - 1); - if (wcslen(app) >= sizeSo && - !wcscmp(ptr, wSo)) + ptr = app + wcslen(app) - 3; + if (ptr > app && !wcscmp(ptr, L".so")) *ptr = 0; ptr = const_cast(strrchrW(app, '.')); @@ -1042,13 +1031,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec *ptr = 0; } - static const WCHAR wTopic[] = L"\\topic"; - if (strlenW(wTopic) + 1 > endkeyLen) + if (strlenW(L"\\topic") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wTopic)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\topic")); return 2; } - wcscpy(endkey, wTopic); + wcscpy(endkey, L"\\topic"); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { @@ -1104,13 +1092,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - static const WCHAR wIfexec[] = L"\\ifexec"; - if (strlenW(wIfexec) + 1 > endkeyLen) + if (strlenW(L"\\ifexec") + 1 > endkeyLen) { - FIXME("endkey %s overruns buffer\n", debugstr_w(wIfexec)); + FIXME("endkey %s overruns buffer\n", debugstr_w(L"\\ifexec")); return 2; } - strcpyW(endkey, wIfexec); + strcpyW(endkey, L"\\ifexec"); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -1118,8 +1105,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } } - SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen, NULL); - if (resultLen > sizeof(static_res)/sizeof(WCHAR)) + SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen, NULL); + if (resultLen > ARRAY_SIZE(static_res)) { res = dynamic_res = static_cast(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR))); SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL, NULL); @@ -1185,12 +1172,12 @@ static UINT_PTR execute_from_key(LPCWSTR key, LPCWSTR lpFile, WCHAR *env, /* Is there a replace() function anywhere? */ cmdlen /= sizeof(WCHAR); - if (cmdlen >= sizeof(cmd) / sizeof(WCHAR)) - cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1; + if (cmdlen >= ARRAY_SIZE(cmd)) + cmdlen = ARRAY_SIZE(cmd) - 1; cmd[cmdlen] = '\0'; - SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen, + SHELL_ArgifyW(param, ARRAY_SIZE(param), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen, (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); - if (resultLen > sizeof(param) / sizeof(WCHAR)) + if (resultLen > ARRAY_SIZE(param)) ERR("Argify buffer not large enough, truncating\n"); } @@ -1277,11 +1264,11 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR if (lpDirectory) { - GetCurrentDirectoryW(sizeof(old_dir) / sizeof(WCHAR), old_dir); + GetCurrentDirectoryW(ARRAY_SIZE(old_dir), old_dir); SetCurrentDirectoryW(lpDirectory); } - retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, res, MAX_PATH, NULL, NULL, NULL, NULL); + retval = SHELL_FindExecutable(lpDirectory, lpFile, L"open", res, MAX_PATH, NULL, NULL, NULL, NULL); if (retval > 32) strcpyW(lpResult, res); @@ -1522,7 +1509,7 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei ) i = 0; while (1) { - r = RegEnumKeyW(hkeycm, i++, szguid, sizeof(szguid) / sizeof(szguid[0])); + r = RegEnumKeyW(hkeycm, i++, szguid, ARRAY_SIZE(szguid)); if (r != ERROR_SUCCESS) break; @@ -1569,7 +1556,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); wcmd[0] = '\0'; - done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen, + done = SHELL_ArgifyW(wcmd, ARRAY_SIZE(wcmd), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen, (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); if (!done && wszApplicationName[0]) { @@ -1583,7 +1570,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN else strcatW(wcmd, wszApplicationName); } - if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) + if (resultLen > ARRAY_SIZE(wcmd)) ERR("Argify buffer not large enough... truncating\n"); return execfunc(wcmd, NULL, FALSE, psei, psei_out); } @@ -1603,22 +1590,21 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen) { - static const WCHAR wExplorer[] = L"explorer.exe"; WCHAR buffer[MAX_PATH]; BOOL appKnownSingular = FALSE; /* last chance to translate IDList: now also allow CLSID paths */ - if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { + if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, ARRAY_SIZE(buffer)))) { if (buffer[0] == ':' && buffer[1] == ':') { /* open shell folder for the specified class GUID */ if (strlenW(buffer) + 1 > parametersLen) ERR("parameters len exceeds buffer size (%i > %i), truncating\n", lstrlenW(buffer) + 1, parametersLen); lstrcpynW(wszParameters, buffer, parametersLen); - if (strlenW(wExplorer) > dwApplicationNameLen) - ERR("application len exceeds buffer size (%i > %i), truncating\n", - lstrlenW(wExplorer) + 1, dwApplicationNameLen); - lstrcpynW(wszApplicationName, wExplorer, dwApplicationNameLen); + if (strlenW(L"explorer.exe") > dwApplicationNameLen) + ERR("application len exceeds buffer size (%i), truncating\n", + dwApplicationNameLen); + lstrcpynW(wszApplicationName, L"explorer.exe", dwApplicationNameLen); appKnownSingular = TRUE; sei->fMask &= ~SEE_MASK_INVOKEIDLIST; @@ -1686,8 +1672,6 @@ static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPC static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { - static const WCHAR wShell[] = L"\\shell\\"; - static const WCHAR wCommand[] = L"\\command"; UINT_PTR retval; WCHAR *lpstrProtocol; LPCWSTR lpstrRes; @@ -1702,17 +1686,17 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEIN TRACE("Got URL: %s\n", debugstr_w(lpFile)); /* Looking for ...\shell\\command */ - len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1; + len = iSize + lstrlenW(L"\\shell\\") + lstrlenW(L"\\command") + 1; if (psei->lpVerb && *psei->lpVerb) len += lstrlenW(psei->lpVerb); else - len += lstrlenW(wszOpen); + len += lstrlenW(L"open"); lpstrProtocol = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); memcpy(lpstrProtocol, lpFile, iSize * sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; - strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : wszOpen); - strcatW(lpstrProtocol, wCommand); + strcatW(lpstrProtocol, L"\\shell\\"); + strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : L"open"); + strcatW(lpstrProtocol, L"\\command"); retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters, wcmd, execfunc, psei, psei_out); @@ -1728,14 +1712,14 @@ static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) error_code = GetLastError(); if (retval == SE_ERR_NOASSOC) - LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, sizeof(msg) / sizeof(WCHAR)); + LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, ARRAY_SIZE(msg)); else FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, NULL, error_code, LANG_USER_DEFAULT, msg, - sizeof(msg) / sizeof(WCHAR), + ARRAY_SIZE(msg), (va_list*)msgArguments); MessageBoxW(hwnd, msg, NULL, MB_ICONERROR); @@ -1774,9 +1758,9 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) WCHAR parametersBuffer[1024], dirBuffer[MAX_PATH], wcmdBuffer[1024]; WCHAR *wszApplicationName, *wszParameters, *wszDir, *wcmd; DWORD dwApplicationNameLen = MAX_PATH + 2; - DWORD parametersLen = sizeof(parametersBuffer) / sizeof(WCHAR); - DWORD dirLen = sizeof(dirBuffer) / sizeof(WCHAR); - DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR); + DWORD parametersLen = ARRAY_SIZE(parametersBuffer); + DWORD dirLen = ARRAY_SIZE(dirBuffer); + DWORD wcmdLen = ARRAY_SIZE(wcmdBuffer); DWORD len; SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ WCHAR wfileName[MAX_PATH]; @@ -2112,7 +2096,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) if (lpQuotedFile) { retval = SHELL_FindExecutable(sei_tmp.lpDirectory, L"explorer", - wszOpen, wExec, MAX_PATH, + L"open", wExec, MAX_PATH, NULL, &env, NULL, NULL); if (retval > 32) { @@ -2480,20 +2464,20 @@ HRESULT WINAPI ShellExecCmdLine( StringCchCopyW(szFile, _countof(szFile), szFile2); } else if (SearchPathW(NULL, szFile, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, szFile, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, szFile, wszCom, _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, szFile, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, szFile, L".com", _countof(szFile2), szFile2, NULL) || SearchPathW(pwszStartDir, szFile, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, szFile, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, szFile, wszCom, _countof(szFile2), szFile2, NULL)) + SearchPathW(pwszStartDir, szFile, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(pwszStartDir, szFile, L".com", _countof(szFile2), szFile2, NULL)) { StringCchCopyW(szFile, _countof(szFile), szFile2); } else if (SearchPathW(NULL, lpCommand, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(NULL, lpCommand, wszCom, _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, lpCommand, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(NULL, lpCommand, L".com", _countof(szFile2), szFile2, NULL) || SearchPathW(pwszStartDir, lpCommand, NULL, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) || - SearchPathW(pwszStartDir, lpCommand, wszCom, _countof(szFile2), szFile2, NULL)) + SearchPathW(pwszStartDir, lpCommand, L".exe", _countof(szFile2), szFile2, NULL) || + SearchPathW(pwszStartDir, lpCommand, L".com", _countof(szFile2), szFile2, NULL)) { StringCchCopyW(szFile, _countof(szFile), szFile2); pchParams = NULL; diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index 59aa0cf2b09..fbd06a767b8 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -35,9 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define NEW_FILENAME_ON_COPY_TRIES 100 -static const WCHAR wWildcardFile[] = {'*',0}; -static const WCHAR wWildcardChars[] = {'*','?',0}; - typedef struct { SHFILEOPSTRUCTW *req; @@ -87,8 +84,6 @@ static BOOL _FileOpCount(FILE_OPERATION *op, LPWSTR pwszBuf, BOOL bFolder, DWORD /* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations */ -static const WCHAR CONFIRM_MSG_PROP[] = {'W','I','N','E','_','C','O','N','F','I','R','M',0}; - struct confirm_msg_info { LPWSTR lpszText; @@ -139,7 +134,7 @@ static INT_PTR ConfirmMsgBox_Paint(HWND hDlg) /* this will remap the rect to dialog coords */ MapWindowPoints(GetDlgItem(hDlg, IDC_YESTOALL_MESSAGE), hDlg, (LPPOINT)&r, 2); hOldFont = (HFONT)SelectObject(hdc, (HFONT)SendDlgItemMessageW(hDlg, IDC_YESTOALL_MESSAGE, WM_GETFONT, 0, 0)); - DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); + DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, L"WINE_CONFIRM"), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); SelectObject(hdc, hOldFont); EndPaint(hDlg, &ps); @@ -157,7 +152,7 @@ static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam) SetWindowTextW(hDlg, info->lpszCaption); ShowWindow(GetDlgItem(hDlg, IDC_YESTOALL_MESSAGE), SW_HIDE); - SetPropW(hDlg, CONFIRM_MSG_PROP, info->lpszText); + SetPropW(hDlg, L"WINE_CONFIRM", info->lpszText); SendDlgItemMessageW(hDlg, IDC_YESTOALL_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); /* compute the text height and resize the dialog */ @@ -379,7 +374,7 @@ BOOL SHELL_DeleteDirectoryW(FILE_OPERATION *op, LPCWSTR pszDir, BOOL bShowUI) WCHAR szTemp[MAX_PATH]; /* Make sure the directory exists before eventually prompting the user */ - PathCombineW(szTemp, pszDir, wWildcardFile); + PathCombineW(szTemp, pszDir, L"*"); hFind = FindFirstFileW(szTemp, &wfd); if (hFind == INVALID_HANDLE_VALUE) return FALSE; @@ -960,7 +955,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly) { WIN32_FIND_DATAW wfd; - BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, wWildcardChars)); + BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, L"*?")); DWORD dwAttr = INVALID_FILE_ATTRIBUTES; HANDLE hFind = FindFirstFileW(pName, &wfd); @@ -1238,7 +1233,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) } /* parse wildcard files if they are in the filename */ - if (StrPBrkW(szCurFile, wWildcardChars)) + if (StrPBrkW(szCurFile, L"*?")) { parse_wildcard_files(flList, szCurFile, &i); flList->bAnyFromWildcard = TRUE; @@ -1318,8 +1313,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - static const WCHAR wildCardFiles[] = {'*','.','*',0}; - if (IsDotDir(feFrom->szFilename)) return; @@ -1364,7 +1357,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST szTo[lstrlenW(szTo) + 1] = '\0'; SHNotifyCreateDirectoryW(szTo, NULL); - PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); + PathCombineW(szFrom, feFrom->szFullPath, L"*.*"); szFrom[lstrlenW(szFrom) + 1] = '\0'; ZeroMemory(&flFromNew, sizeof(FILE_LIST)); @@ -1582,9 +1575,8 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE if (flFrom->dwNumFiles > 1) { WCHAR tmp[8]; - const WCHAR format[] = {'%','d',0}; - wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles); + wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), L"%d", flFrom->dwNumFiles); return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL); } else @@ -1704,14 +1696,12 @@ static void move_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - static const WCHAR wildCardFiles[] = {'*','.','*',0}; - if (IsDotDir(feFrom->szFilename)) return; SHNotifyCreateDirectoryW(szDestPath, NULL); - PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); + PathCombineW(szFrom, feFrom->szFullPath, L"*.*"); szFrom[lstrlenW(szFrom) + 1] = '\0'; lstrcpyW(szTo, szDestPath); diff --git a/dll/win32/shell32/wine/brsfolder.c b/dll/win32/shell32/wine/brsfolder.c index 84c7c63a5f0..17a0236b944 100644 --- a/dll/win32/shell32/wine/brsfolder.c +++ b/dll/win32/shell32/wine/brsfolder.c @@ -117,12 +117,6 @@ static void FillTreeView(browse_info*, LPSHELLFOLDER, static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *, LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM); -static const WCHAR szBrowseFolderInfo[] = { - '_','_','W','I','N','E','_', - 'B','R','S','F','O','L','D','E','R','D','L','G','_', - 'I','N','F','O',0 -}; - static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags) { return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0); @@ -772,7 +766,7 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info ) LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo; info->hWnd = hWnd; - SetPropW( hWnd, szBrowseFolderInfo, info ); + SetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO", info ); if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n"); @@ -1285,7 +1279,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, if (msg == WM_INITDIALOG) return BrsFolder_OnCreate( hWnd, (browse_info*) lParam ); - info = GetPropW( hWnd, szBrowseFolderInfo ); + info = GetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO" ); switch (msg) { @@ -1348,13 +1342,6 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, return FALSE; } -#ifndef __REACTOS__ -static const WCHAR swBrowseTemplateName[] = { - 'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; -static const WCHAR swNewBrowseTemplateName[] = { - 'S','H','N','E','W','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; -#endif - /************************************************************************* * SHBrowseForFolderA [SHELL32.@] * SHBrowseForFolder [SHELL32.@] diff --git a/dll/win32/shell32/wine/classes.c b/dll/win32/shell32/wine/classes.c index b2a5ca54256..df2099914da 100644 --- a/dll/win32/shell32/wine/classes.c +++ b/dll/win32/shell32/wine/classes.c @@ -127,10 +127,6 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP return TRUE; } -static const WCHAR swShell[] = {'s','h','e','l','l','\\',0}; -static const WCHAR swOpen[] = {'o','p','e','n',0}; -static const WCHAR swCommand[] = {'\\','c','o','m','m','a','n','d',0}; - BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) { WCHAR sTemp[MAX_PATH]; @@ -147,12 +143,12 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l size=len; *szDest='\0'; - if (!RegQueryValueW(hkeyClass, swShell, szDest, &size) && *szDest) + if (!RegQueryValueW(hkeyClass, L"shell\\", szDest, &size) && *szDest) { /* The MSDN says to first try the default verb */ - lstrcpyW(sTemp, swShell); + lstrcpyW(sTemp, L"shell\\"); lstrcatW(sTemp, szDest); - lstrcatW(sTemp, swCommand); + lstrcatW(sTemp, L"\\command"); if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); @@ -162,13 +158,11 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l } /* then fallback to 'open' */ - lstrcpyW(sTemp, swShell); - lstrcatW(sTemp, swOpen); - lstrcatW(sTemp, swCommand); + lstrcpyW(sTemp, L"shell\\open\\command"); if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); - lstrcpynW(szDest, swOpen, len); + lstrcpynW(szDest, L"open", len); TRACE("default verb=open\n"); return TRUE; } @@ -213,9 +207,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0]))) { WCHAR sTemp[MAX_PATH]; - lstrcpyW(sTemp, swShell); + lstrcpyW(sTemp, L"shell\\"); lstrcatW(sTemp, sTempVerb); - lstrcatW(sTemp, swCommand); + lstrcatW(sTemp, L"\\command"); ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len)); } if (szClass) @@ -293,7 +287,6 @@ static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, i BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx) { - static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0}; HKEY hkey; WCHAR sTemp[MAX_PATH]; BOOL ret = FALSE; @@ -301,7 +294,7 @@ BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int TRACE("%s\n",debugstr_w(szClass) ); lstrcpynW(sTemp, szClass, MAX_PATH); - lstrcatW(sTemp, swDefaultIcon); + lstrcatW(sTemp, L"\\DefaultIcon"); if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) { @@ -346,8 +339,6 @@ BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int* p * * Gets the name of a registered class */ -static const WCHAR swEmpty[] = {0}; - BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) { HKEY hkey; @@ -376,10 +367,8 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) if (HCR_RegOpenClassIDKey(riid, &hkey)) #endif { - static const WCHAR wszLocalizedString[] = - { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; - if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || - !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) + if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) || + !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len)) { ret = TRUE; } @@ -524,12 +513,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) LPOLESTR pwszCLSID; LONG lResult; DWORD dwTemp, dwLen; - static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszCallForAttributes[] = { - 'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 }; - WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-', - '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0', - '0','0','0','4','6','}','\\','S','h','e','l','l','F','o','l','d','e','r',0 }; + WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder"; TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes); @@ -560,7 +544,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) #endif dwLen = sizeof(DWORD); - lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); + lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen); if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) { LPSHELLFOLDER psfDesktop, psfFolder; HRESULT hr; @@ -578,7 +562,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) } if (FAILED(hr)) return FALSE; } else { - lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); + lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen); RegCloseKey(hSFKey); if (lResult == ERROR_SUCCESS) { *pdwAttributes &= dwTemp; diff --git a/dll/win32/shell32/wine/control.c b/dll/win32/shell32/wine/control.c index 9e8852c3a25..34c7b3bcf5b 100644 --- a/dll/win32/shell32/wine/control.c +++ b/dll/win32/shell32/wine/control.c @@ -697,20 +697,17 @@ static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) { + static const WCHAR wszRegPath[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"; HANDLE h; WIN32_FIND_DATAW fd; WCHAR buffer[MAX_PATH]; - static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0}; - static const WCHAR wszRegPath[] = {'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', - '\\','C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','C','p','l','s',0}; WCHAR *p; /* first add .cpl files in the system directory */ GetSystemDirectoryW( buffer, MAX_PATH ); p = buffer + strlenW(buffer); *p++ = '\\'; - lstrcpyW(p, wszAllCpl); + lstrcpyW(p, L"*.cpl"); if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) { do { diff --git a/dll/win32/shell32/wine/shell32_main.c b/dll/win32/shell32/wine/shell32_main.c index 616356c00b1..b31dedcba2c 100644 --- a/dll/win32/shell32/wine/shell32_main.c +++ b/dll/win32/shell32/wine/shell32_main.c @@ -557,10 +557,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, /* get the type name */ if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) { - static const WCHAR szFolder[] = { 'F','o','l','d','e','r',0 }; - static const WCHAR szFile[] = { 'F','i','l','e',0 }; - static const WCHAR szSpaceFile[] = { ' ','f','i','l','e',0 }; - if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL)) { char ftype[80]; @@ -571,7 +567,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, else { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - strcatW (psfi->szTypeName, szFolder); + strcatW (psfi->szTypeName, L"Folder"); else { WCHAR sTemp[64]; @@ -580,7 +576,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, if (sTemp[0] == 0 || (sTemp[0] == '.' && sTemp[1] == 0)) { /* "name" or "name." => "File" */ - lstrcpynW (psfi->szTypeName, szFile, 64); + lstrcpynW (psfi->szTypeName, L"File", 64); } else if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) @@ -588,11 +584,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, if (sTemp[0]) { lstrcpynW (psfi->szTypeName, sTemp, 64); - strcatW (psfi->szTypeName, szSpaceFile); + strcatW (psfi->szTypeName, L" file"); } else { - lstrcpynW (psfi->szTypeName, szFile, 64); + lstrcpynW (psfi->szTypeName, L"File", 64); } } } @@ -639,7 +635,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, else { WCHAR* szExt; - static const WCHAR p1W[] = {'%','1',0}; WCHAR sTemp [MAX_PATH]; szExt = PathFindExtensionW(szFullPath); @@ -648,7 +643,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon)) { - if (lstrcmpW(p1W, sTemp)) + if (lstrcmpW(L"%1", sTemp)) strcpyW(psfi->szDisplayName, sTemp); else { @@ -697,15 +692,13 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); else { - static const WCHAR p1W[] = {'%','1',0}; - psfi->iIcon = 0; szExt = PathFindExtensionW(sTemp); if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx)) { - if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ + if (!lstrcmpW(L"%1",sTemp)) /* icon is in the file */ strcpyW(sTemp, szFullPath); if (flags & SHGFI_SYSICONINDEX) @@ -1138,12 +1131,14 @@ INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM */ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { +#ifdef __REACTOS__ + static DWORD cxLogoBmp; static DWORD cyLogoBmp, cyLineBmp; static HBITMAP hLogoBmp, hLineBmp; static HWND hWndAuthors; - switch(msg) + switch (msg) { case WM_INITDIALOG: { @@ -1151,7 +1146,6 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM if (info) { - const WCHAR szRegKey[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; HKEY hRegKey; MEMORYSTATUSEX MemStat; WCHAR szAppTitle[512]; @@ -1171,51 +1165,49 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM } hLineBmp = (HBITMAP)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IDB_LINEBAR), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - if(hLogoBmp && hLineBmp) + if (hLogoBmp && hLineBmp) { BITMAP bmpLogo; - GetObject( hLogoBmp, sizeof(BITMAP), &bmpLogo ); + GetObject(hLogoBmp, sizeof(BITMAP), &bmpLogo); cxLogoBmp = bmpLogo.bmWidth; cyLogoBmp = bmpLogo.bmHeight; - GetObject( hLineBmp, sizeof(BITMAP), &bmpLogo ); + GetObject(hLineBmp, sizeof(BITMAP), &bmpLogo); cyLineBmp = bmpLogo.bmHeight; } // Set App-specific stuff (icon, app name, szOtherStuff string) SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); - GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) ); - swprintf( szAppTitle, szAppTitleTemplate, info->szApp ); - SetWindowTextW( hWnd, szAppTitle ); + GetWindowTextW(hWnd, szAppTitleTemplate, ARRAY_SIZE(szAppTitleTemplate)); + swprintf(szAppTitle, szAppTitleTemplate, info->szApp); + SetWindowTextW(hWnd, szAppTitle); - SetDlgItemTextW( hWnd, IDC_ABOUT_APPNAME, info->szApp ); -#ifdef __REACTOS__ - SetDlgItemTextW( hWnd, IDC_ABOUT_VERSION, info->szOSVersion ); -#endif - SetDlgItemTextW( hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff ); + SetDlgItemTextW(hWnd, IDC_ABOUT_APPNAME, info->szApp); + SetDlgItemTextW(hWnd, IDC_ABOUT_VERSION, info->szOSVersion); + SetDlgItemTextW(hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff); // Set the registered user and organization name - if(RegOpenKeyExW( HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hRegKey ) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS) { - SetRegTextData( hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME ); - SetRegTextData( hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME ); -#ifdef __REACTOS__ - if(GetWindowTextLengthW( GetDlgItem( hWnd, IDC_ABOUT_REG_USERNAME ) ) == 0 && - GetWindowTextLengthW( GetDlgItem( hWnd, IDC_ABOUT_REG_ORGNAME ) ) == 0) - { - ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_REG_TO ), SW_HIDE ); - } -#endif + SetRegTextData(hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME); + SetRegTextData(hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME); - RegCloseKey( hRegKey ); + if (GetWindowTextLengthW(GetDlgItem(hWnd, IDC_ABOUT_REG_USERNAME)) == 0 && + GetWindowTextLengthW(GetDlgItem(hWnd, IDC_ABOUT_REG_ORGNAME)) == 0) + { + ShowWindow(GetDlgItem(hWnd, IDC_ABOUT_REG_TO), SW_HIDE); + } + + RegCloseKey(hRegKey); } // Set the value for the installed physical memory MemStat.dwLength = sizeof(MemStat); - if( GlobalMemoryStatusEx(&MemStat) ) + if (GlobalMemoryStatusEx(&MemStat)) { WCHAR szBuf[12]; @@ -1239,24 +1231,24 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM MemStat.ullTotalPhys /= 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"PB" ); + wcscpy(szUnits, L"PB"); } else { dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"TB" ); + wcscpy(szUnits, L"TB"); } } else { dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"GB" ); + wcscpy(szUnits, L"GB"); } // We need the decimal point of the current locale to display the RAM size correctly if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, - sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0) + ARRAY_SIZE(szDecimalSeparator)) > 0) { UCHAR uDecimals; UINT uIntegral; @@ -1271,16 +1263,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM else { // We're dealing with MBs, don't show any decimals - swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); + swprintf(szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024); } - SetDlgItemTextW( hWnd, IDC_ABOUT_PHYSMEM, szBuf); + SetDlgItemTextW(hWnd, IDC_ABOUT_PHYSMEM, szBuf); } // Add the Authors dialog - hWndAuthors = CreateDialogW( shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc ); - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); + hWndAuthors = CreateDialogW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText); } return TRUE; @@ -1288,7 +1280,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM case WM_PAINT: { - if(hLogoBmp && hLineBmp) + if (hLogoBmp && hLineBmp) { PAINTSTRUCT ps; HDC hdc; @@ -1298,7 +1290,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM hdc = BeginPaint(hWnd, &ps); hdcMem = CreateCompatibleDC(hdc); - if(hdcMem) + if (hdcMem) { hOldObj = SelectObject(hdcMem, hLogoBmp); BitBlt(hdc, 0, 0, cxLogoBmp, cyLogoBmp, hdcMem, 0, 0, SRCCOPY); @@ -1312,7 +1304,8 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM EndPaint(hWnd, &ps); } - }; break; + break; + } case WM_COMMAND: { @@ -1328,29 +1321,32 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM static BOOL bShowingAuthors = FALSE; WCHAR szAuthorsText[20]; - if(bShowingAuthors) + if (bShowingAuthors) { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_HIDE ); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + ShowWindow(hWndAuthors, SW_HIDE); } else { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_SHOW ); + LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, ARRAY_SIZE(szAuthorsText)); + ShowWindow(hWndAuthors, SW_SHOW); } - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); + SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText); bShowingAuthors = !bShowingAuthors; return TRUE; } } - }; break; + break; + } case WM_CLOSE: EndDialog(hWnd, TRUE); break; } +#endif // __REACTOS__ + return 0; } diff --git a/dll/win32/shell32/wine/shellole.c b/dll/win32/shell32/wine/shellole.c index ae9a39bb8fa..6ede109f92e 100644 --- a/dll/win32/shell32/wine/shellole.c +++ b/dll/win32/shell32/wine/shellole.c @@ -113,10 +113,7 @@ HRESULT WINAPI SHCoCreateInstance( CLSID iid; const CLSID * myclsid = clsid; WCHAR sKeyName[MAX_PATH]; - static const WCHAR sCLSID[] = {'C','L','S','I','D','\\','\0'}; WCHAR sClassID[60]; - static const WCHAR sInProcServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'}; - static const WCHAR sLoadWithoutCOM[] = {'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'}; WCHAR sDllPath[MAX_PATH]; HKEY hKey = 0; DWORD dwSize; @@ -144,16 +141,14 @@ HRESULT WINAPI SHCoCreateInstance( } /* we look up the dll path in the registry */ - SHStringFromGUIDW(myclsid, sClassID, sizeof(sClassID)/sizeof(WCHAR)); - lstrcpyW(sKeyName, sCLSID); - lstrcatW(sKeyName, sClassID); - lstrcatW(sKeyName, sInProcServer32); + SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID)); + swprintf(sKeyName, L"CLSID\\%s\\InprocServer32", sClassID); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) return E_ACCESSDENIED; /* if a special registry key is set, we load a shell extension without help of OLE32 */ - if (!SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0)) + if (!SHQueryValueExW(hKey, L"LoadWithoutCOM", 0, 0, 0, 0)) { /* load an external dll without ole32 */ HANDLE hLibrary; diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 0b3965711c2..fde33759c2a 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -809,7 +809,6 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR n void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) { #ifdef __REACTOS__ - static const WCHAR szExplorerKey[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer"; INT ret; WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80]; WCHAR szPath[MAX_PATH]; @@ -884,7 +883,8 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) TRACE("Users Recent dir %S\n", szLinkDir); /* open Explorer key */ - error = RegCreateKeyExW(HKEY_CURRENT_USER, szExplorerKey, 0, NULL, 0, + error = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer", + 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &hExplorerKey, NULL); if (error) { @@ -1613,17 +1613,6 @@ BOOL WINAPI DAD_ShowDragImage(BOOL bShow) return FALSE; } -static const WCHAR szwCabLocation[] = { - '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','\\', - 'C','a','b','i','n','e','t','S','t','a','t','e',0 -}; - -static const WCHAR szwSettings[] = { 'S','e','t','t','i','n','g','s',0 }; - /************************************************************************* * ReadCabinetState [SHELL32.651] NT 4.0 * @@ -1638,11 +1627,11 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length) if( (cs == NULL) || (length < (int)sizeof(*cs)) ) return FALSE; - r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey ); + r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey ); if( r == ERROR_SUCCESS ) { type = REG_BINARY; - r = RegQueryValueExW( hkey, szwSettings, + r = RegQueryValueExW( hkey, L"Settings", NULL, &type, (LPBYTE)cs, (LPDWORD)&length ); RegCloseKey( hkey ); @@ -1685,11 +1674,11 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs) if( cs == NULL ) return FALSE; - r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0, + r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); if( r == ERROR_SUCCESS ) { - r = RegSetValueExW( hkey, szwSettings, 0, + r = RegSetValueExW( hkey, L"Settings", 0, REG_BINARY, (LPBYTE) cs, cs->cLength); RegCloseKey( hkey ); @@ -2021,7 +2010,6 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_if */ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj) { - static const WCHAR szPropSheetSubKey[] = {'s','h','e','l','l','e','x','\\','P','r','o','p','e','r','t','y','S','h','e','e','t','H','a','n','d','l','e','r','s',0}; WCHAR szHandler[64]; DWORD dwHandlerLen; WCHAR szClsidHandler[39]; @@ -2044,7 +2032,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ if (lRet != ERROR_SUCCESS) return NULL; - lRet = RegOpenKeyExW(hkBase, szPropSheetSubKey, 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers); + lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers); RegCloseKey(hkBase); if (lRet == ERROR_SUCCESS) { @@ -2316,8 +2304,6 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, const WCHAR *basename; WCHAR *dst_basename; int i=2; - static const WCHAR lnkformat[] = {'%','s','.','l','n','k',0}; - static const WCHAR lnkformatnum[] = {'%','s',' ','(','%','d',')','.','l','n','k',0}; TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir), pszName, pfMustCopy, uFlags); @@ -2349,11 +2335,11 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, dst_basename = pszName + strlenW(pszName); - snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformat, basename); + snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename); while (GetFileAttributesW(pszName) != INVALID_FILE_ATTRIBUTES) { - snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformatnum, basename, i); + snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i); i++; } diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c index 7745285af6e..736092b20a5 100644 --- a/dll/win32/shell32/wine/shellpath.c +++ b/dll/win32/shell32/wine/shellpath.c @@ -58,6 +58,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); static const BOOL is_win64 = sizeof(void *) > sizeof(int); #ifdef __REACTOS__ + /* FIXME: Remove this */ typedef enum _NT_PRODUCT_TYPE { @@ -70,7 +71,6 @@ typedef enum _NT_PRODUCT_TYPE static BOOL DoGetProductType(PNT_PRODUCT_TYPE ProductType) { - static const WCHAR ProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"; HKEY hKey; LONG error; WCHAR szValue[9]; @@ -85,7 +85,7 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType) *ProductType = NtProductServer; - error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ProductOptions, 0, KEY_READ, &hKey); + error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_READ, &hKey); if (error) return FALSE; @@ -104,7 +104,9 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType) RegCloseKey(hKey); return TRUE; } -#endif + +#endif // __REACTOS__ + /* ########## Combining and Constructing paths ########## */ @@ -370,14 +372,12 @@ BOOL PathIsExeW (LPCWSTR lpszPath) LPCWSTR lpszExtension = PathGetExtensionW(lpszPath); int i; static const WCHAR lpszExtensions[][4] = - {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'}, - {'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'}, - {'s','c','r','\0'}, {'\0'} }; + {L"exe", L"com", L"pif", L"cmd", L"bat", L"scf", L"scr", L"" }; TRACE("path=%s\n",debugstr_w(lpszPath)); for(i=0; lpszExtensions[i][0]; i++) - if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE; + if (!wcsicmp(lpszExtension,lpszExtensions[i])) return TRUE; return FALSE; } @@ -507,9 +507,7 @@ BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR sh /* now try to make it unique */ while (PathFileExistsW(retW)) { - static const WCHAR fmtW[] = {'%','s',' ','(','%','d',')','%','s',0}; - - sprintfW(retW, fmtW, pathW, i, ext); + sprintfW(retW, L"%s (%d)%s", pathW, i, ext); i++; } @@ -813,125 +811,28 @@ LONG WINAPI PathProcessCommandAW ( ########## special ########## */ -static const WCHAR szCurrentVersion[] = {'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 Administrative_ToolsW[] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR AppDataW[] = {'A','p','p','D','a','t','a','\0'}; +/* !! MISSING Win2k3-compatible paths from the list below; absent from Wine !! */ #ifndef __REACTOS__ -static const WCHAR AppData_LocalLowW[] = {'A','p','p','D','a','t','a','\\','L','o','c','a','l','L','o','w','\0'}; -static const WCHAR Application_DataW[] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}; +static const WCHAR Application_DataW[] = L"Application Data"; +static const WCHAR Local_Settings_Application_DataW[] = L"Local Settings\\Application Data"; +static const WCHAR Local_Settings_HistoryW[] = L"Local Settings\\History"; +static const WCHAR Local_Settings_Temporary_Internet_FilesW[] = L"Local Settings\\Temporary Internet Files"; +static const WCHAR MusicW[] = L"Music"; +static const WCHAR PicturesW[] = L"Pictures"; +static const WCHAR Program_FilesW[] = L"Program Files"; +static const WCHAR Program_Files_Common_FilesW[] = L"Program Files\\Common Files"; +static const WCHAR Start_Menu_ProgramsW[] = L"Start Menu\\Programs"; +static const WCHAR Start_Menu_Admin_ToolsW[] = L"Start Menu\\Programs\\Administrative Tools"; +static const WCHAR Start_Menu_StartupW[] = L"Start Menu\\Programs\\StartUp"; #endif -static const WCHAR CacheW[] = {'C','a','c','h','e','\0'}; -static const WCHAR CD_BurningW[] = {'C','D',' ','B','u','r','n','i','n','g','\0'}; -static const WCHAR Common_Administrative_ToolsW[] = {'C','o','m','m','o','n',' ','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR Common_AppDataW[] = {'C','o','m','m','o','n',' ','A','p','p','D','a','t','a','\0'}; -static const WCHAR Common_DesktopW[] = {'C','o','m','m','o','n',' ','D','e','s','k','t','o','p','\0'}; -static const WCHAR Common_DocumentsW[] = {'C','o','m','m','o','n',' ','D','o','c','u','m','e','n','t','s','\0'}; -static const WCHAR Common_FavoritesW[] = {'C','o','m','m','o','n',' ','F','a','v','o','r','i','t','e','s','\0'}; -static const WCHAR CommonFilesDirW[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r','\0'}; -static const WCHAR CommonFilesDirX86W[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}; -static const WCHAR CommonMusicW[] = {'C','o','m','m','o','n','M','u','s','i','c','\0'}; -static const WCHAR CommonPicturesW[] = {'C','o','m','m','o','n','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Common_ProgramsW[] = {'C','o','m','m','o','n',' ','P','r','o','g','r','a','m','s','\0'}; -static const WCHAR Common_StartUpW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t','U','p','\0'}; -static const WCHAR Common_Start_MenuW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t',' ','M','e','n','u','\0'}; -static const WCHAR Common_TemplatesW[] = {'C','o','m','m','o','n',' ','T','e','m','p','l','a','t','e','s','\0'}; -static const WCHAR CommonVideoW[] = {'C','o','m','m','o','n','V','i','d','e','o','\0'}; + +/* Long strings that are repeated many times: keep them here */ +static const WCHAR szSHFolders[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; +static const WCHAR szSHUserFolders[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; #ifndef __REACTOS__ -static const WCHAR ContactsW[] = {'C','o','n','t','a','c','t','s','\0'}; +static const WCHAR szKnownFolderDescriptions[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions"; +static const WCHAR szKnownFolderRedirections[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; #endif -static const WCHAR CookiesW[] = {'C','o','o','k','i','e','s','\0'}; -static const WCHAR DesktopW[] = {'D','e','s','k','t','o','p','\0'}; -#ifndef __REACTOS__ -static const WCHAR DocumentsW[] = {'D','o','c','u','m','e','n','t','s','\0'}; -static const WCHAR DownloadsW[] = {'D','o','w','n','l','o','a','d','s','\0'}; -#endif -static const WCHAR FavoritesW[] = {'F','a','v','o','r','i','t','e','s','\0'}; -static const WCHAR FontsW[] = {'F','o','n','t','s','\0'}; -static const WCHAR HistoryW[] = {'H','i','s','t','o','r','y','\0'}; -#ifndef __REACTOS__ -static const WCHAR LinksW[] = {'L','i','n','k','s','\0'}; -#endif -static const WCHAR Local_AppDataW[] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'}; -#ifndef __REACTOS__ -static const WCHAR Local_Settings_Application_DataW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}; -#endif -static const WCHAR Local_Settings_CD_BurningW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\\','M','i','c','r','o','s','o','f','t','\\','C','D',' ','B','u','r','n','i','n','g','\0'}; -#ifndef __REACTOS__ -static const WCHAR Local_Settings_HistoryW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','H','i','s','t','o','r','y','\0'}; -static const WCHAR Local_Settings_Temporary_Internet_FilesW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','T','e','m','p','o','r','a','r','y',' ','I','n','t','e','r','n','e','t',' ','F','i','l','e','s','\0'}; -static const WCHAR Microsoft_Windows_GameExplorerW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','G','a','m','e','E','x','p','l','o','r','e','r','\0'}; -static const WCHAR Microsoft_Windows_LibrariesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','L','i','b','r','a','r','i','e','s','\0'}; -static const WCHAR Microsoft_Windows_RingtonesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','R','i','n','g','t','o','n','e','s','\0'}; -static const WCHAR MusicW[] = {'M','u','s','i','c','\0'}; -static const WCHAR Music_PlaylistsW[] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'}; -static const WCHAR Music_Sample_MusicW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'}; -static const WCHAR Music_Sample_PlaylistsW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','P','l','a','y','l','i','s','t','s','\0'}; -#endif -static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'}; -static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR My_VideoW[] = {'M','y',' ','V','i','d','e','o','\0'}; -static const WCHAR NetHoodW[] = {'N','e','t','H','o','o','d','\0'}; -static const WCHAR OEM_LinksW[] = {'O','E','M',' ','L','i','n','k','s','\0'}; -static const WCHAR PersonalW[] = {'P','e','r','s','o','n','a','l','\0'}; -#ifndef __REACTOS__ -static const WCHAR PicturesW[] = {'P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Pictures_Sample_PicturesW[] = {'P','i','c','t','u','r','e','s','\\','S','a','m','p','l','e',' ','P','i','c','t','u','r','e','s','\0'}; -static const WCHAR Pictures_Slide_ShowsW[] = {'P','i','c','t','u','r','e','s','\\','S','l','i','d','e',' ','S','h','o','w','s','\0'}; -#endif -static const WCHAR PrintHoodW[] = {'P','r','i','n','t','H','o','o','d','\0'}; -#ifndef __REACTOS__ -static const WCHAR Program_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\0'}; -static const WCHAR Program_Files_Common_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}; -#endif -static const WCHAR Program_Files_x86W[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\0'}; -static const WCHAR Program_Files_x86_Common_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}; -static const WCHAR ProgramFilesDirW[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r','\0'}; -static const WCHAR ProgramFilesDirX86W[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}; -static const WCHAR ProgramsW[] = {'P','r','o','g','r','a','m','s','\0'}; -#ifndef __REACTOS__ -static const WCHAR PublicW[] = {'P','u','b','l','i','c',0}; -#endif -static const WCHAR RecentW[] = {'R','e','c','e','n','t','\0'}; -static const WCHAR ResourcesW[] = {'R','e','s','o','u','r','c','e','s','\0'}; -#ifndef __REACTOS__ -static const WCHAR Saved_GamesW[] = {'S','a','v','e','d',' ','G','a','m','e','s','\0'}; -static const WCHAR SearchesW[] = {'S','e','a','r','c','h','e','s','\0'}; -#endif -static const WCHAR SendToW[] = {'S','e','n','d','T','o','\0'}; -static const WCHAR StartUpW[] = {'S','t','a','r','t','U','p','\0'}; -static const WCHAR Start_MenuW[] = {'S','t','a','r','t',' ','M','e','n','u','\0'}; -#ifndef __REACTOS__ -static const WCHAR Start_Menu_ProgramsW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\0'}; -static const WCHAR Start_Menu_Admin_ToolsW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}; -static const WCHAR Start_Menu_StartupW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','S','t','a','r','t','U','p','\0'}; -#endif -static const WCHAR TemplatesW[] = {'T','e','m','p','l','a','t','e','s','\0'}; -#ifndef __REACTOS__ -static const WCHAR UsersW[] = {'U','s','e','r','s','\0'}; -static const WCHAR UsersPublicW[] = {'U','s','e','r','s','\\','P','u','b','l','i','c','\0'}; -static const WCHAR VideosW[] = {'V','i','d','e','o','s','\0'}; -static const WCHAR Videos_Sample_VideosW[] = {'V','i','d','e','o','s','\\','S','a','m','p','l','e',' ','V','i','d','e','o','s','\0'}; -#endif -static const WCHAR DefaultW[] = {'.','D','e','f','a','u','l','t','\0'}; -static const WCHAR AllUsersProfileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}; -#ifndef __REACTOS__ -static const WCHAR PublicProfileW[] = {'%','P','U','B','L','I','C','%',0}; -#endif -static const WCHAR UserProfileW[] = {'%','U','S','E','R','P','R','O','F','I','L','E','%','\0'}; -static const WCHAR SystemDriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%','\0'}; -#ifndef __REACTOS__ -static const WCHAR ProfileListW[] = {'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','\\','P','r','o','f','i','l','e','L','i','s','t',0}; -static const WCHAR ProfilesDirectoryW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}; -static const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; -#endif -static const WCHAR szSHFolders[] = {'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','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; -static const WCHAR szSHUserFolders[] = {'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','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; -static const WCHAR szDefaultProfileDirW[] = {'u','s','e','r','s',0}; -#ifndef __REACTOS__ -static const WCHAR szKnownFolderDescriptions[] = {'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','\\','F','o','l','d','e','r','D','e','s','c','r','i','p','t','i','o','n','s','\0'}; -static const WCHAR szKnownFolderRedirections[] = {'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','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s',0}; -#endif -static const WCHAR AllUsersW[] = {'P','u','b','l','i','c',0}; typedef enum _CSIDL_Type { CSIDL_Type_User, @@ -971,7 +872,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x00 - CSIDL_DESKTOP */ &FOLDERID_Desktop, CSIDL_Type_User, - DesktopW, + L"Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -988,7 +889,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x02 - CSIDL_PROGRAMS */ &FOLDERID_Programs, CSIDL_Type_User, - ProgramsW, + L"Programs", MAKEINTRESOURCEW(IDS_PROGRAMS), #ifdef __REACTOS__ 0 @@ -1013,34 +914,34 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x05 - CSIDL_PERSONAL */ &FOLDERID_Documents, CSIDL_Type_User, - PersonalW, + L"Personal", MAKEINTRESOURCEW(IDS_PERSONAL), -IDI_SHELL_MY_DOCUMENTS }, { /* 0x06 - CSIDL_FAVORITES */ &FOLDERID_Favorites, CSIDL_Type_User, - FavoritesW, + L"Favorites", MAKEINTRESOURCEW(IDS_FAVORITES), -IDI_SHELL_FAVORITES }, { /* 0x07 - CSIDL_STARTUP */ &FOLDERID_Startup, CSIDL_Type_User, - StartUpW, + L"StartUp", MAKEINTRESOURCEW(IDS_STARTUP) }, { /* 0x08 - CSIDL_RECENT */ &FOLDERID_Recent, CSIDL_Type_User, - RecentW, + L"Recent", MAKEINTRESOURCEW(IDS_RECENT), -IDI_SHELL_RECENT_DOCUMENTS }, { /* 0x09 - CSIDL_SENDTO */ &FOLDERID_SendTo, CSIDL_Type_User, - SendToW, + L"SendTo", MAKEINTRESOURCEW(IDS_SENDTO) }, { /* 0x0a - CSIDL_BITBUCKET - Recycle Bin */ @@ -1052,7 +953,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x0b - CSIDL_STARTMENU */ &FOLDERID_StartMenu, CSIDL_Type_User, - Start_MenuW, + L"Start Menu", MAKEINTRESOURCEW(IDS_STARTMENU), -IDI_SHELL_TSKBAR_STARTMENU }, @@ -1070,7 +971,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_MusicW, + L"My Music", MAKEINTRESOURCEW(IDS_MYMUSIC), -IDI_SHELL_MY_MUSIC }, @@ -1081,7 +982,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_VideoW, + L"My Video", MAKEINTRESOURCEW(IDS_MYVIDEO), -IDI_SHELL_MY_MOVIES }, @@ -1094,7 +995,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x10 - CSIDL_DESKTOPDIRECTORY */ &FOLDERID_Desktop, CSIDL_Type_User, - DesktopW, + L"Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -1119,34 +1020,34 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x13 - CSIDL_NETHOOD */ &FOLDERID_NetHood, CSIDL_Type_User, - NetHoodW, + L"NetHood", MAKEINTRESOURCEW(IDS_NETHOOD), -IDI_SHELL_NETWORK }, { /* 0x14 - CSIDL_FONTS */ &FOLDERID_Fonts, CSIDL_Type_WindowsPath, - FontsW, - FontsW, + L"Fonts", + L"Fonts", -IDI_SHELL_FONTS_FOLDER }, { /* 0x15 - CSIDL_TEMPLATES */ &FOLDERID_Templates, CSIDL_Type_User, - TemplatesW, + L"Templates", MAKEINTRESOURCEW(IDS_TEMPLATES) }, { /* 0x16 - CSIDL_COMMON_STARTMENU */ &FOLDERID_CommonStartMenu, CSIDL_Type_AllUsers, - Common_Start_MenuW, + L"Common Start Menu", MAKEINTRESOURCEW(IDS_STARTMENU), -IDI_SHELL_TSKBAR_STARTMENU }, { /* 0x17 - CSIDL_COMMON_PROGRAMS */ &FOLDERID_CommonPrograms, CSIDL_Type_AllUsers, - Common_ProgramsW, + L"Common Programs", MAKEINTRESOURCEW(IDS_PROGRAMS), #ifdef __REACTOS__ 0 @@ -1157,13 +1058,13 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x18 - CSIDL_COMMON_STARTUP */ &FOLDERID_CommonStartup, CSIDL_Type_AllUsers, - Common_StartUpW, + L"Common StartUp", MAKEINTRESOURCEW(IDS_STARTUP) }, { /* 0x19 - CSIDL_COMMON_DESKTOPDIRECTORY */ &FOLDERID_PublicDesktop, CSIDL_Type_AllUsers, - Common_DesktopW, + L"Common Desktop", MAKEINTRESOURCEW(IDS_DESKTOPDIRECTORY), #ifdef __REACTOS__ 0 @@ -1174,20 +1075,20 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x1a - CSIDL_APPDATA */ &FOLDERID_RoamingAppData, CSIDL_Type_User, - AppDataW, + L"AppData", MAKEINTRESOURCEW(IDS_APPDATA) }, { /* 0x1b - CSIDL_PRINTHOOD */ &FOLDERID_PrintHood, CSIDL_Type_User, - PrintHoodW, + L"PrintHood", MAKEINTRESOURCEW(IDS_PRINTHOOD), -IDI_SHELL_PRINTERS_FOLDER }, { /* 0x1c - CSIDL_LOCAL_APPDATA */ &FOLDERID_LocalAppData, CSIDL_Type_User, - Local_AppDataW, + L"Local AppData", MAKEINTRESOURCEW(IDS_LOCAL_APPDATA) }, { /* 0x1d - CSIDL_ALTSTARTUP */ @@ -1205,32 +1106,32 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x1f - CSIDL_COMMON_FAVORITES */ &FOLDERID_Favorites, CSIDL_Type_AllUsers, - Common_FavoritesW, + L"Common Favorites", MAKEINTRESOURCEW(IDS_FAVORITES), -IDI_SHELL_FAVORITES }, { /* 0x20 - CSIDL_INTERNET_CACHE */ &FOLDERID_InternetCache, CSIDL_Type_User, - CacheW, + L"Cache", MAKEINTRESOURCEW(IDS_INTERNET_CACHE) }, { /* 0x21 - CSIDL_COOKIES */ &FOLDERID_Cookies, CSIDL_Type_User, - CookiesW, + L"Cookies", MAKEINTRESOURCEW(IDS_COOKIES) }, { /* 0x22 - CSIDL_HISTORY */ &FOLDERID_History, CSIDL_Type_User, - HistoryW, + L"History", MAKEINTRESOURCEW(IDS_HISTORY) }, { /* 0x23 - CSIDL_COMMON_APPDATA */ &FOLDERID_ProgramData, CSIDL_Type_AllUsers, - Common_AppDataW, + L"Common AppData", MAKEINTRESOURCEW(IDS_APPDATA) }, { /* 0x24 - CSIDL_WINDOWS */ @@ -1250,7 +1151,7 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x26 - CSIDL_PROGRAM_FILES */ &FOLDERID_ProgramFiles, CSIDL_Type_CurrVer, - ProgramFilesDirW, + L"ProgramFilesDir", MAKEINTRESOURCEW(IDS_PROGRAM_FILES), #ifdef __REACTOS__ 0 @@ -1265,7 +1166,7 @@ static const CSIDL_DATA CSIDL_Data[] = #else CSIDL_Type_User, #endif - My_PicturesW, + L"My Pictures", MAKEINTRESOURCEW(IDS_MYPICTURES), -IDI_SHELL_MY_PICTURES }, @@ -1285,47 +1186,47 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x2a - CSIDL_PROGRAM_FILESX86 */ &FOLDERID_ProgramFilesX86, CSIDL_Type_CurrVer, - ProgramFilesDirX86W, - Program_Files_x86W, + L"ProgramFilesDir (x86)", + L"Program Files (x86)", -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2b - CSIDL_PROGRAM_FILES_COMMON */ &FOLDERID_ProgramFilesCommon, CSIDL_Type_CurrVer, - CommonFilesDirW, + L"CommonFilesDir", MAKEINTRESOURCEW(IDS_PROGRAM_FILES_COMMON), -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2c - CSIDL_PROGRAM_FILES_COMMONX86 */ &FOLDERID_ProgramFilesCommonX86, CSIDL_Type_CurrVer, - CommonFilesDirX86W, - Program_Files_x86_Common_FilesW, + L"CommonFilesDir (x86)", + L"Program Files (x86)\\Common Files", -IDI_SHELL_PROGRAMS_FOLDER }, { /* 0x2d - CSIDL_COMMON_TEMPLATES */ &FOLDERID_CommonTemplates, CSIDL_Type_AllUsers, - Common_TemplatesW, + L"Common Templates", MAKEINTRESOURCEW(IDS_TEMPLATES) }, { /* 0x2e - CSIDL_COMMON_DOCUMENTS */ &FOLDERID_PublicDocuments, CSIDL_Type_AllUsers, - Common_DocumentsW, + L"Common Documents", MAKEINTRESOURCEW(IDS_PERSONAL), -IDI_SHELL_MY_DOCUMENTS }, { /* 0x2f - CSIDL_COMMON_ADMINTOOLS */ &FOLDERID_CommonAdminTools, CSIDL_Type_AllUsers, - Common_Administrative_ToolsW, + L"Common Administrative Tools", MAKEINTRESOURCEW(IDS_ADMINTOOLS) }, { /* 0x30 - CSIDL_ADMINTOOLS */ &FOLDERID_AdminTools, CSIDL_Type_User, - Administrative_ToolsW, + L"Administrative Tools", MAKEINTRESOURCEW(IDS_ADMINTOOLS) }, { /* 0x31 - CSIDL_CONNECTIONS */ @@ -1356,21 +1257,21 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x35 - CSIDL_COMMON_MUSIC */ &FOLDERID_PublicMusic, CSIDL_Type_AllUsers, - CommonMusicW, + L"CommonMusic", MAKEINTRESOURCEW(IDS_COMMON_MUSIC), -IDI_SHELL_MY_MUSIC }, { /* 0x36 - CSIDL_COMMON_PICTURES */ &FOLDERID_PublicPictures, CSIDL_Type_AllUsers, - CommonPicturesW, + L"CommonPictures", MAKEINTRESOURCEW(IDS_COMMON_PICTURES), -IDI_SHELL_MY_PICTURES }, { /* 0x37 - CSIDL_COMMON_VIDEO */ &FOLDERID_PublicVideos, CSIDL_Type_AllUsers, - CommonVideoW, + L"CommonVideo", MAKEINTRESOURCEW(IDS_COMMON_VIDEO), -IDI_SHELL_MY_MOVIES }, @@ -1378,7 +1279,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_ResourceDir, CSIDL_Type_WindowsPath, NULL, - ResourcesW + L"Resources" }, { /* 0x39 - CSIDL_RESOURCES_LOCALIZED */ &FOLDERID_LocalizedResourcesDir, @@ -1390,13 +1291,13 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_CommonOEMLinks, CSIDL_Type_AllUsers, NULL, - OEM_LinksW + L"OEM Links" }, { /* 0x3b - CSIDL_CDBURN_AREA */ &FOLDERID_CDBurning, CSIDL_Type_User, - CD_BurningW, - Local_Settings_CD_BurningW + L"CD Burning", + L"Local Settings\\Application Data\\Microsoft\\CD Burning" }, { /* 0x3c unassigned */ &GUID_NULL, @@ -1446,7 +1347,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Contacts, CSIDL_Type_User, NULL, - ContactsW + L"Contacts" }, { /* 0x44 */ &FOLDERID_DeviceMetadataStore, @@ -1458,7 +1359,7 @@ static const CSIDL_DATA CSIDL_Data[] = &GUID_NULL, CSIDL_Type_User, NULL, - DocumentsW + L"Documents" }, { /* 0x46 */ &FOLDERID_DocumentsLibrary, @@ -1474,7 +1375,7 @@ static const CSIDL_DATA CSIDL_Data[] = CSIDL_Type_User, #endif NULL, - DownloadsW + L"Downloads" }, { /* 0x48 */ &FOLDERID_Games, @@ -1510,13 +1411,13 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Links, CSIDL_Type_User, NULL, - LinksW + L"Links" }, { /* 0x4e - CSIDL_APPDATA_LOCALLOW */ &FOLDERID_LocalAppDataLow, CSIDL_Type_User, NULL, - AppData_LocalLowW + L"AppData\\LocalLow" }, { /* 0x4f */ &FOLDERID_MusicLibrary, @@ -1534,7 +1435,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_PhotoAlbums, CSIDL_Type_User, NULL, - Pictures_Slide_ShowsW + L"Pictures\\Slide Shows" }, { /* 0x52 */ &FOLDERID_PicturesLibrary, @@ -1546,7 +1447,7 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Playlists, CSIDL_Type_User, NULL, - Music_PlaylistsW + L"Music\\Playlists" }, { /* 0x54 */ &FOLDERID_ProgramFilesX64, @@ -1564,31 +1465,31 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_Public, CSIDL_Type_CurrVer, /* FIXME */ NULL, - UsersPublicW + L"Users\\Public" }, { /* 0x57 */ &FOLDERID_PublicDownloads, CSIDL_Type_AllUsers, NULL, - DownloadsW + L"Downloads" }, { /* 0x58 */ &FOLDERID_PublicGameTasks, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_GameExplorerW + L"Microsoft\\Windows\\GameExplorer" }, { /* 0x59 */ &FOLDERID_PublicLibraries, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_LibrariesW + L"Microsoft\\Windows\\Libraries" }, { /* 0x5a */ &FOLDERID_PublicRingtones, CSIDL_Type_AllUsers, NULL, - Microsoft_Windows_RingtonesW + L"Microsoft\\Windows\\Ringtones" }, { /* 0x5b */ &FOLDERID_QuickLaunch, @@ -1612,37 +1513,37 @@ static const CSIDL_DATA CSIDL_Data[] = &FOLDERID_SampleMusic, CSIDL_Type_AllUsers, NULL, - Music_Sample_MusicW + L"Music\\Sample Music" }, { /* 0x5f */ &FOLDERID_SamplePictures, CSIDL_Type_AllUsers, NULL, - Pictures_Sample_PicturesW + L"Pictures\\Sample Pictures" }, { /* 0x60 */ &FOLDERID_SamplePlaylists, CSIDL_Type_AllUsers, NULL, - Music_Sample_PlaylistsW + L"Music\\Sample Playlists" }, { /* 0x61 */ &FOLDERID_SampleVideos, CSIDL_Type_AllUsers, NULL, - Videos_Sample_VideosW + L"Videos\\Sample Videos" }, { /* 0x62 - CSIDL_SAVED_GAMES */ &FOLDERID_SavedGames, CSIDL_Type_User, NULL, - Saved_GamesW + L"Saved Games" }, { /* 0x63 - CSIDL_SEARCHES */ &FOLDERID_SavedSearches, CSIDL_Type_User, NULL, - SearchesW + L"Searches" }, { /* 0x64 */ &FOLDERID_SEARCH_CSC, @@ -1701,8 +1602,8 @@ static const CSIDL_DATA CSIDL_Data[] = { /* 0x6d */ &FOLDERID_UserProfiles, CSIDL_Type_CurrVer, - UsersW, - UsersW + L"Users", + L"Users" }, { /* 0x6e */ &FOLDERID_UserProgramFiles, @@ -1920,11 +1821,11 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) switch (CSIDL_Data[folder].type) { case CSIDL_Type_User: - strcpyW(pszPath, UserProfileW); + strcpyW(pszPath, L"%USERPROFILE%"); break; #ifdef __REACTOS__ case CSIDL_Type_InMyDocuments: - strcpyW(pszPath, UserProfileW); + strcpyW(pszPath, L"%USERPROFILE%"); if (DoGetProductType(&ProductType) && ProductType == NtProductWinNt) { if (IS_INTRESOURCE(CSIDL_Data[CSIDL_MYDOCUMENTS].szDefaultPath)) @@ -1944,13 +1845,13 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) #endif case CSIDL_Type_AllUsers: #ifndef __REACTOS__ - strcpyW(pszPath, PublicProfileW); + strcpyW(pszPath, L"%PUBLIC%"); #else - strcpyW(pszPath, AllUsersProfileW); + strcpyW(pszPath, L"%ALLUSERSPROFILE%"); #endif break; case CSIDL_Type_CurrVer: - strcpyW(pszPath, SystemDriveW); + strcpyW(pszPath, L"%SystemDrive%"); break; default: ; /* no corresponding env. var, do nothing */ @@ -1984,7 +1885,7 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath) /* Gets the (unexpanded) value of the folder with index folder into pszPath. * The folder's type is assumed to be CSIDL_Type_CurrVer. Its default value - * can be overridden in the HKLM\\szCurrentVersion key. + * can be overridden in the HKLM\\Software\\Microsoft\\Windows\\CurrentVersion key. * If dwFlags has SHGFP_TYPE_DEFAULT set or if the value isn't overridden in * the registry, uses _SHGetDefaultValue to get the value. */ @@ -2012,7 +1913,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder, { HKEY hKey; - if (RegCreateKeyW(HKEY_LOCAL_MACHINE, szCurrentVersion, &hKey)) + if (RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion", &hKey)) hr = E_FAIL; else { @@ -2131,6 +2032,7 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, } else { + static const WCHAR DefaultW[] = L".Default"; LPCWSTR userPrefix = NULL; HKEY hRootKey; @@ -2231,7 +2133,7 @@ static HRESULT _SHOpenProfilesKey(PHKEY pKey) LONG lRet; DWORD disp; - lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ProfileListW, 0, NULL, 0, + lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList", 0, NULL, 0, KEY_ALL_ACCESS, NULL, pKey, &disp); return HRESULT_FROM_WIN32(lRet); } @@ -2324,9 +2226,9 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR /* get the system drive */ GetSystemDirectoryW(def_val, MAX_PATH); - strcpyW( def_val + 3, szDefaultProfileDirW ); + strcpyW( def_val + 3, L"Users" ); - hr = _SHGetProfilesValue(key, ProfilesDirectoryW, szProfilesPrefix, def_val ); + hr = _SHGetProfilesValue(key, L"ProfilesDirectory", szProfilesPrefix, def_val ); } #else hr = S_OK; @@ -2336,36 +2238,35 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR strcpyW(szTemp, szSrc); while (SUCCEEDED(hr) && szTemp[0] == '%') { - if (!strncmpiW(szTemp, AllUsersProfileW, strlenW(AllUsersProfileW))) + if (!strncmpiW(szTemp, L"%ALLUSERSPROFILE%", ARRAY_SIZE(L"%ALLUSERSPROFILE%")-1)) { #ifndef __REACTOS__ WCHAR szAllUsers[MAX_PATH]; strcpyW(szDest, szProfilesPrefix); - hr = _SHGetProfilesValue(key, AllUsersProfileValueW, - szAllUsers, AllUsersW); + hr = _SHGetProfilesValue(key, L"AllUsersProfile", szAllUsers, L"Public"); PathAppendW(szDest, szAllUsers); #else DWORD cchSize = cchDest; if (!GetAllUsersProfileDirectoryW(szDest, &cchSize)) goto fallback_expand; #endif - PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%ALLUSERSPROFILE%")-1); } #ifndef __REACTOS__ - else if (!strncmpiW(szTemp, PublicProfileW, strlenW(PublicProfileW))) + else if (!strncmpiW(szTemp, L"%PUBLIC%", ARRAY_SIZE(L"%PUBLIC%")-1)) { WCHAR szAllUsers[MAX_PATH], def_val[MAX_PATH]; GetSystemDirectoryW(def_val, MAX_PATH); - strcpyW( def_val + 3, UsersPublicW ); + strcpyW( def_val + 3, L"Users\\Public" ); - hr = _SHGetProfilesValue(key, PublicW, szAllUsers, def_val); + hr = _SHGetProfilesValue(key, L"Public", szAllUsers, def_val); PathAppendW(szDest, szAllUsers); - PathAppendW(szDest, szTemp + strlenW(PublicProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%PUBLIC%")-1); } #endif - else if (!strncmpiW(szTemp, UserProfileW, strlenW(UserProfileW))) + else if (!strncmpiW(szTemp, L"%USERPROFILE%", ARRAY_SIZE(L"%USERPROFILE%")-1)) { #ifndef __REACTOS__ WCHAR userName[MAX_PATH]; @@ -2379,9 +2280,9 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR if (!_SHGetUserProfileDirectoryW(hToken, szDest, &cchSize)) goto fallback_expand; #endif - PathAppendW(szDest, szTemp + strlenW(UserProfileW)); + PathAppendW(szDest, szTemp + ARRAY_SIZE(L"%USERPROFILE%")-1); } - else if (!strncmpiW(szTemp, SystemDriveW, strlenW(SystemDriveW))) + else if (!strncmpiW(szTemp, L"%SystemDrive%", ARRAY_SIZE(L"%SystemDrive%")-1)) { #ifndef __REACTOS__ GetSystemDirectoryW(szDest, MAX_PATH); @@ -2389,7 +2290,7 @@ static HRESULT _SHExpandEnvironmentStrings(HANDLE hToken, LPCWSTR szSrc, LPWSTR if (!GetSystemDirectoryW(szDest, cchDest)) goto fallback_expand; #endif - strcpyW(szDest + 3, szTemp + strlenW(SystemDriveW) + 1); + strcpyW(szDest + 3, szTemp + ARRAY_SIZE(L"%SystemDrive%")-1 + 1); } else #ifdef __REACTOS__ @@ -2648,11 +2549,11 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( TRACE("Created missing system directory %s\n", debugstr_w(szBuildPath)); end: +#ifdef __REACTOS__ /* create desktop.ini for custom icon */ if ((nFolder & CSIDL_FLAG_CREATE) && CSIDL_Data[folder].nShell32IconIndex) { - static const WCHAR s_szFormat[] = L"%%SystemRoot%%\\system32\\shell32.dll,%d"; WCHAR szIconLocation[MAX_PATH]; DWORD dwAttributes; @@ -2665,7 +2566,8 @@ end: PathAppendW(szBuildPath, L"desktop.ini"); /* build the icon location */ - StringCchPrintfW(szIconLocation, _countof(szIconLocation), s_szFormat, + StringCchPrintfW(szIconLocation, _countof(szIconLocation), + L"%%SystemRoot%%\\system32\\shell32.dll,%d", CSIDL_Data[folder].nShell32IconIndex); /* write desktop.ini */ @@ -2679,6 +2581,7 @@ end: dwAttributes |= FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN; SetFileAttributesW(szBuildPath, dwAttributes); } +#endif TRACE("returning 0x%08x (final path is %s)\n", hr, debugstr_w(szBuildPath)); return hr; @@ -2866,11 +2769,11 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault) { hToken = (HANDLE)-1; hRootKey = HKEY_USERS; - strcpyW(userShellFolderPath, DefaultW); + strcpyW(userShellFolderPath, L".Default"); PathAddBackslashW(userShellFolderPath); strcatW(userShellFolderPath, szSHUserFolders); pUserShellFolderPath = userShellFolderPath; - strcpyW(shellFolderPath, DefaultW); + strcpyW(shellFolderPath, L".Default"); PathAddBackslashW(shellFolderPath); strcatW(shellFolderPath, szSHFolders); pShellFolderPath = shellFolderPath; diff --git a/dll/win32/shell32/wine/shellstring.c b/dll/win32/shell32/wine/shellstring.c index 8796f3813c3..6099325559c 100644 --- a/dll/win32/shell32/wine/shellstring.c +++ b/dll/win32/shell32/wine/shellstring.c @@ -244,8 +244,6 @@ VOID WINAPI CheckEscapesA( LocalFree(wString); } -static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0}; - /************************************************************************* * CheckEscapesW [SHELL32.@] * @@ -260,7 +258,7 @@ VOID WINAPI CheckEscapesW( TRACE("(%s %d) stub\n", debugstr_w(string), len); - if (StrPBrkW(string, strEscapedChars) && size + 2 <= len) + if (StrPBrkW(string, L" \",;^") && size + 2 <= len) { s = &string[size - 1]; d = &string[size + 2]; diff --git a/dll/win32/shell32/wine/shlmenu.c b/dll/win32/shell32/wine/shlmenu.c index a5e8e3ee007..281c63b41fd 100644 --- a/dll/win32/shell32/wine/shlmenu.c +++ b/dll/win32/shell32/wine/shlmenu.c @@ -231,8 +231,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl) if ( GetMenuItemCount (hmenu) == 0 ) { - static const WCHAR szEmpty[] = { '(','e','m','p','t','y',')',0 }; - FileMenu_AppendItemW (hmenu, szEmpty, uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT); + FileMenu_AppendItemW (hmenu, L"(empty)", uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT); NumberOfItems++; } diff --git a/dll/win32/shell32/wine/shpolicy.c b/dll/win32/shell32/wine/shpolicy.c index 6f7a2a5b20e..84086318853 100644 --- a/dll/win32/shell32/wine/shpolicy.c +++ b/dll/win32/shell32/wine/shpolicy.c @@ -55,15 +55,6 @@ typedef struct tagPOLICYDAT DWORD cache; /* cached value or 0xffffffff for invalid */ } POLICYDATA, *LPPOLICYDATA; -/* registry strings */ -static const CHAR strRegistryPolicyA[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies"; -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}; -static const CHAR strPolicyA[] = "Policy"; -static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0}; - /* application strings */ static const char strExplorer[] = {"Explorer"}; @@ -866,8 +857,7 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy) return p->cache; } - lstrcpyA(regstr, strRegistryPolicyA); - lstrcatA(regstr, "\\"); + lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\"); lstrcatA(regstr, p->appstr); /* return 0 and don't set the cache if any registry errors occur */ @@ -922,15 +912,15 @@ BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCVOID inpRegKey) { if (SHELL_OsIsUnicode()) { - if (lstrcmpiW(inpRegKey, strRegistryPolicyW) && - lstrcmpiW(inpRegKey, strPolicyW)) + if (lstrcmpiW(inpRegKey, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies") && + lstrcmpiW(inpRegKey, L"Policy")) /* doesn't match, fail */ return FALSE; } else { - if (lstrcmpiA(inpRegKey, strRegistryPolicyA) && - lstrcmpiA(inpRegKey, strPolicyA)) + if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies") && + lstrcmpiA(inpRegKey, "Policy")) /* doesn't match, fail */ return FALSE; }