Commit b2155368 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Use wide char string literals.

parent 332b90c0
...@@ -67,8 +67,6 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) ...@@ -67,8 +67,6 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
HWND appbarmsg_window; HWND appbarmsg_window;
COPYDATASTRUCT cds; COPYDATASTRUCT cds;
DWORD_PTR msg_result; DWORD_PTR msg_result;
static const WCHAR classname[] = {'W','i','n','e','A','p','p','B','a','r',0};
UINT_PTR ret = 0; UINT_PTR ret = 0;
TRACE("msg=%d, data={cb=%d, hwnd=%p}\n", msg, data->cbSize, data->hWnd); TRACE("msg=%d, data={cb=%d, hwnd=%p}\n", msg, data->cbSize, data->hWnd);
...@@ -124,7 +122,7 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) ...@@ -124,7 +122,7 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
command.return_process = GetCurrentProcessId(); command.return_process = GetCurrentProcessId();
appbarmsg_window = FindWindowW(classname, NULL); appbarmsg_window = FindWindowW(L"WineAppBar", NULL);
if (appbarmsg_window == NULL) if (appbarmsg_window == NULL)
{ {
ERR("couldn't find appbar window\n"); ERR("couldn't find appbar window\n");
......
...@@ -87,9 +87,7 @@ enum prefix_filtering ...@@ -87,9 +87,7 @@ enum prefix_filtering
prefix_filtering_all /* filter all common prefixes (protocol & www. ) */ prefix_filtering_all /* filter all common prefixes (protocol & www. ) */
}; };
static const WCHAR autocomplete_propertyW[] = {'W','i','n','e',' ','A','u','t','o', static const WCHAR autocomplete_propertyW[] = L"Wine Autocomplete control";
'c','o','m','p','l','e','t','e',' ',
'c','o','n','t','r','o','l',0};
static inline IAutoCompleteImpl *impl_from_IAutoComplete2(IAutoComplete2 *iface) static inline IAutoCompleteImpl *impl_from_IAutoComplete2(IAutoComplete2 *iface)
{ {
...@@ -111,11 +109,9 @@ static void set_text_and_selection(IAutoCompleteImpl *ac, HWND hwnd, WCHAR *text ...@@ -111,11 +109,9 @@ static void set_text_and_selection(IAutoCompleteImpl *ac, HWND hwnd, WCHAR *text
static inline WCHAR *filter_protocol(WCHAR *str) static inline WCHAR *filter_protocol(WCHAR *str)
{ {
static const WCHAR http[] = {'h','t','t','p'}; if (!wcsncmp(str, L"http", 4))
if (!wcsncmp(str, http, ARRAY_SIZE(http)))
{ {
str += ARRAY_SIZE(http); str += 4;
str += (*str == 's'); /* https */ str += (*str == 's'); /* https */
if (str[0] == ':' && str[1] == '/' && str[2] == '/') if (str[0] == ':' && str[1] == '/' && str[2] == '/')
return str + 3; return str + 3;
...@@ -125,10 +121,7 @@ static inline WCHAR *filter_protocol(WCHAR *str) ...@@ -125,10 +121,7 @@ static inline WCHAR *filter_protocol(WCHAR *str)
static inline WCHAR *filter_www(WCHAR *str) static inline WCHAR *filter_www(WCHAR *str)
{ {
static const WCHAR www[] = {'w','w','w','.'}; if (!wcsncmp(str, L"www.", 4)) return str + 4;
if (!wcsncmp(str, www, ARRAY_SIZE(www)))
return str + ARRAY_SIZE(www);
return NULL; return NULL;
} }
...@@ -477,17 +470,13 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt) ...@@ -477,17 +470,13 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt)
{ {
/* call IACList::Expand only when needed, if the /* call IACList::Expand only when needed, if the
new txt and old_txt require different expansions */ new txt and old_txt require different expansions */
static const WCHAR empty[] = { 0 };
const WCHAR *old_txt = ac->txtbackup; const WCHAR *old_txt = ac->txtbackup;
WCHAR c, *p, *last_delim; WCHAR c, *p, *last_delim;
size_t i = 0; size_t i = 0;
/* '/' is allowed as a delim for unix paths */
static const WCHAR delims[] = { '\\', '/', 0 };
/* always expand if the enumerator was reset */ /* always expand if the enumerator was reset */
if (!ac->enum_strs) old_txt = empty; if (!ac->enum_strs) old_txt = L"";
/* skip the shared prefix */ /* skip the shared prefix */
while ((c = towlower(txt[i])) == towlower(old_txt[i])) while ((c = towlower(txt[i])) == towlower(old_txt[i]))
...@@ -497,16 +486,16 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt) ...@@ -497,16 +486,16 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt)
} }
/* they differ at this point, check for a delim further in txt */ /* they differ at this point, check for a delim further in txt */
for (last_delim = NULL, p = &txt[i]; (p = wcspbrk(p, delims)) != NULL; p++) for (last_delim = NULL, p = &txt[i]; (p = wcspbrk(p, L"\\/")) != NULL; p++)
last_delim = p; last_delim = p;
if (last_delim) return do_aclist_expand(ac, txt, last_delim); if (last_delim) return do_aclist_expand(ac, txt, last_delim);
/* txt has no delim after i, check for a delim further in old_txt */ /* txt has no delim after i, check for a delim further in old_txt */
if (wcspbrk(&old_txt[i], delims)) if (wcspbrk(&old_txt[i], L"\\/"))
{ {
/* scan backwards to find the first delim before txt[i] (if any) */ /* scan backwards to find the first delim before txt[i] (if any) */
while (i--) while (i--)
if (wcschr(delims, txt[i])) if (wcschr(L"\\/", txt[i]))
return do_aclist_expand(ac, txt, &txt[i]); return do_aclist_expand(ac, txt, &txt[i]);
/* Windows doesn't expand without a delim, but it does reset */ /* Windows doesn't expand without a delim, but it does reset */
......
...@@ -98,12 +98,6 @@ static void FillTreeView(browse_info*, LPSHELLFOLDER, ...@@ -98,12 +98,6 @@ static void FillTreeView(browse_info*, LPSHELLFOLDER,
static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *, static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *,
LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM); 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) static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
{ {
return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0); return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
...@@ -711,7 +705,7 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info ) ...@@ -711,7 +705,7 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo; LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
info->hWnd = hWnd; info->hWnd = hWnd;
SetPropW( hWnd, szBrowseFolderInfo, info ); SetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO", info );
if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE) if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n"); FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
...@@ -1108,7 +1102,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -1108,7 +1102,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
if (msg == WM_INITDIALOG) if (msg == WM_INITDIALOG)
return BrsFolder_OnCreate( hWnd, (browse_info*) lParam ); return BrsFolder_OnCreate( hWnd, (browse_info*) lParam );
info = GetPropW( hWnd, szBrowseFolderInfo ); info = GetPropW( hWnd, L"__WINE_BRSFOLDERDLG_INFO" );
if (!info) if (!info)
return FALSE; return FALSE;
...@@ -1166,11 +1160,6 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -1166,11 +1160,6 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
return FALSE; return FALSE;
} }
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};
/************************************************************************* /*************************************************************************
* SHBrowseForFolderA [SHELL32.@] * SHBrowseForFolderA [SHELL32.@]
* SHBrowseForFolder [SHELL32.@] * SHBrowseForFolder [SHELL32.@]
...@@ -1244,9 +1233,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi) ...@@ -1244,9 +1233,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
hr = OleInitialize(NULL); hr = OleInitialize(NULL);
if (lpbi->ulFlags & BIF_NEWDIALOGSTYLE) if (lpbi->ulFlags & BIF_NEWDIALOGSTYLE)
templateName = swNewBrowseTemplateName; templateName = L"SHNEWBRSFORFOLDER_MSGBOX";
else else
templateName = swBrowseTemplateName; templateName = L"SHBRSFORFOLDER_MSGBOX";
r = DialogBoxParamW( shell32_hInstance, templateName, lpbi->hwndOwner, r = DialogBoxParamW( shell32_hInstance, templateName, lpbi->hwndOwner,
BrsFolderDlgProc, (LPARAM)&info ); BrsFolderDlgProc, (LPARAM)&info );
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
...@@ -416,9 +416,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID ...@@ -416,9 +416,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
if (wEventId & SHCNE_ASSOCCHANGED) if (wEventId & SHCNE_ASSOCCHANGED)
{ {
static const WCHAR args[] = {' ','-','a',0 };
TRACE("refreshing file type associations\n"); TRACE("refreshing file type associations\n");
run_winemenubuilder( args ); run_winemenubuilder( L" -a" );
} }
} }
......
...@@ -113,10 +113,6 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP ...@@ -113,10 +113,6 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP
return TRUE; 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 ) BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
{ {
WCHAR sTemp[MAX_PATH]; WCHAR sTemp[MAX_PATH];
...@@ -133,12 +129,12 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l ...@@ -133,12 +129,12 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l
size=len; size=len;
*szDest='\0'; *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 */ /* The MSDN says to first try the default verb */
lstrcpyW(sTemp, swShell); lstrcpyW(sTemp, L"shell\\");
lstrcatW(sTemp, szDest); lstrcatW(sTemp, szDest);
lstrcatW(sTemp, swCommand); lstrcatW(sTemp, L"\\command");
if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey)) if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey))
{ {
RegCloseKey(hkey); RegCloseKey(hkey);
...@@ -148,13 +144,11 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l ...@@ -148,13 +144,11 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l
} }
/* then fallback to 'open' */ /* then fallback to 'open' */
lstrcpyW(sTemp, swShell); lstrcpyW(sTemp, L"shell\\open\\command");
lstrcatW(sTemp, swOpen);
lstrcatW(sTemp, swCommand);
if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey)) if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey))
{ {
RegCloseKey(hkey); RegCloseKey(hkey);
lstrcpynW(szDest, swOpen, len); lstrcpynW(szDest, L"open", len);
TRACE("default verb=open\n"); TRACE("default verb=open\n");
return TRUE; return TRUE;
} }
...@@ -186,9 +180,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP ...@@ -186,9 +180,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP
if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, ARRAY_SIZE(sTempVerb))) if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, ARRAY_SIZE(sTempVerb)))
{ {
WCHAR sTemp[MAX_PATH]; WCHAR sTemp[MAX_PATH];
lstrcpyW(sTemp, swShell); lstrcpyW(sTemp, L"shell\\");
lstrcatW(sTemp, sTempVerb); lstrcatW(sTemp, sTempVerb);
lstrcatW(sTemp, swCommand); lstrcatW(sTemp, L"\\command");
ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len)); ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
} }
if (szClass) if (szClass)
...@@ -266,7 +260,6 @@ static BOOL HCR_RegGetDefaultIconA(HKEY hkey, LPSTR szDest, DWORD len, int* pico ...@@ -266,7 +260,6 @@ static BOOL HCR_RegGetDefaultIconA(HKEY hkey, LPSTR szDest, DWORD len, int* pico
BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_idx) BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_idx)
{ {
static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0};
HKEY hkey; HKEY hkey;
WCHAR sTemp[MAX_PATH]; WCHAR sTemp[MAX_PATH];
BOOL ret = FALSE; BOOL ret = FALSE;
...@@ -274,7 +267,7 @@ BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_i ...@@ -274,7 +267,7 @@ BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_i
TRACE("%s\n",debugstr_w(szClass) ); TRACE("%s\n",debugstr_w(szClass) );
lstrcpynW(sTemp, szClass, MAX_PATH); lstrcpynW(sTemp, szClass, MAX_PATH);
lstrcatW(sTemp, swDefaultIcon); lstrcatW(sTemp, L"\\DefaultIcon");
if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
{ {
...@@ -319,8 +312,6 @@ BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, int* picon_idx ...@@ -319,8 +312,6 @@ BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, int* picon_idx
* *
* Gets the name of a registered class * Gets the name of a registered class
*/ */
static const WCHAR swEmpty[] = {0};
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
{ {
HKEY hkey; HKEY hkey;
...@@ -330,10 +321,8 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) ...@@ -330,10 +321,8 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
szDest[0] = 0; szDest[0] = 0;
if (HCR_RegOpenClassIDKey(riid, &hkey)) if (HCR_RegOpenClassIDKey(riid, &hkey))
{ {
static const WCHAR wszLocalizedString[] = if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
{ 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len))
if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) ||
!RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
{ {
ret = TRUE; ret = TRUE;
} }
...@@ -415,12 +404,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) ...@@ -415,12 +404,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
LPOLESTR pwszCLSID; LPOLESTR pwszCLSID;
LONG lResult; LONG lResult;
DWORD dwTemp, dwLen; DWORD dwTemp, dwLen;
static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
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 };
TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes); TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
...@@ -443,7 +427,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) ...@@ -443,7 +427,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
if (lResult != ERROR_SUCCESS) return FALSE; if (lResult != ERROR_SUCCESS) return FALSE;
dwLen = sizeof(DWORD); 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)) { if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
LPSHELLFOLDER psfDesktop, psfFolder; LPSHELLFOLDER psfDesktop, psfFolder;
HRESULT hr; HRESULT hr;
...@@ -461,7 +445,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) ...@@ -461,7 +445,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
} }
if (FAILED(hr)) return FALSE; if (FAILED(hr)) return FALSE;
} else { } else {
lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
RegCloseKey(hSFKey); RegCloseKey(hSFKey);
if (lResult == ERROR_SUCCESS) { if (lResult == ERROR_SUCCESS) {
*pdwAttributes &= dwTemp; *pdwAttributes &= dwTemp;
......
...@@ -427,15 +427,13 @@ static CPlItem* Control_GetCPlItem_From_ListView(CPanel *panel) ...@@ -427,15 +427,13 @@ static CPlItem* Control_GetCPlItem_From_ListView(CPanel *panel)
static void Control_StartApplet(HWND hWnd, CPlItem *item) static void Control_StartApplet(HWND hWnd, CPlItem *item)
{ {
static const WCHAR verbOpen[] = {'c','p','l','o','p','e','n',0}; WCHAR param[12];
static const WCHAR format[] = {'@','%','d',0};
WCHAR param[MAX_PATH];
/* execute the applet if item is valid */ /* execute the applet if item is valid */
if (item) if (item)
{ {
wsprintfW(param, format, item->id); swprintf(param, ARRAY_SIZE(param), L"@%d", item->id);
ShellExecuteW(hWnd, verbOpen, item->applet->cmd, param, NULL, SW_SHOW); ShellExecuteW(hWnd, L"cplopen", item->applet->cmd, param, NULL, SW_SHOW);
} }
} }
...@@ -605,8 +603,6 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, ...@@ -605,8 +603,6 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst) static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
{ {
static const WCHAR className[] = {'S','h','e','l','l','_','C','o','n','t','r','o',
'l','_','W','n','d','C','l','a','s','s',0};
WNDCLASSEXW wc; WNDCLASSEXW wc;
MSG msg; MSG msg;
WCHAR appName[MAX_STRING_LEN]; WCHAR appName[MAX_STRING_LEN];
...@@ -623,7 +619,7 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst) ...@@ -623,7 +619,7 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
wc.hCursor = LoadCursorW( 0, (LPWSTR)IDC_ARROW ); wc.hCursor = LoadCursorW( 0, (LPWSTR)IDC_ARROW );
wc.hbrBackground = GetStockObject(WHITE_BRUSH); wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = className; wc.lpszClassName = L"Shell_Control_WndClass";
wc.hIconSm = LoadImageW( shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_CONTROL_PANEL), IMAGE_ICON, wc.hIconSm = LoadImageW( shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_CONTROL_PANEL), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
...@@ -671,17 +667,13 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) ...@@ -671,17 +667,13 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
HANDLE h; HANDLE h;
WIN32_FIND_DATAW fd; WIN32_FIND_DATAW fd;
WCHAR buffer[MAX_PATH]; 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; WCHAR *p;
/* first add .cpl files in the system directory */ /* first add .cpl files in the system directory */
GetSystemDirectoryW( buffer, MAX_PATH ); GetSystemDirectoryW( buffer, MAX_PATH );
p = buffer + lstrlenW(buffer); p = buffer + lstrlenW(buffer);
*p++ = '\\'; *p++ = '\\';
lstrcpyW(p, wszAllCpl); lstrcpyW(p, L"*.cpl");
if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) { if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) {
do { do {
...@@ -692,8 +684,8 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) ...@@ -692,8 +684,8 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
} }
/* now check for cpls in the registry */ /* now check for cpls in the registry */
Control_RegisterRegistryApplets(hWnd, panel, HKEY_LOCAL_MACHINE, wszRegPath); Control_RegisterRegistryApplets(hWnd, panel, HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
Control_RegisterRegistryApplets(hWnd, panel, HKEY_CURRENT_USER, wszRegPath); Control_RegisterRegistryApplets(hWnd, panel, HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
Control_DoInterface(panel, hWnd, hInst); Control_DoInterface(panel, hWnd, hInst);
} }
......
...@@ -960,8 +960,6 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW *iface, ...@@ -960,8 +960,6 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW *iface,
LPSHELLEXECUTEINFOW psei) LPSHELLEXECUTEINFOW psei)
{ {
ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); ICPanelImpl *This = impl_from_IShellExecuteHookW(iface);
static const WCHAR wCplopen[] = {'c','p','l','o','p','e','n','\0'};
SHELLEXECUTEINFOW sei_tmp; SHELLEXECUTEINFOW sei_tmp;
PIDLCPanelStruct* pcpanel; PIDLCPanelStruct* pcpanel;
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
...@@ -994,7 +992,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW *iface, ...@@ -994,7 +992,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW *iface,
sei_tmp.lpFile = path; sei_tmp.lpFile = path;
sei_tmp.lpParameters = params; sei_tmp.lpParameters = params;
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
sei_tmp.lpVerb = wCplopen; sei_tmp.lpVerb = L"cplopen";
ret = ShellExecuteExW(&sei_tmp); ret = ShellExecuteExW(&sei_tmp);
if (ret) if (ret)
......
...@@ -85,7 +85,6 @@ static void RunFileDlgW( ...@@ -85,7 +85,6 @@ static void RunFileDlgW(
LPCWSTR lpstrDescription, LPCWSTR lpstrDescription,
UINT uFlags) UINT uFlags)
{ {
static const WCHAR resnameW[] = {'S','H','E','L','L','_','R','U','N','_','D','L','G',0};
RUNFILEDLGPARAMS rfdp; RUNFILEDLGPARAMS rfdp;
HRSRC hRes; HRSRC hRes;
LPVOID template; LPVOID template;
...@@ -98,7 +97,7 @@ static void RunFileDlgW( ...@@ -98,7 +97,7 @@ static void RunFileDlgW(
rfdp.lpstrDescription = lpstrDescription; rfdp.lpstrDescription = lpstrDescription;
rfdp.uFlags = uFlags; rfdp.uFlags = uFlags;
if (!(hRes = FindResourceW(shell32_hInstance, resnameW, (LPWSTR)RT_DIALOG)) || if (!(hRes = FindResourceW(shell32_hInstance, L"SHELL_RUN_DLG", (LPWSTR)RT_DIALOG)) ||
!(template = LoadResource(shell32_hInstance, hRes))) !(template = LoadResource(shell32_hInstance, hRes)))
{ {
ERR("Couldn't load SHELL_RUN_DLG resource\n"); ERR("Couldn't load SHELL_RUN_DLG resource\n");
...@@ -116,7 +115,6 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) ...@@ -116,7 +115,6 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
{ {
const WCHAR *src; const WCHAR *src;
WCHAR *dest, *result, *result_end=NULL; WCHAR *dest, *result, *result_end=NULL;
static const WCHAR dotexeW[] = {'.','e','x','e',0};
result = heap_alloc(sizeof(WCHAR)*(lstrlenW(cmdline)+5)); result = heap_alloc(sizeof(WCHAR)*(lstrlenW(cmdline)+5));
...@@ -141,7 +139,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) ...@@ -141,7 +139,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
*dest = 0; *dest = 0;
if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result))
break; break;
lstrcatW(dest, dotexeW); lstrcatW(dest, L".exe");
if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result))
break; break;
} }
...@@ -253,10 +251,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -253,10 +251,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
case IDC_RUNDLG_BROWSE : case IDC_RUNDLG_BROWSE :
{ {
static const WCHAR filterW[] = {'%','s','%','c','*','.','e','x','e','%','c','%','s','%','c','*','.','*','%','c',0};
HMODULE hComdlg = NULL ; HMODULE hComdlg = NULL ;
LPFNOFN ofnProc = NULL ; LPFNOFN ofnProc = NULL ;
static const WCHAR comdlg32W[] = {'c','o','m','d','l','g','3','2',0};
WCHAR szFName[1024] = {0}; WCHAR szFName[1024] = {0};
WCHAR filter_exe[256], filter_all[256], filter[MAX_PATH], szCaption[MAX_PATH]; WCHAR filter_exe[256], filter_all[256], filter[MAX_PATH], szCaption[MAX_PATH];
OPENFILENAMEW ofn; OPENFILENAMEW ofn;
...@@ -264,7 +260,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -264,7 +260,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_EXE, filter_exe, 256); LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_EXE, filter_exe, 256);
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_ALL, filter_all, 256); LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_ALL, filter_all, 256);
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, MAX_PATH); LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, MAX_PATH);
swprintf( filter, MAX_PATH, filterW, filter_exe, 0, 0, filter_all, 0, 0 ); swprintf( filter, MAX_PATH, L"%s%c*.exe%c%s%c*.*%c", filter_exe, 0, 0, filter_all, 0, 0 );
ZeroMemory(&ofn, sizeof(ofn)); ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAMEW); ofn.lStructSize = sizeof(OPENFILENAMEW);
...@@ -276,7 +272,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -276,7 +272,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
ofn.Flags = OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST; ofn.Flags = OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
ofn.lpstrInitialDir = prfdp->lpstrDirectory; ofn.lpstrInitialDir = prfdp->lpstrDirectory;
if (NULL == (hComdlg = LoadLibraryExW (comdlg32W, NULL, 0)) || if (NULL == (hComdlg = LoadLibraryExW (L"comdlg32.dll", NULL, 0)) ||
NULL == (ofnProc = (LPFNOFN)GetProcAddress (hComdlg, "GetOpenFileNameW"))) NULL == (ofnProc = (LPFNOFN)GetProcAddress (hComdlg, "GetOpenFileNameW")))
{ {
ERR("Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)\n", hComdlg, ofnProc); ERR("Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)\n", hComdlg, ofnProc);
......
...@@ -704,9 +704,8 @@ static void initialize_navpane(ExplorerBrowserImpl *This, HWND hwnd_parent, RECT ...@@ -704,9 +704,8 @@ static void initialize_navpane(ExplorerBrowserImpl *This, HWND hwnd_parent, RECT
WNDCLASSW wc; WNDCLASSW wc;
HWND splitter; HWND splitter;
int splitter_width = MulDiv(SPLITTER_WIDTH, This->dpix, USER_DEFAULT_SCREEN_DPI); int splitter_width = MulDiv(SPLITTER_WIDTH, This->dpix, USER_DEFAULT_SCREEN_DPI);
static const WCHAR navpane_classname[] = {'e','b','_','n','a','v','p','a','n','e',0};
if( !GetClassInfoW(shell32_hInstance, navpane_classname, &wc) ) if( !GetClassInfoW(shell32_hInstance, L"eb_navpane", &wc) )
{ {
wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = navpane_wndproc; wc.lpfnWndProc = navpane_wndproc;
...@@ -717,12 +716,12 @@ static void initialize_navpane(ExplorerBrowserImpl *This, HWND hwnd_parent, RECT ...@@ -717,12 +716,12 @@ static void initialize_navpane(ExplorerBrowserImpl *This, HWND hwnd_parent, RECT
wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_SIZEWE); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_SIZEWE);
wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = navpane_classname; wc.lpszClassName = L"eb_navpane";
if (!RegisterClassW(&wc)) return; if (!RegisterClassW(&wc)) return;
} }
splitter = CreateWindowExW(0, navpane_classname, NULL, splitter = CreateWindowExW(0, L"eb_navpane", NULL,
WS_CHILD | WS_TABSTOP | WS_VISIBLE, WS_CHILD | WS_TABSTOP | WS_VISIBLE,
rc->right - splitter_width, rc->top, rc->right - splitter_width, rc->top,
splitter_width, rc->bottom - rc->top, splitter_width, rc->bottom - rc->top,
...@@ -861,8 +860,6 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface, ...@@ -861,8 +860,6 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
WNDCLASSW wc; WNDCLASSW wc;
LONG style; LONG style;
HDC parent_dc; HDC parent_dc;
static const WCHAR EB_CLASS_NAME[] =
{'E','x','p','l','o','r','e','r','B','r','o','w','s','e','r','C','o','n','t','r','o','l',0};
TRACE("%p (%p, %p, %p)\n", This, hwndParent, prc, pfs); TRACE("%p (%p, %p, %p)\n", This, hwndParent, prc, pfs);
...@@ -872,7 +869,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface, ...@@ -872,7 +869,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
if(!hwndParent) if(!hwndParent)
return E_INVALIDARG; return E_INVALIDARG;
if( !GetClassInfoW(shell32_hInstance, EB_CLASS_NAME, &wc) ) if( !GetClassInfoW(shell32_hInstance, L"ExplorerBrowserControl", &wc) )
{ {
wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = main_wndproc; wc.lpfnWndProc = main_wndproc;
...@@ -883,7 +880,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface, ...@@ -883,7 +880,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = EB_CLASS_NAME; wc.lpszClassName = L"ExplorerBrowserControl";
if (!RegisterClassW(&wc)) return E_FAIL; if (!RegisterClassW(&wc)) return E_FAIL;
} }
...@@ -897,7 +894,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface, ...@@ -897,7 +894,7 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
if (!(This->eb_options & EBO_NOBORDER)) if (!(This->eb_options & EBO_NOBORDER))
style |= WS_BORDER; style |= WS_BORDER;
This->hwnd_main = CreateWindowExW(WS_EX_CONTROLPARENT, EB_CLASS_NAME, NULL, style, This->hwnd_main = CreateWindowExW(WS_EX_CONTROLPARENT, L"ExplorerBrowserControl", NULL, style,
prc->left, prc->top, prc->left, prc->top,
prc->right - prc->left, prc->bottom - prc->top, prc->right - prc->left, prc->bottom - prc->top,
hwndParent, 0, shell32_hInstance, This); hwndParent, 0, shell32_hInstance, This);
......
...@@ -68,9 +68,6 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags ...@@ -68,9 +68,6 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags
HANDLE hFile; HANDLE hFile;
WCHAR szPath[MAX_PATH]; WCHAR szPath[MAX_PATH];
BOOL succeeded = TRUE; BOOL succeeded = TRUE;
static const WCHAR stars[] = { '*','.','*',0 };
static const WCHAR dot[] = { '.',0 };
static const WCHAR dotdot[] = { '.','.',0 };
TRACE("(%p)->(path=%s flags=0x%08x)\n", list, debugstr_w(lpszPath), dwFlags); TRACE("(%p)->(path=%s flags=0x%08x)\n", list, debugstr_w(lpszPath), dwFlags);
...@@ -78,7 +75,7 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags ...@@ -78,7 +75,7 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags
lstrcpyW(szPath, lpszPath); lstrcpyW(szPath, lpszPath);
PathAddBackslashW(szPath); PathAddBackslashW(szPath);
lstrcatW(szPath,stars); lstrcatW(szPath,L"*");
hFile = FindFirstFileW(szPath,&stffile); hFile = FindFirstFileW(szPath,&stffile);
if ( hFile != INVALID_HANDLE_VALUE ) if ( hFile != INVALID_HANDLE_VALUE )
...@@ -92,7 +89,7 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags ...@@ -92,7 +89,7 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags
{ {
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
dwFlags & SHCONTF_FOLDERS && dwFlags & SHCONTF_FOLDERS &&
wcscmp(stffile.cFileName, dot) && wcscmp(stffile.cFileName, dotdot)) wcscmp(stffile.cFileName, L".") && wcscmp(stffile.cFileName, L".."))
{ {
pidl = _ILCreateFromFindDataW(&stffile); pidl = _ILCreateFromFindDataW(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl); succeeded = succeeded && AddToEnumList(list, pidl);
......
...@@ -133,27 +133,22 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP ...@@ -133,27 +133,22 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP
int icon_idx; int icon_idx;
WCHAR wszPath[MAX_PATH]; WCHAR wszPath[MAX_PATH];
WCHAR wszCLSIDValue[CHARS_IN_GUID]; WCHAR wszCLSIDValue[CHARS_IN_GUID];
static const WCHAR shellClassInfo[] = { '.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0 };
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 };
if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, iconFile, if (SHELL32_GetCustomFolderAttribute(This->pidl, L".ShellClassInfo", L"IconFile",
wszPath, MAX_PATH)) wszPath, MAX_PATH))
{ {
WCHAR wszIconIndex[10]; WCHAR wszIconIndex[10];
SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, iconIndex, SHELL32_GetCustomFolderAttribute(This->pidl, L".ShellClassInfo", L"IconIndex",
wszIconIndex, 10); wszIconIndex, 10);
*piIndex = wcstol(wszIconIndex, NULL, 10); *piIndex = wcstol(wszIconIndex, NULL, 10);
} }
else if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, clsid, else if (SHELL32_GetCustomFolderAttribute(This->pidl, L".ShellClassInfo", L"CLSID",
wszCLSIDValue, CHARS_IN_GUID) && wszCLSIDValue, CHARS_IN_GUID) &&
HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &icon_idx)) HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &icon_idx))
{ {
*piIndex = icon_idx; *piIndex = icon_idx;
} }
else if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, clsid2, else if (SHELL32_GetCustomFolderAttribute(This->pidl, L".ShellClassInfo", L"CLSID2",
wszCLSIDValue, CHARS_IN_GUID) && wszCLSIDValue, CHARS_IN_GUID) &&
HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &icon_idx)) HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &icon_idx))
{ {
...@@ -161,9 +156,7 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP ...@@ -161,9 +156,7 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP
} }
else else
{ {
static const WCHAR folder[] = { 'F','o','l','d','e','r',0 }; if (!HCR_GetDefaultIconW(L"Folder", szIconFile, cchMax, &icon_idx))
if (!HCR_GetDefaultIconW(folder, szIconFile, cchMax, &icon_idx))
{ {
lstrcpynW(szIconFile, swShell32Name, cchMax); lstrcpynW(szIconFile, swShell32Name, cchMax);
icon_idx = -IDI_SHELL_FOLDER; icon_idx = -IDI_SHELL_FOLDER;
...@@ -209,13 +202,9 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN ...@@ -209,13 +202,9 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN
/* my computer and other shell extensions */ /* my computer and other shell extensions */
else if ((riid = _ILGetGUIDPointer(pSimplePidl))) else if ((riid = _ILGetGUIDPointer(pSimplePidl)))
{ {
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]; WCHAR xriid[50];
swprintf(xriid, ARRAY_SIZE(xriid), fmt, swprintf(xriid, ARRAY_SIZE(xriid), L"CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3, riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]); riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
...@@ -243,8 +232,6 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN ...@@ -243,8 +232,6 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN
else if (_ILIsDrive (pSimplePidl)) else if (_ILIsDrive (pSimplePidl))
{ {
static const WCHAR drive[] = { 'D','r','i','v','e',0 };
icon_idx = -1; icon_idx = -1;
if (_ILGetDrive(pSimplePidl, sTemp, MAX_PATH)) if (_ILGetDrive(pSimplePidl, sTemp, MAX_PATH))
...@@ -265,7 +252,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN ...@@ -265,7 +252,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN
} }
else else
{ {
if (HCR_GetDefaultIconW(drive, szIconFile, cchMax, &icon_idx)) if (HCR_GetDefaultIconW(L"Drive", szIconFile, cchMax, &icon_idx))
{ {
*piIndex = icon_idx; *piIndex = icon_idx;
} }
......
...@@ -67,10 +67,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug = ...@@ -67,10 +67,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static CRITICAL_SECTION SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 };
static const WCHAR WindowMetrics[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
static const WCHAR ShellIconSize[] = {'S','h','e','l','l',' ','I','c','o','n',' ','S','i','z','e',0};
#define SIC_COMPARE_LISTINDEX 1 #define SIC_COMPARE_LISTINDEX 1
/***************************************************************************** /*****************************************************************************
...@@ -411,9 +407,9 @@ static int get_shell_icon_size(void) ...@@ -411,9 +407,9 @@ static int get_shell_icon_size(void)
DWORD value = 32, size = sizeof(buf), type; DWORD value = 32, size = sizeof(buf), type;
HKEY key; HKEY key;
if (!RegOpenKeyW( HKEY_CURRENT_USER, WindowMetrics, &key )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Control Panel\\Desktop\\WindowMetrics", &key ))
{ {
if (!RegQueryValueExW( key, ShellIconSize, NULL, &type, (BYTE *)buf, &size ) && type == REG_SZ) if (!RegQueryValueExW( key, L"Shell Icon Size", NULL, &type, (BYTE *)buf, &size ) && type == REG_SZ)
{ {
if (size == sizeof(buf)) buf[size / sizeof(WCHAR) - 1] = 0; if (size == sizeof(buf)) buf[size / sizeof(WCHAR) - 1] = 0;
value = wcstol( buf, NULL, 10 ); value = wcstol( buf, NULL, 10 );
...@@ -578,21 +574,15 @@ static int SIC_LoadOverlayIcon(int icon_idx) ...@@ -578,21 +574,15 @@ static int SIC_LoadOverlayIcon(int icon_idx)
LPCWSTR iconPath; LPCWSTR iconPath;
int iconIdx; 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 */ iconPath = swShell32Name; /* default: load icon from shell32.dll */
iconIdx = icon_idx; 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); DWORD count = sizeof(buffer);
swprintf(wszIdx, ARRAY_SIZE(wszIdx), wszNumFmt, icon_idx); swprintf(wszIdx, ARRAY_SIZE(wszIdx), L"%d", icon_idx);
/* read icon path and index */ /* read icon path and index */
if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
...@@ -601,7 +591,7 @@ static int SIC_LoadOverlayIcon(int icon_idx) ...@@ -601,7 +591,7 @@ static int SIC_LoadOverlayIcon(int icon_idx)
if (!p) if (!p)
{ {
ERR("Icon index in %s/%s corrupted, no comma.\n", debugstr_w(wszShellIcons),debugstr_w(wszIdx)); ERR("Icon index in Shell Icons/%s corrupted, no comma.\n", debugstr_w(wszIdx));
RegCloseKey(hKeyShellIcons); RegCloseKey(hKeyShellIcons);
return -1; return -1;
} }
...@@ -1001,8 +991,6 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex) ...@@ -1001,8 +991,6 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
*/ */
HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii) HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii)
{ {
static const WCHAR shell32dll[] = {'\\','s','h','e','l','l','3','2','.','d','l','l',0};
FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii); FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii);
if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) { if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) {
return E_INVALIDARG; return E_INVALIDARG;
...@@ -1012,7 +1000,7 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO ...@@ -1012,7 +1000,7 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO
/* no icons defined: use default */ /* no icons defined: use default */
sii->iIcon = -IDI_SHELL_FILE; sii->iIcon = -IDI_SHELL_FILE;
lstrcatW(sii->szPath, shell32dll); lstrcatW(sii->szPath, L"\\shell32.dll");
if (flags) if (flags)
FIXME("flags 0x%x not implemented\n", flags); FIXME("flags 0x%x not implemented\n", flags);
......
...@@ -98,11 +98,9 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context ...@@ -98,11 +98,9 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context
if (!home) return TRUE; if (!home) return TRUE;
if (is_macos()) if (is_macos())
{ {
static const WCHAR trashW[] = {'\\','.','T','r','a','s','h',0}; files = heap_alloc( (lstrlenW(home) + lstrlenW(L"\\.Trash") + 1) * sizeof(WCHAR) );
files = heap_alloc( (lstrlenW(home) + lstrlenW(trashW) + 1) * sizeof(WCHAR) );
lstrcpyW( files, home ); lstrcpyW( files, home );
lstrcatW( files, trashW ); lstrcatW( files, L"\\.Trash" );
files[1] = '\\'; /* change \??\ to \\?\ */ files[1] = '\\'; /* change \??\ to \\?\ */
} }
else else
...@@ -285,26 +283,23 @@ BOOL trash_file( const WCHAR *path ) ...@@ -285,26 +283,23 @@ BOOL trash_file( const WCHAR *path )
if (trash_info_dir) if (trash_info_dir)
{ {
static const WCHAR fmt[] = {'%','s','\\','%','s','.','t','r','a','s','h','i','n','f','o',0};
static const WCHAR fmt2[] = {'%','s','\\','%','s','-','%','0','8','x','.','t','r','a','s','h','i','n','f','o',0};
HANDLE handle; HANDLE handle;
ULONG infolen = lstrlenW(trash_info_dir) + lstrlenW(file) + 21; ULONG infolen = lstrlenW(trash_info_dir) + lstrlenW(file) + 21;
WCHAR *info = heap_alloc( infolen * sizeof(WCHAR) ); WCHAR *info = heap_alloc( infolen * sizeof(WCHAR) );
swprintf( info, infolen, fmt, trash_info_dir, file ); swprintf( info, infolen, L"%s\\%s.trashinfo", trash_info_dir, file );
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
{ {
handle = CreateFileW( info, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0 ); handle = CreateFileW( info, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0 );
if (handle != INVALID_HANDLE_VALUE) break; if (handle != INVALID_HANDLE_VALUE) break;
swprintf( info, infolen, fmt2, trash_info_dir, file, RtlRandom( &random_seed )); swprintf( info, infolen, L"%s\\%s-%08x.trashinfo", trash_info_dir, file, RtlRandom( &random_seed ));
} }
if (handle != INVALID_HANDLE_VALUE) if (handle != INVALID_HANDLE_VALUE)
{ {
if ((ret = write_trashinfo_file( handle, path ))) if ((ret = write_trashinfo_file( handle, path )))
{ {
static const WCHAR fmt[] = {'%','s','%','.','*','s',0};
ULONG namelen = lstrlenW(info) - lstrlenW(trash_info_dir) - 10 /* .trashinfo */; ULONG namelen = lstrlenW(info) - lstrlenW(trash_info_dir) - 10 /* .trashinfo */;
swprintf( dest, len, fmt, trash_dir, namelen, info + lstrlenW(trash_info_dir) ); swprintf( dest, len, L"%s%.*s", trash_dir, namelen, info + lstrlenW(trash_info_dir) );
ret = MoveFileW( path, dest ); ret = MoveFileW( path, dest );
} }
CloseHandle( handle ); CloseHandle( handle );
...@@ -313,15 +308,12 @@ BOOL trash_file( const WCHAR *path ) ...@@ -313,15 +308,12 @@ BOOL trash_file( const WCHAR *path )
} }
else else
{ {
static const WCHAR fmt[] = {'%','s','\\','%','s',0}; swprintf( dest, len, L"%s\\%s", trash_dir, file );
static const WCHAR fmt2[] = {'%','s','\\','%','s','-','%','0','8','x',0};
swprintf( dest, len, fmt, trash_dir, file );
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
{ {
ret = MoveFileW( path, dest ); ret = MoveFileW( path, dest );
if (ret || GetLastError() != ERROR_ALREADY_EXISTS) break; if (ret || GetLastError() != ERROR_ALREADY_EXISTS) break;
swprintf( dest, len, fmt2, trash_dir, file, RtlRandom( &random_seed )); swprintf( dest, len, L"%s\\%s-%08x", trash_dir, file, RtlRandom( &random_seed ));
} }
} }
if (ret) TRACE( "%s -> %s\n", debugstr_w(path), debugstr_w(dest) ); if (ret) TRACE( "%s -> %s\n", debugstr_w(path), debugstr_w(dest) );
...@@ -333,18 +325,15 @@ static BOOL get_trash_item_info( const WCHAR *filename, WIN32_FIND_DATAW *data ) ...@@ -333,18 +325,15 @@ static BOOL get_trash_item_info( const WCHAR *filename, WIN32_FIND_DATAW *data )
{ {
if (!trash_info_dir) if (!trash_info_dir)
{ {
static const WCHAR dsstoreW[] = {'.','D','S','_','S','t','o','r','e',0}; return !!wcscmp( filename, L".DS_Store" );
return !!wcscmp( filename, dsstoreW );
} }
else else
{ {
static const WCHAR fmt[] = {'%','s','\\','%','s','.','t','r','a','s','h','i','n','f','o',0};
HANDLE handle; HANDLE handle;
ULONG len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12; ULONG len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12;
WCHAR *info = heap_alloc( len * sizeof(WCHAR) ); WCHAR *info = heap_alloc( len * sizeof(WCHAR) );
swprintf( info, len, fmt, trash_info_dir, filename ); swprintf( info, len, L"%s\\%s.trashinfo", trash_info_dir, filename );
handle = CreateFileW( info, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); handle = CreateFileW( info, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
heap_free( info ); heap_free( info );
if (handle == INVALID_HANDLE_VALUE) return FALSE; if (handle == INVALID_HANDLE_VALUE) return FALSE;
...@@ -393,7 +382,6 @@ static HRESULT add_trash_item( WIN32_FIND_DATAW *orig_data, LPITEMIDLIST **pidls ...@@ -393,7 +382,6 @@ static HRESULT add_trash_item( WIN32_FIND_DATAW *orig_data, LPITEMIDLIST **pidls
static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count ) static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count )
{ {
static const WCHAR wildcardW[] = {'\\','*',0};
HANDLE handle; HANDLE handle;
WCHAR *file; WCHAR *file;
WIN32_FIND_DATAW data; WIN32_FIND_DATAW data;
...@@ -404,19 +392,16 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count ) ...@@ -404,19 +392,16 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count )
InitOnceExecuteOnce( &trash_dir_once, init_trash_dirs, NULL, NULL ); InitOnceExecuteOnce( &trash_dir_once, init_trash_dirs, NULL, NULL );
if (!trash_dir) return E_FAIL; if (!trash_dir) return E_FAIL;
file = heap_alloc( (lstrlenW(trash_dir) + lstrlenW(wildcardW) + 1) * sizeof(WCHAR) ); file = heap_alloc( (lstrlenW(trash_dir) + lstrlenW(L"\\*") + 1) * sizeof(WCHAR) );
lstrcpyW( file, trash_dir ); lstrcpyW( file, trash_dir );
lstrcatW( file, wildcardW ); lstrcatW( file, L"\\*" );
handle = FindFirstFileW( file, &data ); handle = FindFirstFileW( file, &data );
if (handle != INVALID_HANDLE_VALUE) if (handle != INVALID_HANDLE_VALUE)
{ {
do do
{ {
static const WCHAR dotW[] = {'.',0}; if (!wcscmp( data.cFileName, L"." )) continue;
static const WCHAR dotdotW[] = {'.','.',0}; if (!wcscmp( data.cFileName, L".." )) continue;
if (!wcscmp( data.cFileName, dotW )) continue;
if (!wcscmp( data.cFileName, dotdotW )) continue;
hr = add_trash_item( &data, &ret, &count, &size ); hr = add_trash_item( &data, &ret, &count, &size );
} while (hr == S_OK && FindNextFileW( handle, &data )); } while (hr == S_OK && FindNextFileW( handle, &data ));
FindClose( handle ); FindClose( handle );
......
...@@ -273,10 +273,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -273,10 +273,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
/* get the type name */ /* get the type name */
if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) 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)) if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL))
{ {
char ftype[80]; char ftype[80];
...@@ -287,7 +283,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -287,7 +283,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else else
{ {
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
lstrcatW (psfi->szTypeName, szFolder); lstrcatW (psfi->szTypeName, L"Folder");
else else
{ {
WCHAR sTemp[64]; WCHAR sTemp[64];
...@@ -296,7 +292,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -296,7 +292,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (sTemp[0] == 0 || (sTemp[0] == '.' && sTemp[1] == 0)) if (sTemp[0] == 0 || (sTemp[0] == '.' && sTemp[1] == 0))
{ {
/* "name" or "name." => "File" */ /* "name" or "name." => "File" */
lstrcpynW (psfi->szTypeName, szFile, 64); lstrcpynW (psfi->szTypeName, L"File", 64);
} }
else if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && else if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
...@@ -304,11 +300,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -304,11 +300,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (sTemp[0]) if (sTemp[0])
{ {
lstrcpynW (psfi->szTypeName, sTemp, 64); lstrcpynW (psfi->szTypeName, sTemp, 64);
lstrcatW (psfi->szTypeName, szSpaceFile); lstrcatW (psfi->szTypeName, L" file");
} }
else else
{ {
lstrcpynW (psfi->szTypeName, szFile, 64); lstrcpynW (psfi->szTypeName, L"File", 64);
} }
} }
} }
...@@ -349,7 +345,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -349,7 +345,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else else
{ {
WCHAR* szExt; WCHAR* szExt;
static const WCHAR p1W[] = {'%','1',0};
WCHAR sTemp [MAX_PATH]; WCHAR sTemp [MAX_PATH];
szExt = PathFindExtensionW(szFullPath); szExt = PathFindExtensionW(szFullPath);
...@@ -358,7 +353,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -358,7 +353,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon)) HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
{ {
if (wcscmp(p1W, sTemp)) if (wcscmp(L"%1", sTemp))
lstrcpyW(psfi->szDisplayName, sTemp); lstrcpyW(psfi->szDisplayName, sTemp);
else else
{ {
...@@ -404,7 +399,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -404,7 +399,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0);
else else
{ {
static const WCHAR p1W[] = {'%','1',0};
WCHAR sTemp[MAX_PATH]; WCHAR sTemp[MAX_PATH];
WCHAR *szExt; WCHAR *szExt;
int icon_idx = 0; int icon_idx = 0;
...@@ -417,7 +411,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -417,7 +411,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx)) HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
{ {
if (!wcscmp(p1W,sTemp)) /* icon is in the file */ if (!wcscmp(L"%1",sTemp)) /* icon is in the file */
lstrcpyW(sTemp, szFullPath); lstrcpyW(sTemp, szFullPath);
psfi->iIcon = SIC_GetIconIndex(sTemp, icon_idx, 0); psfi->iIcon = SIC_GetIconIndex(sTemp, icon_idx, 0);
...@@ -875,10 +869,8 @@ HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) ...@@ -875,10 +869,8 @@ HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
static void add_authors( HWND list ) static void add_authors( HWND list )
{ {
static const WCHAR eol[] = {'\r','\n',0};
static const WCHAR authors[] = {'A','U','T','H','O','R','S',0};
WCHAR *strW, *start, *end; WCHAR *strW, *start, *end;
HRSRC rsrc = FindResourceW( shell32_hInstance, authors, (LPCWSTR)RT_RCDATA ); HRSRC rsrc = FindResourceW( shell32_hInstance, L"AUTHORS", (LPCWSTR)RT_RCDATA );
char *strA = LockResource( LoadResource( shell32_hInstance, rsrc )); char *strA = LockResource( LoadResource( shell32_hInstance, rsrc ));
DWORD sizeW, sizeA = SizeofResource( shell32_hInstance, rsrc ); DWORD sizeW, sizeA = SizeofResource( shell32_hInstance, rsrc );
...@@ -888,12 +880,12 @@ static void add_authors( HWND list ) ...@@ -888,12 +880,12 @@ static void add_authors( HWND list )
MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW ); MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW );
strW[sizeW - 1] = 0; strW[sizeW - 1] = 0;
start = wcspbrk( strW, eol ); /* skip the header line */ start = wcspbrk( strW, L"\r\n" ); /* skip the header line */
while (start) while (start)
{ {
while (*start && wcschr( eol, *start )) start++; while (*start && wcschr( L"\r\n", *start )) start++;
if (!*start) break; if (!*start) break;
end = wcspbrk( start, eol ); end = wcspbrk( start, L"\r\n" );
if (end) *end++ = 0; if (end) *end++ = 0;
SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start ); SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start );
start = end; start = end;
...@@ -1026,8 +1018,6 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, ...@@ -1026,8 +1018,6 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
ABOUT_INFO info; ABOUT_INFO info;
LOGFONTW logFont; LOGFONTW logFont;
BOOL bRet; BOOL bRet;
static const WCHAR wszSHELL_ABOUT_MSGBOX[] =
{'S','H','E','L','L','_','A','B','O','U','T','_','M','S','G','B','O','X',0};
TRACE("\n"); TRACE("\n");
...@@ -1039,7 +1029,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, ...@@ -1039,7 +1029,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 ); SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
info.hFont = CreateFontIndirectW( &logFont ); info.hFont = CreateFontIndirectW( &logFont );
bRet = DialogBoxParamW( shell32_hInstance, wszSHELL_ABOUT_MSGBOX, hWnd, AboutDlgProc, (LPARAM)&info ); bRet = DialogBoxParamW( shell32_hInstance, L"SHELL_ABOUT_MSGBOX", hWnd, AboutDlgProc, (LPARAM)&info );
DeleteObject(info.hFont); DeleteObject(info.hFont);
return bRet; return bRet;
} }
......
...@@ -299,7 +299,6 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile ...@@ -299,7 +299,6 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
BOOL run_winemenubuilder( const WCHAR *args ) BOOL run_winemenubuilder( const WCHAR *args )
{ {
static const WCHAR menubuilder[] = {'\\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0};
LONG len; LONG len;
LPWSTR buffer; LPWSTR buffer;
STARTUPINFOW si; STARTUPINFOW si;
...@@ -308,8 +307,8 @@ BOOL run_winemenubuilder( const WCHAR *args ) ...@@ -308,8 +307,8 @@ BOOL run_winemenubuilder( const WCHAR *args )
WCHAR app[MAX_PATH]; WCHAR app[MAX_PATH];
void *redir; void *redir;
GetSystemDirectoryW( app, MAX_PATH - ARRAY_SIZE(menubuilder) ); GetSystemDirectoryW( app, MAX_PATH );
lstrcatW( app, menubuilder ); lstrcatW( app, L"\\winemenubuilder.exe" );
len = (lstrlenW( app ) + lstrlenW( args ) + 1) * sizeof(WCHAR); len = (lstrlenW( app ) + lstrlenW( args ) + 1) * sizeof(WCHAR);
buffer = heap_alloc( len ); buffer = heap_alloc( len );
...@@ -341,17 +340,16 @@ BOOL run_winemenubuilder( const WCHAR *args ) ...@@ -341,17 +340,16 @@ BOOL run_winemenubuilder( const WCHAR *args )
static BOOL StartLinkProcessor( LPCOLESTR szLink ) static BOOL StartLinkProcessor( LPCOLESTR szLink )
{ {
static const WCHAR szFormat[] = {' ','-','w',' ','"','%','s','"',0 };
LONG len; LONG len;
LPWSTR buffer; LPWSTR buffer;
BOOL ret; BOOL ret;
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR); len = (lstrlenW( szLink ) + 7) * sizeof(WCHAR);
buffer = heap_alloc( len ); buffer = heap_alloc( len );
if( !buffer ) if( !buffer )
return FALSE; return FALSE;
wsprintfW( buffer, szFormat, szLink ); swprintf( buffer, len, L" -w \"%s\"", szLink );
ret = run_winemenubuilder( buffer ); ret = run_winemenubuilder( buffer );
heap_free( buffer ); heap_free( buffer );
return ret; return ret;
...@@ -2429,7 +2427,6 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu, ...@@ -2429,7 +2427,6 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
UINT idCmdFirst, UINT idCmdLast, UINT uFlags ) UINT idCmdFirst, UINT idCmdLast, UINT uFlags )
{ {
IShellLinkImpl *This = impl_from_IContextMenu(iface); IShellLinkImpl *This = impl_from_IContextMenu(iface);
static WCHAR szOpen[] = { 'O','p','e','n',0 };
MENUITEMINFOW mii; MENUITEMINFOW mii;
int id = 1; int id = 1;
...@@ -2442,7 +2439,7 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu, ...@@ -2442,7 +2439,7 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
memset( &mii, 0, sizeof mii ); memset( &mii, 0, sizeof mii );
mii.cbSize = sizeof mii; mii.cbSize = sizeof mii;
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE; mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.dwTypeData = szOpen; mii.dwTypeData = (LPWSTR)L"Open";
mii.cch = lstrlenW( mii.dwTypeData ); mii.cch = lstrlenW( mii.dwTypeData );
mii.wID = idCmdFirst + id++; mii.wID = idCmdFirst + id++;
mii.fState = MFS_DEFAULT | MFS_ENABLED; mii.fState = MFS_DEFAULT | MFS_ENABLED;
...@@ -2482,7 +2479,6 @@ static HRESULT WINAPI ...@@ -2482,7 +2479,6 @@ static HRESULT WINAPI
ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
{ {
IShellLinkImpl *This = impl_from_IContextMenu(iface); IShellLinkImpl *This = impl_from_IContextMenu(iface);
static const WCHAR szOpen[] = { 'O','p','e','n',0 };
SHELLEXECUTEINFOW sei; SHELLEXECUTEINFOW sei;
HWND hwnd = NULL; /* FIXME: get using interface set from IObjectWithSite */ HWND hwnd = NULL; /* FIXME: get using interface set from IObjectWithSite */
LPWSTR args = NULL; LPWSTR args = NULL;
...@@ -2530,8 +2526,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ...@@ -2530,8 +2526,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
lstrcatW( args, This->sArgs ); lstrcatW( args, This->sArgs );
if ( iciex->lpParametersW && iciex->lpParametersW[0] ) if ( iciex->lpParametersW && iciex->lpParametersW[0] )
{ {
static const WCHAR space[] = { ' ', 0 }; lstrcatW( args, L" " );
lstrcatW( args, space );
lstrcatW( args, iciex->lpParametersW ); lstrcatW( args, iciex->lpParametersW );
} }
} }
...@@ -2544,7 +2539,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) ...@@ -2544,7 +2539,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
sei.lpIDList = This->pPidl; sei.lpIDList = This->pPidl;
sei.lpDirectory = This->sWorkDir; sei.lpDirectory = This->sWorkDir;
sei.lpParameters = args; sei.lpParameters = args;
sei.lpVerb = szOpen; sei.lpVerb = L"Open";
if( ShellExecuteExW( &sei ) ) if( ShellExecuteExW( &sei ) )
r = S_OK; r = S_OK;
......
...@@ -118,10 +118,7 @@ HRESULT WINAPI SHCoCreateInstance( ...@@ -118,10 +118,7 @@ HRESULT WINAPI SHCoCreateInstance(
IID iid; IID iid;
const CLSID * myclsid = clsid; const CLSID * myclsid = clsid;
WCHAR sKeyName[MAX_PATH]; WCHAR sKeyName[MAX_PATH];
static const WCHAR sCLSID[] = {'C','L','S','I','D','\\','\0'};
WCHAR sClassID[60]; 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]; WCHAR sDllPath[MAX_PATH];
HKEY hKey = 0; HKEY hKey = 0;
DWORD dwSize; DWORD dwSize;
...@@ -150,15 +147,13 @@ HRESULT WINAPI SHCoCreateInstance( ...@@ -150,15 +147,13 @@ HRESULT WINAPI SHCoCreateInstance(
/* we look up the dll path in the registry */ /* we look up the dll path in the registry */
SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID)); SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID));
lstrcpyW(sKeyName, sCLSID); swprintf( sKeyName, ARRAY_SIZE(sKeyName), L"CLSID\\%s\\InprocServer32", sClassID );
lstrcatW(sKeyName, sClassID);
lstrcatW(sKeyName, sInProcServer32);
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey))
return E_ACCESSDENIED; return E_ACCESSDENIED;
/* if a special registry key is set, we load a shell extension without help of OLE32 */ /* 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 */ /* load an external dll without ole32 */
HANDLE hLibrary; HANDLE hLibrary;
......
...@@ -1183,17 +1183,6 @@ BOOL WINAPI DAD_ShowDragImage(BOOL bShow) ...@@ -1183,17 +1183,6 @@ BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
return FALSE; 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 * ReadCabinetState [SHELL32.651] NT 4.0
* *
...@@ -1208,12 +1197,11 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length) ...@@ -1208,12 +1197,11 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
if( (cs == NULL) || (length < (int)sizeof(*cs)) ) if( (cs == NULL) || (length < (int)sizeof(*cs)) )
return FALSE; 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 ) if( r == ERROR_SUCCESS )
{ {
type = REG_BINARY; type = REG_BINARY;
r = RegQueryValueExW( hkey, szwSettings, r = RegQueryValueExW( hkey, L"Settings", NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
...@@ -1255,13 +1243,11 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs) ...@@ -1255,13 +1243,11 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
if( cs == NULL ) if( cs == NULL )
return FALSE; 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); NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
if( r == ERROR_SUCCESS ) if( r == ERROR_SUCCESS )
{ {
r = RegSetValueExW( hkey, szwSettings, 0, r = RegSetValueExW( hkey, L"Settings", 0, REG_BINARY, (LPBYTE) cs, cs->cLength);
REG_BINARY, (LPBYTE) cs, cs->cLength);
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
...@@ -1700,7 +1686,6 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_if ...@@ -1700,7 +1686,6 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_if
*/ */
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj) 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]; WCHAR szHandler[64];
DWORD dwHandlerLen; DWORD dwHandlerLen;
WCHAR szClsidHandler[39]; WCHAR szClsidHandler[39];
...@@ -1723,7 +1708,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ ...@@ -1723,7 +1708,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_
if (lRet != ERROR_SUCCESS) if (lRet != ERROR_SUCCESS)
return NULL; 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); RegCloseKey(hkBase);
if (lRet == ERROR_SUCCESS) if (lRet == ERROR_SUCCESS)
{ {
...@@ -1990,8 +1975,6 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, ...@@ -1990,8 +1975,6 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
const WCHAR *basename; const WCHAR *basename;
WCHAR *dst_basename; WCHAR *dst_basename;
int i=2; 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), TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
pszName, pfMustCopy, uFlags); pszName, pfMustCopy, uFlags);
...@@ -2023,11 +2006,11 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, ...@@ -2023,11 +2006,11 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
dst_basename = pszName + lstrlenW(pszName); dst_basename = pszName + lstrlenW(pszName);
swprintf(dst_basename, pszName + MAX_PATH - dst_basename, lnkformat, basename); swprintf(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename);
while (GetFileAttributesW(pszName) != INVALID_FILE_ATTRIBUTES) while (GetFileAttributesW(pszName) != INVALID_FILE_ATTRIBUTES)
{ {
swprintf(dst_basename, pszName + MAX_PATH - dst_basename, lnkformatnum, basename, i); swprintf(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i);
i++; i++;
} }
......
...@@ -389,9 +389,7 @@ static BOOL PathIsExeW (LPCWSTR lpszPath) ...@@ -389,9 +389,7 @@ static BOOL PathIsExeW (LPCWSTR lpszPath)
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath); LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
int i; int i;
static const WCHAR lpszExtensions[][4] = static const WCHAR lpszExtensions[][4] =
{{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'}, {L"exe", L"com", L"pif",L"cmd", L"bat", L"scf",L"scr",L"" };
{'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'},
{'s','c','r','\0'}, {'\0'} };
TRACE("path=%s\n",debugstr_w(lpszPath)); TRACE("path=%s\n",debugstr_w(lpszPath));
...@@ -2647,21 +2645,16 @@ static DWORD xdg_config_len; ...@@ -2647,21 +2645,16 @@ static DWORD xdg_config_len;
static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context ) static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context )
{ {
static const WCHAR configW[] = {'X','D','G','_','C','O','N','F','I','G','_','H','O','M','E',0}; const WCHAR *var, *fmt = L"\\??\\unix%s/user-dirs.dirs";
static const WCHAR homedirW[] = {'W','I','N','E','H','O','M','E','D','I','R',0};
static const WCHAR home_fmtW[] = {'%','s','/','.','c','o','n','f','i','g','/','u','s','e','r','-','d','i','r','s','.','d','i','r','s',0};
static const WCHAR config_fmtW[] = {'\\','?','?','\\','u','n','i','x','%','s','/','u','s','e','r','-','d','i','r','s','.','d','i','r','s',0};
const WCHAR *fmt = config_fmtW;
char *p; char *p;
WCHAR *name, *ptr; WCHAR *name, *ptr;
HANDLE file; HANDLE file;
DWORD len; DWORD len;
WCHAR var[MAX_PATH];
if (!GetEnvironmentVariableW( configW, var, MAX_PATH ) || !var[0]) if (!(var = _wgetenv( L"XDG_CONFIG_HOME" )) || var[0] != '/')
{ {
if (!GetEnvironmentVariableW( homedirW, var, MAX_PATH )) return TRUE; if (!(var = _wgetenv( L"WINEHOMEDIR" ))) return TRUE;
fmt = home_fmtW; fmt = L"%s/.config/user-dirs.dirs";
} }
len = lstrlenW(var) + lstrlenW(fmt); len = lstrlenW(var) + lstrlenW(fmt);
name = heap_alloc( len * sizeof(WCHAR) ); name = heap_alloc( len * sizeof(WCHAR) );
...@@ -3254,37 +3247,32 @@ static HRESULT _SHRegisterCommonShellFolders(void) ...@@ -3254,37 +3247,32 @@ static HRESULT _SHRegisterCommonShellFolders(void)
*/ */
static HRESULT create_extra_folders(void) static HRESULT create_extra_folders(void)
{ {
static const WCHAR environW[] = {'E','n','v','i','r','o','n','m','e','n','t',0};
static const WCHAR microsoftW[] = {'M','i','c','r','o','s','o','f','t',0};
static const WCHAR TempW[] = {'T','e','m','p',0};
static const WCHAR TEMPW[] = {'T','E','M','P',0};
static const WCHAR TMPW[] = {'T','M','P',0};
WCHAR path[MAX_PATH+5]; WCHAR path[MAX_PATH+5];
HRESULT hr; HRESULT hr;
HKEY hkey; HKEY hkey;
DWORD type, size, ret; DWORD type, size, ret;
ret = RegCreateKeyW( HKEY_CURRENT_USER, environW, &hkey ); ret = RegCreateKeyW( HKEY_CURRENT_USER, L"Environment", &hkey );
if (ret) return HRESULT_FROM_WIN32( ret ); if (ret) return HRESULT_FROM_WIN32( ret );
/* FIXME: should be under AppData, but we don't want spaces in the temp path */ /* FIXME: should be under AppData, but we don't want spaces in the temp path */
hr = SHGetFolderPathAndSubDirW( 0, CSIDL_PROFILE | CSIDL_FLAG_CREATE, NULL, hr = SHGetFolderPathAndSubDirW( 0, CSIDL_PROFILE | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_DEFAULT, TempW, path ); SHGFP_TYPE_DEFAULT, L"Temp", path );
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
size = sizeof(path); size = sizeof(path);
if (RegQueryValueExW( hkey, TEMPW, NULL, &type, (LPBYTE)path, &size )) if (RegQueryValueExW( hkey, L"TEMP", NULL, &type, (LPBYTE)path, &size ))
RegSetValueExW( hkey, TEMPW, 0, REG_SZ, (LPBYTE)path, (lstrlenW(path) + 1) * sizeof(WCHAR) ); RegSetValueExW( hkey, L"TEMP", 0, REG_SZ, (LPBYTE)path, (lstrlenW(path) + 1) * sizeof(WCHAR) );
size = sizeof(path); size = sizeof(path);
if (RegQueryValueExW( hkey, TMPW, NULL, &type, (LPBYTE)path, &size )) if (RegQueryValueExW( hkey, L"TMP", NULL, &type, (LPBYTE)path, &size ))
RegSetValueExW( hkey, TMPW, 0, REG_SZ, (LPBYTE)path, (lstrlenW(path) + 1) * sizeof(WCHAR) ); RegSetValueExW( hkey, L"TMP", 0, REG_SZ, (LPBYTE)path, (lstrlenW(path) + 1) * sizeof(WCHAR) );
} }
RegCloseKey( hkey ); RegCloseKey( hkey );
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = SHGetFolderPathAndSubDirW( 0, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, NULL, hr = SHGetFolderPathAndSubDirW( 0, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_DEFAULT, microsoftW, path ); SHGFP_TYPE_DEFAULT, L"Microsoft", path );
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
...@@ -3302,14 +3290,6 @@ static HRESULT create_extra_folders(void) ...@@ -3302,14 +3290,6 @@ static HRESULT create_extra_folders(void)
*/ */
static HRESULT set_folder_attributes(void) static HRESULT set_folder_attributes(void)
{ {
static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] = {'\\','S','h','e','l','l','F','o','l','d','e','r', 0 };
static const WCHAR wfparsingW[] = {'W','a','n','t','s','F','O','R','P','A','R','S','I','N','G',0};
static const WCHAR wfdisplayW[] = {'W','a','n','t','s','F','O','R','D','I','S','P','L','A','Y',0};
static const WCHAR hideasdeleteW[] = {'H','i','d','e','A','s','D','e','l','e','t','e','P','e','r','U','s','e','r',0};
static const WCHAR cfattributesW[] = {'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0};
static const WCHAR emptyW[] = {0};
static const struct static const struct
{ {
const CLSID *clsid; const CLSID *clsid;
...@@ -3335,29 +3315,29 @@ static HRESULT set_folder_attributes(void) ...@@ -3335,29 +3315,29 @@ static HRESULT set_folder_attributes(void)
}; };
unsigned int i; unsigned int i;
WCHAR buffer[39 + ARRAY_SIZE(clsidW) + ARRAY_SIZE(shellfolderW)]; WCHAR buffer[39 + ARRAY_SIZE(L"CLSID\\") + ARRAY_SIZE(L"\\ShellFolder")];
LONG res; LONG res;
HKEY hkey; HKEY hkey;
for (i = 0; i < ARRAY_SIZE(folders); i++) for (i = 0; i < ARRAY_SIZE(folders); i++)
{ {
lstrcpyW( buffer, clsidW ); lstrcpyW( buffer, L"CLSID\\" );
StringFromGUID2( folders[i].clsid, buffer + lstrlenW(buffer), 39 ); StringFromGUID2( folders[i].clsid, buffer + lstrlenW(buffer), 39 );
lstrcatW( buffer, shellfolderW ); lstrcatW( buffer, L"\\ShellFolder" );
res = RegCreateKeyExW( HKEY_CLASSES_ROOT, buffer, 0, NULL, 0, res = RegCreateKeyExW( HKEY_CLASSES_ROOT, buffer, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &hkey, NULL); KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
if (res) return HRESULT_FROM_WIN32( res ); if (res) return HRESULT_FROM_WIN32( res );
if (folders[i].wfparsing) if (folders[i].wfparsing)
res = RegSetValueExW( hkey, wfparsingW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) ); res = RegSetValueExW( hkey, L"WantsFORPARSING", 0, REG_SZ, (const BYTE *)L"", sizeof(WCHAR) );
if (folders[i].wfdisplay) if (folders[i].wfdisplay)
res = RegSetValueExW( hkey, wfdisplayW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) ); res = RegSetValueExW( hkey, L"WantsFORDISPLAY", 0, REG_SZ, (const BYTE *)L"", sizeof(WCHAR) );
if (folders[i].hideasdel) if (folders[i].hideasdel)
res = RegSetValueExW( hkey, hideasdeleteW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) ); res = RegSetValueExW( hkey, L"HideAsDeletePerUser", 0, REG_SZ, (const BYTE *)L"", sizeof(WCHAR) );
if (folders[i].attr) if (folders[i].attr)
res = RegSetValueExW( hkey, L"Attributes", 0, REG_DWORD, res = RegSetValueExW( hkey, L"Attributes", 0, REG_DWORD,
(const BYTE *)&folders[i].attr, sizeof(DWORD)); (const BYTE *)&folders[i].attr, sizeof(DWORD));
if (folders[i].call_for_attr) if (folders[i].call_for_attr)
res = RegSetValueExW( hkey, cfattributesW, 0, REG_DWORD, res = RegSetValueExW( hkey, L"CallForAttributes", 0, REG_DWORD,
(const BYTE *)&folders[i].call_for_attr, sizeof(DWORD)); (const BYTE *)&folders[i].call_for_attr, sizeof(DWORD));
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
...@@ -3615,7 +3595,6 @@ static HRESULT get_known_folder_registry_path( ...@@ -3615,7 +3595,6 @@ static HRESULT get_known_folder_registry_path(
LPWSTR lpStringGuid, LPWSTR lpStringGuid,
LPWSTR *lpPath) LPWSTR *lpPath)
{ {
static const WCHAR sBackslash[] = {'\\',0};
HRESULT hr = S_OK; HRESULT hr = S_OK;
int length; int length;
WCHAR sGuid[50]; WCHAR sGuid[50];
...@@ -3634,8 +3613,7 @@ static HRESULT get_known_folder_registry_path( ...@@ -3634,8 +3613,7 @@ static HRESULT get_known_folder_registry_path(
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
lstrcpyW(*lpPath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions"); lstrcpyW(*lpPath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\");
lstrcatW(*lpPath, sBackslash);
lstrcatW(*lpPath, sGuid); lstrcatW(*lpPath, sGuid);
} }
...@@ -3763,13 +3741,12 @@ static HRESULT redirect_known_folder( ...@@ -3763,13 +3741,12 @@ static HRESULT redirect_known_folder(
/* copy content if required */ /* copy content if required */
if(SUCCEEDED(hr) && (flags & KF_REDIRECT_COPY_CONTENTS) ) if(SUCCEEDED(hr) && (flags & KF_REDIRECT_COPY_CONTENTS) )
{ {
static const WCHAR sWildcard[] = {'\\','*',0};
WCHAR srcPath[MAX_PATH+1], dstPath[MAX_PATH+1]; WCHAR srcPath[MAX_PATH+1], dstPath[MAX_PATH+1];
SHFILEOPSTRUCTW fileOp; SHFILEOPSTRUCTW fileOp;
ZeroMemory(srcPath, sizeof(srcPath)); ZeroMemory(srcPath, sizeof(srcPath));
lstrcpyW(srcPath, lpSrcPath); lstrcpyW(srcPath, lpSrcPath);
lstrcatW(srcPath, sWildcard); lstrcatW(srcPath, L"\\*");
ZeroMemory(dstPath, sizeof(dstPath)); ZeroMemory(dstPath, sizeof(dstPath));
lstrcpyW(dstPath, pszTargetPath); lstrcpyW(dstPath, pszTargetPath);
...@@ -3949,7 +3926,6 @@ static HRESULT get_known_folder_path( ...@@ -3949,7 +3926,6 @@ static HRESULT get_known_folder_path(
LPWSTR registryPath, LPWSTR registryPath,
LPWSTR *ppszPath) LPWSTR *ppszPath)
{ {
static const WCHAR sBackslash[] = {'\\',0};
HRESULT hr; HRESULT hr;
DWORD dwSize, dwType; DWORD dwSize, dwType;
WCHAR path[MAX_PATH] = {0}; WCHAR path[MAX_PATH] = {0};
...@@ -3979,7 +3955,7 @@ static HRESULT get_known_folder_path( ...@@ -3979,7 +3955,7 @@ static HRESULT get_known_folder_path(
} }
lstrcatW(path, parentPath); lstrcatW(path, parentPath);
lstrcatW(path, sBackslash); lstrcatW(path, L"\\");
heap_free(parentRegistryPath); heap_free(parentRegistryPath);
heap_free(parentPath); heap_free(parentPath);
......
...@@ -254,8 +254,6 @@ DWORD WINAPI CheckEscapesA( ...@@ -254,8 +254,6 @@ DWORD WINAPI CheckEscapesA(
return ret; return ret;
} }
static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
/************************************************************************* /*************************************************************************
* CheckEscapesW [SHELL32.@] * CheckEscapesW [SHELL32.@]
* *
...@@ -270,7 +268,7 @@ DWORD WINAPI CheckEscapesW( ...@@ -270,7 +268,7 @@ DWORD WINAPI CheckEscapesW(
TRACE("%s, %u.\n", debugstr_w(string), len); TRACE("%s, %u.\n", debugstr_w(string), len);
if (StrPBrkW(string, strEscapedChars) && size + 2 <= len) if (StrPBrkW(string, L" \",;^") && size + 2 <= len)
{ {
s = &string[size - 1]; s = &string[size - 1];
d = &string[size + 2]; d = &string[size + 2];
......
...@@ -150,7 +150,6 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, ...@@ -150,7 +150,6 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
static const WCHAR unix_root[] = {'\\','\\','?','\\','u','n','i','x','\\',0};
IDesktopFolderImpl *This = impl_from_IShellFolder2(iface); IDesktopFolderImpl *This = impl_from_IShellFolder2(iface);
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
...@@ -186,7 +185,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, ...@@ -186,7 +185,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
pidlTemp = _ILCreateMyComputer (); pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName; szNext = lpszDisplayName;
} }
else if (!wcsncmp( lpszDisplayName, unix_root, 9 )) else if (!wcsncmp( lpszDisplayName, L"\\\\?\\unix\\", 9 ))
{ {
pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder); pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder);
szNext = lpszDisplayName; szNext = lpszDisplayName;
...@@ -279,19 +278,11 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, ...@@ -279,19 +278,11 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
static void add_shell_namespace_extensions(IEnumIDListImpl *list, HKEY root) static void add_shell_namespace_extensions(IEnumIDListImpl *list, HKEY root)
{ {
static const WCHAR Desktop_NameSpaceW[] = { 'S','O','F','T','W','A','R','E','\\', WCHAR guid[39], clsidkeyW[60];
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'E','x','p','l','o','r','e','r','\\','D','e','s','k','t','o','p','\\',
'N','a','m','e','s','p','a','c','e','\0' };
static const WCHAR clsidfmtW[] = {'C','L','S','I','D','\\','%','s','\\',
'S','h','e','l','l','F','o','l','d','e','r',0};
static const WCHAR attributesW[] = {'A','t','t','r','i','b','u','t','e','s',0};
WCHAR guid[39], clsidkeyW[ARRAY_SIZE(clsidfmtW) + 39];
DWORD size, i = 0; DWORD size, i = 0;
HKEY hkey; HKEY hkey;
if (RegOpenKeyExW(root, Desktop_NameSpaceW, 0, KEY_READ, &hkey)) if (RegOpenKeyExW(root, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace", 0, KEY_READ, &hkey))
return; return;
size = ARRAY_SIZE(guid); size = ARRAY_SIZE(guid);
...@@ -300,8 +291,8 @@ static void add_shell_namespace_extensions(IEnumIDListImpl *list, HKEY root) ...@@ -300,8 +291,8 @@ static void add_shell_namespace_extensions(IEnumIDListImpl *list, HKEY root)
DWORD attributes, value_size = sizeof(attributes); DWORD attributes, value_size = sizeof(attributes);
/* Check if extension is configured as nonenumerable */ /* Check if extension is configured as nonenumerable */
swprintf(clsidkeyW, ARRAY_SIZE(clsidkeyW), clsidfmtW, guid); swprintf(clsidkeyW, ARRAY_SIZE(clsidkeyW), L"CLSID\\%s\\ShellFolder", guid);
RegGetValueW(HKEY_CLASSES_ROOT, clsidkeyW, attributesW, RRF_RT_REG_DWORD | RRF_ZEROONFAILURE, RegGetValueW(HKEY_CLASSES_ROOT, clsidkeyW, L"Attributes", RRF_RT_REG_DWORD | RRF_ZEROONFAILURE,
NULL, &attributes, &value_size); NULL, &attributes, &value_size);
if (!(attributes & SFGAO_NONENUMERATED)) if (!(attributes & SFGAO_NONENUMERATED))
...@@ -628,21 +619,13 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, ...@@ -628,21 +619,13 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
else else
{ {
/* get the "WantsFORPARSING" flag from the registry */ /* get the "WantsFORPARSING" flag from the registry */
static const WCHAR clsidW[] =
{ 'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] =
{ '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
static const WCHAR wantsForParsingW[] =
{ 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
'g',0 };
WCHAR szRegPath[100]; WCHAR szRegPath[100];
LONG r; LONG r;
lstrcpyW (szRegPath, clsidW); lstrcpyW (szRegPath, L"CLSID\\");
SHELL32_GUIDToStringW (clsid, &szRegPath[6]); SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
lstrcatW (szRegPath, shellfolderW); lstrcatW (szRegPath, L"\\shellfolder");
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, L"WantsForParsing", NULL, NULL, NULL);
wantsForParsingW, NULL, NULL, NULL);
if (r == ERROR_SUCCESS) if (r == ERROR_SUCCESS)
bWantsForParsing = TRUE; bWantsForParsing = TRUE;
else else
......
...@@ -242,13 +242,6 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface, ...@@ -242,13 +242,6 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
/* retrieve a map of drives that should be displayed */ /* retrieve a map of drives that should be displayed */
static DWORD get_drive_map(void) static DWORD get_drive_map(void)
{ {
static const WCHAR policiesW[] = {'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','\\',
'E','x','p','l','o','r','e','r',0};
static const WCHAR nodrivesW[] = {'N','o','D','r','i','v','e','s',0};
static DWORD drive_mask; static DWORD drive_mask;
static BOOL init_done = FALSE; static BOOL init_done = FALSE;
...@@ -257,17 +250,17 @@ static DWORD get_drive_map(void) ...@@ -257,17 +250,17 @@ static DWORD get_drive_map(void)
DWORD type, size, data, mask = 0; DWORD type, size, data, mask = 0;
HKEY hkey; HKEY hkey;
if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, policiesW, &hkey )) if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", &hkey ))
{ {
size = sizeof(data); size = sizeof(data);
if (!RegQueryValueExW( hkey, nodrivesW, NULL, &type, (LPBYTE)&data, &size ) && type == REG_DWORD) if (!RegQueryValueExW( hkey, L"NoDrives", NULL, &type, (LPBYTE)&data, &size ) && type == REG_DWORD)
mask |= data; mask |= data;
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
if (!RegOpenKeyW( HKEY_CURRENT_USER, policiesW, &hkey )) if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", &hkey ))
{ {
size = sizeof(data); size = sizeof(data);
if (!RegQueryValueExW( hkey, nodrivesW, NULL, &type, (LPBYTE)&data, &size ) && type == REG_DWORD) if (!RegQueryValueExW( hkey, L"NoDrives", NULL, &type, (LPBYTE)&data, &size ) && type == REG_DWORD)
mask |= data; mask |= data;
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
...@@ -281,12 +274,6 @@ static DWORD get_drive_map(void) ...@@ -281,12 +274,6 @@ static DWORD get_drive_map(void)
/************************************************************************** /**************************************************************************
* CreateMyCompEnumList() * CreateMyCompEnumList()
*/ */
static const WCHAR MyComputer_NameSpaceW[] = { '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','\\','M','y','C','o','m','p','u','t','e','r','\\','N','a','m',
'e','s','p','a','c','e','\0' };
static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags) static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags)
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
...@@ -296,7 +283,7 @@ static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags) ...@@ -296,7 +283,7 @@ static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags)
/* enumerate the folders */ /* enumerate the folders */
if (dwFlags & SHCONTF_FOLDERS) if (dwFlags & SHCONTF_FOLDERS)
{ {
WCHAR wszDriveName[] = {'A', ':', '\\', '\0'}; WCHAR wszDriveName[] = L"A:\\";
DWORD dwDrivemap = get_drive_map(); DWORD dwDrivemap = get_drive_map();
HKEY hkey; HKEY hkey;
UINT i; UINT i;
...@@ -312,7 +299,8 @@ static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags) ...@@ -312,7 +299,8 @@ static BOOL CreateMyCompEnumList(IEnumIDListImpl *list, DWORD dwFlags)
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list); TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
for (i=0; i<2; i++) { for (i=0; i<2; i++) {
if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
MyComputer_NameSpaceW, 0, KEY_READ, &hkey)) L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\Namespace",
0, KEY_READ, &hkey))
{ {
WCHAR iid[50]; WCHAR iid[50];
int i=0; int i=0;
...@@ -613,13 +601,6 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, ...@@ -613,13 +601,6 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
{ {
if ((GET_SHGDN_FOR (dwFlags) & (SHGDN_FORPARSING | SHGDN_FORADDRESSBAR)) == SHGDN_FORPARSING) if ((GET_SHGDN_FOR (dwFlags) & (SHGDN_FORPARSING | SHGDN_FORADDRESSBAR)) == SHGDN_FORPARSING)
{ {
static const WCHAR clsidW[] =
{ 'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] =
{ '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
static const WCHAR wantsForParsingW[] =
{ 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
'g',0 };
BOOL bWantsForParsing = FALSE; BOOL bWantsForParsing = FALSE;
WCHAR szRegPath[100]; WCHAR szRegPath[100];
LONG r; LONG r;
...@@ -635,11 +616,10 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, ...@@ -635,11 +616,10 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
* Get the "WantsFORPARSING" flag from the registry * Get the "WantsFORPARSING" flag from the registry
*/ */
lstrcpyW (szRegPath, clsidW); lstrcpyW (szRegPath, L"CLSID\\");
SHELL32_GUIDToStringW (clsid, &szRegPath[6]); SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
lstrcatW (szRegPath, shellfolderW); lstrcatW (szRegPath, L"\\shellfolder");
r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, L"WantsForParsing", NULL, NULL, NULL);
wantsForParsingW, NULL, NULL, NULL);
if (r == ERROR_SUCCESS) if (r == ERROR_SUCCESS)
bWantsForParsing = TRUE; bWantsForParsing = TRUE;
...@@ -690,15 +670,13 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, ...@@ -690,15 +670,13 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
/* long view "lw_name (C:)" */ /* long view "lw_name (C:)" */
if (!(dwFlags & SHGDN_FORPARSING)) if (!(dwFlags & SHGDN_FORPARSING))
{ {
static const WCHAR wszOpenBracket[] = {' ','(',0};
static const WCHAR wszCloseBracket[] = {')',0};
WCHAR wszDrive[32 /* label */ + 6 /* ' (C:)'\0 */] = {0}; WCHAR wszDrive[32 /* label */ + 6 /* ' (C:)'\0 */] = {0};
GetVolumeInformationW (pszPath, wszDrive, ARRAY_SIZE(wszDrive) - 5, NULL, NULL, GetVolumeInformationW (pszPath, wszDrive, ARRAY_SIZE(wszDrive) - 5, NULL, NULL,
NULL, NULL, 0); NULL, NULL, 0);
lstrcatW (wszDrive, wszOpenBracket); lstrcatW (wszDrive, L" (");
lstrcpynW (wszDrive + lstrlenW(wszDrive), pszPath, 3); lstrcpynW (wszDrive + lstrlenW(wszDrive), pszPath, 3);
lstrcatW (wszDrive, wszCloseBracket); lstrcatW (wszDrive, L")");
lstrcpyW (pszPath, wszDrive); lstrcpyW (pszPath, wszDrive);
} }
} }
......
...@@ -177,13 +177,11 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac ...@@ -177,13 +177,11 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac
HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
static const WCHAR wszEntireNetwork[] = {'E','n','t','i','r','e','N','e','t','w','o','r','k'}; /* not nul-terminated */
IGenericSFImpl *This = impl_from_IShellFolder2(iface); IGenericSFImpl *This = impl_from_IShellFolder2(iface);
HRESULT hr = E_INVALIDARG; HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL; LPITEMIDLIST pidlTemp = NULL;
int len;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This, TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName),
...@@ -192,8 +190,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac ...@@ -192,8 +190,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac
*ppidl = NULL; *ppidl = NULL;
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
len = lstrlenW(szElement); if (!wcsicmp(szElement, L"EntireNetwork"))
if (len == ARRAY_SIZE(wszEntireNetwork) && !wcsnicmp(szElement, wszEntireNetwork, ARRAY_SIZE(wszEntireNetwork)))
{ {
pidlTemp = _ILCreateEntireNetwork(); pidlTemp = _ILCreateEntireNetwork();
if (pidlTemp) if (pidlTemp)
......
...@@ -56,9 +56,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); ...@@ -56,9 +56,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define DE_SAMEFILE 0x71 #define DE_SAMEFILE 0x71
#define DE_DESTSAMETREE 0x7D #define DE_DESTSAMETREE 0x7D
static const WCHAR wWildcardFile[] = {'*',0};
static const WCHAR wWildcardChars[] = {'*','?',0};
static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec);
static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec);
static DWORD SHNotifyRemoveDirectoryA(LPCSTR path); static DWORD SHNotifyRemoveDirectoryA(LPCSTR path);
...@@ -79,8 +76,6 @@ typedef struct ...@@ -79,8 +76,6 @@ typedef struct
/* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations /* 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 struct confirm_msg_info
{ {
LPWSTR lpszText; LPWSTR lpszText;
...@@ -128,7 +123,7 @@ static INT_PTR ConfirmMsgBox_Paint(HWND hDlg) ...@@ -128,7 +123,7 @@ static INT_PTR ConfirmMsgBox_Paint(HWND hDlg)
/* this will remap the rect to dialog coords */ /* this will remap the rect to dialog coords */
MapWindowPoints(GetDlgItem(hDlg, IDD_MESSAGE), hDlg, (LPPOINT)&r, 2); MapWindowPoints(GetDlgItem(hDlg, IDD_MESSAGE), hDlg, (LPPOINT)&r, 2);
hOldFont = SelectObject(hdc, (HFONT)SendDlgItemMessageW(hDlg, IDD_MESSAGE, WM_GETFONT, 0, 0)); hOldFont = SelectObject(hdc, (HFONT)SendDlgItemMessageW(hDlg, IDD_MESSAGE, WM_GETFONT, 0, 0));
DrawTextW(hdc, GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); DrawTextW(hdc, GetPropW(hDlg, L"WINE_CONFIRM"), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK);
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
EndPaint(hDlg, &ps); EndPaint(hDlg, &ps);
return TRUE; return TRUE;
...@@ -145,7 +140,7 @@ static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam) ...@@ -145,7 +140,7 @@ static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam)
SetWindowTextW(hDlg, info->lpszCaption); SetWindowTextW(hDlg, info->lpszCaption);
ShowWindow(GetDlgItem(hDlg, IDD_MESSAGE), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDD_MESSAGE), SW_HIDE);
SetPropW(hDlg, CONFIRM_MSG_PROP, info->lpszText); SetPropW(hDlg, L"WINE_CONFIRM", info->lpszText);
SendDlgItemMessageW(hDlg, IDD_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); SendDlgItemMessageW(hDlg, IDD_ICON, STM_SETICON, (WPARAM)info->hIcon, 0);
/* compute the text height and resize the dialog */ /* compute the text height and resize the dialog */
...@@ -194,14 +189,13 @@ static INT_PTR CALLBACK ConfirmMsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, L ...@@ -194,14 +189,13 @@ static INT_PTR CALLBACK ConfirmMsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
static int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll) static int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll)
{ {
static const WCHAR wszTemplate[] = {'S','H','E','L','L','_','Y','E','S','T','O','A','L','L','_','M','S','G','B','O','X',0};
struct confirm_msg_info info; struct confirm_msg_info info;
info.lpszText = lpszText; info.lpszText = lpszText;
info.lpszCaption = lpszCaption; info.lpszCaption = lpszCaption;
info.hIcon = hIcon; info.hIcon = hIcon;
info.bYesToAll = bYesToAll; info.bYesToAll = bYesToAll;
return DialogBoxParamW(shell32_hInstance, wszTemplate, hWnd, ConfirmMsgBoxProc, (LPARAM)&info); return DialogBoxParamW(shell32_hInstance, L"SHELL_YESTOALL_MSGBOX", hWnd, ConfirmMsgBoxProc, (LPARAM)&info);
} }
/* confirmation dialogs content */ /* confirmation dialogs content */
...@@ -351,7 +345,7 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) ...@@ -351,7 +345,7 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
WIN32_FIND_DATAW wfd; WIN32_FIND_DATAW wfd;
WCHAR szTemp[MAX_PATH]; WCHAR szTemp[MAX_PATH];
PathCombineW(szTemp, pszDir, wWildcardFile); PathCombineW(szTemp, pszDir, L"*");
hFind = FindFirstFileW(szTemp, &wfd); hFind = FindFirstFileW(szTemp, &wfd);
if (hFind != INVALID_HANDLE_VALUE) { if (hFind != INVALID_HANDLE_VALUE) {
...@@ -793,7 +787,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s ...@@ -793,7 +787,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s
static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly) static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly)
{ {
WIN32_FIND_DATAW wfd; 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; DWORD dwAttr = INVALID_FILE_ATTRIBUTES;
HANDLE hFind = FindFirstFileW(pName, &wfd); HANDLE hFind = FindFirstFileW(pName, &wfd);
...@@ -1049,7 +1043,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) ...@@ -1049,7 +1043,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
for (p = szCurFile; *p; p++) if (*p == '/') *p = '\\'; for (p = szCurFile; *p; p++) if (*p == '/') *p = '\\';
/* parse wildcard files if they are in the filename */ /* parse wildcard files if they are in the filename */
if (StrPBrkW(szCurFile, wWildcardChars)) if (StrPBrkW(szCurFile, L"*?"))
{ {
parse_wildcard_files(flList, szCurFile, &i); parse_wildcard_files(flList, szCurFile, &i);
flList->bAnyFromWildcard = TRUE; flList->bAnyFromWildcard = TRUE;
...@@ -1097,8 +1091,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST ...@@ -1097,8 +1091,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
SHFILEOPSTRUCTW fileOp; SHFILEOPSTRUCTW fileOp;
static const WCHAR wildCardFiles[] = {'*','.','*',0};
if (IsDotDir(feFrom->szFilename)) if (IsDotDir(feFrom->szFilename))
return; return;
...@@ -1120,7 +1112,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST ...@@ -1120,7 +1112,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
szTo[lstrlenW(szTo) + 1] = '\0'; szTo[lstrlenW(szTo) + 1] = '\0';
SHNotifyCreateDirectoryW(szTo, NULL); SHNotifyCreateDirectoryW(szTo, NULL);
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); PathCombineW(szFrom, feFrom->szFullPath, L"*.*");
szFrom[lstrlenW(szFrom) + 1] = '\0'; szFrom[lstrlenW(szFrom) + 1] = '\0';
fileOp = *op->req; fileOp = *op->req;
...@@ -1313,10 +1305,9 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE ...@@ -1313,10 +1305,9 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
{ {
if (flFrom->dwNumFiles > 1) if (flFrom->dwNumFiles > 1)
{ {
static const WCHAR format[] = {'%','d',0}; WCHAR tmp[12];
WCHAR tmp[8];
wnsprintfW(tmp, ARRAY_SIZE(tmp), format, flFrom->dwNumFiles); swprintf(tmp, ARRAY_SIZE(tmp), L"%d", flFrom->dwNumFiles);
return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL); return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL);
} }
else else
......
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
WINE_DEFAULT_DEBUG_CHANNEL (shell); WINE_DEFAULT_DEBUG_CHANNEL (shell);
static const WCHAR wszDotShellClassInfo[] = {
'.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
/*************************************************************************** /***************************************************************************
* SHELL32_GetCustomFolderAttribute (internal function) * SHELL32_GetCustomFolderAttribute (internal function)
* *
...@@ -72,14 +69,9 @@ static inline BOOL SHELL32_GetCustomFolderAttributeFromPath( ...@@ -72,14 +69,9 @@ static inline BOOL SHELL32_GetCustomFolderAttributeFromPath(
LPWSTR pwszFolderPath, LPCWSTR pwszHeading, LPCWSTR pwszAttribute, LPWSTR pwszFolderPath, LPCWSTR pwszHeading, LPCWSTR pwszAttribute,
LPWSTR pwszValue, DWORD cchValue) LPWSTR pwszValue, DWORD cchValue)
{ {
static const WCHAR wszDesktopIni[] =
{'d','e','s','k','t','o','p','.','i','n','i',0};
static const WCHAR wszDefault[] = {0};
PathAddBackslashW(pwszFolderPath); PathAddBackslashW(pwszFolderPath);
PathAppendW(pwszFolderPath, wszDesktopIni); PathAppendW(pwszFolderPath, L"desktop.ini");
return GetPrivateProfileStringW(pwszHeading, pwszAttribute, wszDefault, return GetPrivateProfileStringW(pwszHeading, pwszAttribute, L"", pwszValue, cchValue, pwszFolderPath);
pwszValue, cchValue, pwszFolderPath);
} }
BOOL SHELL32_GetCustomFolderAttribute( BOOL SHELL32_GetCustomFolderAttribute(
...@@ -283,7 +275,6 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild, ...@@ -283,7 +275,6 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild,
} else { } else {
/* file system folder */ /* file system folder */
CLSID clsidFolder = *clsidChild; CLSID clsidFolder = *clsidChild;
static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath; WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath;
/* see if folder CLSID should be overridden by desktop.ini file */ /* see if folder CLSID should be overridden by desktop.ini file */
...@@ -295,7 +286,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild, ...@@ -295,7 +286,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild,
_ILSimpleGetTextW(pidlChild,pwszPathTail,MAX_PATH - (int)(pwszPathTail - wszFolderPath)); _ILSimpleGetTextW(pidlChild,pwszPathTail,MAX_PATH - (int)(pwszPathTail - wszFolderPath));
if (SHELL32_GetCustomFolderAttributeFromPath (wszFolderPath, if (SHELL32_GetCustomFolderAttributeFromPath (wszFolderPath,
wszDotShellClassInfo, wszCLSID, wszCLSIDValue, CHARS_IN_GUID)) L".ShellClassInfo", L"CLSID", wszCLSIDValue, CHARS_IN_GUID))
CLSIDFromString (wszCLSIDValue, &clsidFolder); CLSIDFromString (wszCLSIDValue, &clsidFolder);
hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild, hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild,
...@@ -635,8 +626,6 @@ HRESULT WINAPI SHOpenFolderAndSelectItems( PCIDLIST_ABSOLUTE pidlFolder, UINT ci ...@@ -635,8 +626,6 @@ HRESULT WINAPI SHOpenFolderAndSelectItems( PCIDLIST_ABSOLUTE pidlFolder, UINT ci
*/ */
HRESULT WINAPI SHGetSetFolderCustomSettings( LPSHFOLDERCUSTOMSETTINGS fcs, PCWSTR path, DWORD flag ) HRESULT WINAPI SHGetSetFolderCustomSettings( LPSHFOLDERCUSTOMSETTINGS fcs, PCWSTR path, DWORD flag )
{ {
static const WCHAR iconresourceW[] = {'I','c','o','n','R','e','s','o','u','r','c','e',0};
static const WCHAR desktop_iniW[] = {'D','e','s','k','t','o','p','.','i','n','i',0};
WCHAR bufferW[MAX_PATH]; WCHAR bufferW[MAX_PATH];
HRESULT hr; HRESULT hr;
...@@ -652,9 +641,9 @@ HRESULT WINAPI SHGetSetFolderCustomSettings( LPSHFOLDERCUSTOMSETTINGS fcs, PCWST ...@@ -652,9 +641,9 @@ HRESULT WINAPI SHGetSetFolderCustomSettings( LPSHFOLDERCUSTOMSETTINGS fcs, PCWST
{ {
lstrcpyW(bufferW, path); lstrcpyW(bufferW, path);
PathAddBackslashW(bufferW); PathAddBackslashW(bufferW);
lstrcatW(bufferW, desktop_iniW); lstrcatW(bufferW, L"desktop.ini");
if (WritePrivateProfileStringW(wszDotShellClassInfo, iconresourceW, fcs->pszIconFile, bufferW)) if (WritePrivateProfileStringW(L".ShellClassInfo", L"IconResource", fcs->pszIconFile, bufferW))
{ {
TRACE("Wrote an iconresource entry %s into %s\n", debugstr_w(fcs->pszIconFile), debugstr_w(bufferW)); TRACE("Wrote an iconresource entry %s into %s\n", debugstr_w(fcs->pszIconFile), debugstr_w(bufferW));
hr = S_OK; hr = S_OK;
......
...@@ -151,8 +151,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data ...@@ -151,8 +151,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data
ret = CreateBindCtx(0, ppV); ret = CreateBindCtx(0, ppV);
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
{ {
static const WCHAR nameW[] = {
'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d',' ','D','a','t','a',0};
BIND_OPTS bindOpts; BIND_OPTS bindOpts;
bindOpts.cbStruct = sizeof(BIND_OPTS); bindOpts.cbStruct = sizeof(BIND_OPTS);
...@@ -160,7 +158,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data ...@@ -160,7 +158,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data
bindOpts.grfMode = STGM_CREATE; bindOpts.grfMode = STGM_CREATE;
bindOpts.dwTickCountDeadline = 0; bindOpts.dwTickCountDeadline = 0;
IBindCtx_SetBindOptions(*ppV, &bindOpts); IBindCtx_SetBindOptions(*ppV, &bindOpts);
IBindCtx_RegisterObjectParam(*ppV, (WCHAR*)nameW, (IUnknown*)&This->IFileSystemBindData_iface); IBindCtx_RegisterObjectParam(*ppV, (WCHAR*)L"File System Bind Data", (IUnknown*)&This->IFileSystemBindData_iface);
IFileSystemBindData_Release(&This->IFileSystemBindData_iface); IFileSystemBindData_Release(&This->IFileSystemBindData_iface);
} }
......
...@@ -236,8 +236,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl) ...@@ -236,8 +236,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
if ( GetMenuItemCount (hmenu) == 0 ) if ( GetMenuItemCount (hmenu) == 0 )
{ {
static const WCHAR szEmpty[] = { '(','e','m','p','t','y',')',0 }; FileMenu_AppendItemW (hmenu, L"(empty)", uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT);
FileMenu_AppendItemW (hmenu, szEmpty, uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT);
NumberOfItems++; NumberOfItems++;
} }
......
...@@ -66,8 +66,6 @@ ...@@ -66,8 +66,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(shell); WINE_DEFAULT_DEBUG_CHANNEL(shell);
static const WCHAR SV_CLASS_NAME[] = {'S','H','E','L','L','D','L','L','_','D','e','f','V','i','e','w',0};
typedef struct typedef struct
{ BOOL bIsAscending; { BOOL bIsAscending;
INT nHeaderID; INT nHeaderID;
...@@ -670,7 +668,6 @@ static HRESULT ShellView_FillList(IShellViewImpl *This) ...@@ -670,7 +668,6 @@ static HRESULT ShellView_FillList(IShellViewImpl *This)
static LRESULT ShellView_OnCreate(IShellViewImpl *This) static LRESULT ShellView_OnCreate(IShellViewImpl *This)
{ {
IShellView3 *iface = &This->IShellView3_iface; IShellView3 *iface = &This->IShellView3_iface;
static const WCHAR accel_nameW[] = {'s','h','v','_','a','c','c','e','l',0};
IPersistFolder2 *ppf2; IPersistFolder2 *ppf2;
IDropTarget* pdt; IDropTarget* pdt;
HRESULT hr; HRESULT hr;
...@@ -723,7 +720,7 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This) ...@@ -723,7 +720,7 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This)
IPersistFolder2_Release(ppf2); IPersistFolder2_Release(ppf2);
} }
This->hAccel = LoadAcceleratorsW(shell32_hInstance, accel_nameW); This->hAccel = LoadAcceleratorsW(shell32_hInstance, L"shv_accel");
return S_OK; return S_OK;
} }
...@@ -780,7 +777,6 @@ static void ShellView_MergeFileMenu(IShellViewImpl *This, HMENU hSubMenu) ...@@ -780,7 +777,6 @@ static void ShellView_MergeFileMenu(IShellViewImpl *This, HMENU hSubMenu)
{ {
if (hSubMenu) if (hSubMenu)
{ {
static const WCHAR dummyW[] = {'d','u','m','m','y','4','5',0};
MENUITEMINFOW mii; MENUITEMINFOW mii;
/* insert This item at the beginning of the menu */ /* insert This item at the beginning of the menu */
...@@ -793,7 +789,7 @@ static void ShellView_MergeFileMenu(IShellViewImpl *This, HMENU hSubMenu) ...@@ -793,7 +789,7 @@ static void ShellView_MergeFileMenu(IShellViewImpl *This, HMENU hSubMenu)
mii.cbSize = sizeof(mii); mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.dwTypeData = (LPWSTR)dummyW; mii.dwTypeData = (LPWSTR)L"dummy45";
mii.fState = MFS_ENABLED; mii.fState = MFS_ENABLED;
mii.wID = IDM_MYFILEITEM; mii.wID = IDM_MYFILEITEM;
mii.fType = MFT_STRING; mii.fType = MFT_STRING;
...@@ -812,8 +808,6 @@ static void ShellView_MergeViewMenu(IShellViewImpl *This, HMENU hSubMenu) ...@@ -812,8 +808,6 @@ static void ShellView_MergeViewMenu(IShellViewImpl *This, HMENU hSubMenu)
/* add a separator at the correct position in the menu */ /* add a separator at the correct position in the menu */
if (hSubMenu) if (hSubMenu)
{ {
static const WCHAR menuW[] = {'M','E','N','U','_','0','0','1',0};
static const WCHAR viewW[] = {'V','i','e','w',0};
MENUITEMINFOW mii; MENUITEMINFOW mii;
memset(&mii, 0, sizeof(mii)); memset(&mii, 0, sizeof(mii));
...@@ -826,8 +820,8 @@ static void ShellView_MergeViewMenu(IShellViewImpl *This, HMENU hSubMenu) ...@@ -826,8 +820,8 @@ static void ShellView_MergeViewMenu(IShellViewImpl *This, HMENU hSubMenu)
mii.cbSize = sizeof(mii); mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA; mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;
mii.fType = MFT_STRING; mii.fType = MFT_STRING;
mii.dwTypeData = (LPWSTR)viewW; mii.dwTypeData = (LPWSTR)L"View";
mii.hSubMenu = LoadMenuW(shell32_hInstance, menuW); mii.hSubMenu = LoadMenuW(shell32_hInstance, L"MENU_001");
InsertMenuItemW(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii); InsertMenuItemW(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii);
} }
} }
...@@ -1140,8 +1134,6 @@ static LRESULT ShellView_OnActivate(IShellViewImpl *This, UINT uState) ...@@ -1140,8 +1134,6 @@ static LRESULT ShellView_OnActivate(IShellViewImpl *This, UINT uState)
if (This->hMenu) if (This->hMenu)
{ {
static const WCHAR dummyW[] = {'d','u','m','m','y',' ','3','1',0};
IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw); IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw);
TRACE("-- after fnInsertMenusSB\n"); TRACE("-- after fnInsertMenusSB\n");
...@@ -1155,7 +1147,7 @@ static LRESULT ShellView_OnActivate(IShellViewImpl *This, UINT uState) ...@@ -1155,7 +1147,7 @@ static LRESULT ShellView_OnActivate(IShellViewImpl *This, UINT uState)
mii.hbmpUnchecked = NULL; mii.hbmpUnchecked = NULL;
mii.dwItemData = 0; mii.dwItemData = 0;
/* build the top level menu get the menu item's text */ /* build the top level menu get the menu item's text */
mii.dwTypeData = (LPWSTR)dummyW; mii.dwTypeData = (LPWSTR)L"dummy 31";
mii.cch = 0; mii.cch = 0;
mii.hbmpItem = NULL; mii.hbmpItem = NULL;
...@@ -2111,7 +2103,7 @@ static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShell ...@@ -2111,7 +2103,7 @@ static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShell
TRACE("-- CommDlgBrowser %p\n", This->pCommDlgBrowser); TRACE("-- CommDlgBrowser %p\n", This->pCommDlgBrowser);
/* If our window class has not been registered, then do so */ /* If our window class has not been registered, then do so */
if (!GetClassInfoW(shell32_hInstance, SV_CLASS_NAME, &wc)) if (!GetClassInfoW(shell32_hInstance, L"SHELLDLL_DefView", &wc))
{ {
wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = ShellView_WndProc; wc.lpfnWndProc = ShellView_WndProc;
...@@ -2122,12 +2114,12 @@ static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShell ...@@ -2122,12 +2114,12 @@ static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShell
wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = SV_CLASS_NAME; wc.lpszClassName = L"SHELLDLL_DefView";
if (!RegisterClassW(&wc)) return E_FAIL; if (!RegisterClassW(&wc)) return E_FAIL;
} }
wnd = CreateWindowExW(0, SV_CLASS_NAME, NULL, WS_CHILD | WS_TABSTOP, wnd = CreateWindowExW(0, L"SHELLDLL_DefView", NULL, WS_CHILD | WS_TABSTOP,
rect->left, rect->top, rect->left, rect->top,
rect->right - rect->left, rect->right - rect->left,
rect->bottom - rect->top, rect->bottom - rect->top,
......
...@@ -360,15 +360,6 @@ static BOOL format_date(FILETIME *time, WCHAR *buffer, DWORD size) ...@@ -360,15 +360,6 @@ static BOOL format_date(FILETIME *time, WCHAR *buffer, DWORD size)
static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size) static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
{ {
static const WCHAR translationW[] = {
'\\','V','a','r','F','i','l','e','I','n','f','o',
'\\','T','r','a','n','s','l','a','t','i','o','n',0
};
static const WCHAR fileDescFmtW[] = {
'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
'\\','%','0','4','x','%','0','4','x',
'\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0
};
WCHAR fileDescW[41], *desc; WCHAR fileDescW[41], *desc;
DWORD versize, *lang; DWORD versize, *lang;
UINT dlen, llen, i; UINT dlen, llen, i;
...@@ -384,12 +375,13 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size) ...@@ -384,12 +375,13 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
if (!GetFileVersionInfoW(path, 0, versize, data)) if (!GetFileVersionInfoW(path, 0, versize, data))
goto out; goto out;
if (!VerQueryValueW(data, translationW, (LPVOID *)&lang, &llen)) if (!VerQueryValueW(data, L"\\VarFileInfo\\Translation", (LPVOID *)&lang, &llen))
goto out; goto out;
for (i = 0; i < llen / sizeof(DWORD); i++) for (i = 0; i < llen / sizeof(DWORD); i++)
{ {
swprintf(fileDescW, ARRAY_SIZE(fileDescW), fileDescFmtW, LOWORD(lang[i]), HIWORD(lang[i])); swprintf(fileDescW, ARRAY_SIZE(fileDescW), L"\\StringFileInfo\\%04x%04x\\FileDescription",
LOWORD(lang[i]), HIWORD(lang[i]));
if (VerQueryValueW(data, fileDescW, (LPVOID *)&desc, &dlen)) if (VerQueryValueW(data, fileDescW, (LPVOID *)&desc, &dlen))
{ {
if (dlen > size - 1) dlen = size - 1; if (dlen > size - 1) dlen = size - 1;
...@@ -448,9 +440,7 @@ static void init_file_properties_dlg(HWND hwndDlg, struct file_properties_info * ...@@ -448,9 +440,7 @@ static void init_file_properties_dlg(HWND hwndDlg, struct file_properties_info *
if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{ {
static const WCHAR unknownW[] = {'(','u','n','k','n','o','w','n',')',0}; SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, L"(unknown)");
SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, unknownW);
/* TODO: Implement counting for directories */ /* TODO: Implement counting for directories */
return; return;
} }
...@@ -541,9 +531,8 @@ static INT_PTR CALLBACK file_properties_proc(HWND hwndDlg, UINT uMsg, WPARAM wPa ...@@ -541,9 +531,8 @@ static INT_PTR CALLBACK file_properties_proc(HWND hwndDlg, UINT uMsg, WPARAM wPa
wcscmp(props->filename, newname) && wcscmp(props->filename, newname) &&
lstrlenW(props->dir) + lstrlenW(newname) + 2 < ARRAY_SIZE(newpath)) lstrlenW(props->dir) + lstrlenW(newname) + 2 < ARRAY_SIZE(newpath))
{ {
static const WCHAR slash[] = {'\\', 0};
lstrcpyW(newpath, props->dir); lstrcpyW(newpath, props->dir);
lstrcatW(newpath, slash); lstrcatW(newpath, L"\\");
lstrcatW(newpath, newname); lstrcatW(newpath, newname);
if (!MoveFileW(props->path, newpath)) if (!MoveFileW(props->path, newpath))
...@@ -653,8 +642,6 @@ error: ...@@ -653,8 +642,6 @@ error:
static void DoOpenProperties(ContextMenu *This, HWND hwnd) static void DoOpenProperties(ContextMenu *This, HWND hwnd)
{ {
static const WCHAR wszFolder[] = {'F','o','l','d','e','r', 0};
static const WCHAR wszFiletypeAll[] = {'*',0};
LPSHELLFOLDER lpDesktopSF; LPSHELLFOLDER lpDesktopSF;
LPSHELLFOLDER lpSF; LPSHELLFOLDER lpSF;
LPDATAOBJECT lpDo; LPDATAOBJECT lpDo;
...@@ -695,14 +682,13 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd) ...@@ -695,14 +682,13 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
} }
else if (_ILIsFolder(This->apidl[0])) else if (_ILIsFolder(This->apidl[0]))
{ {
lstrcpynW(wszFiletype, wszFolder, 64); lstrcpynW(wszFiletype, L"Folder", 64);
} }
else if (_ILIsSpecialFolder(This->apidl[0])) else if (_ILIsSpecialFolder(This->apidl[0]))
{ {
LPGUID folderGUID; LPGUID folderGUID;
static const WCHAR wszclsid[] = {'C','L','S','I','D','\\', 0};
folderGUID = _ILGetGUIDPointer(This->apidl[0]); folderGUID = _ILGetGUIDPointer(This->apidl[0]);
lstrcpyW(wszFiletype, wszclsid); lstrcpyW(wszFiletype, L"CLSID\\");
StringFromGUID2(folderGUID, &wszFiletype[6], MAX_PATH - 6); StringFromGUID2(folderGUID, &wszFiletype[6], MAX_PATH - 6);
} }
else else
...@@ -738,7 +724,7 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd) ...@@ -738,7 +724,7 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
SHDestroyPropSheetExtArray(hpsxa); SHDestroyPropSheetExtArray(hpsxa);
} }
hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletypeAll, MAX_PROP_PAGES - psh.nPages, lpDo); hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"*", MAX_PROP_PAGES - psh.nPages, lpDo);
if (hpsxa != NULL) if (hpsxa != NULL)
{ {
SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh); SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
...@@ -845,14 +831,6 @@ static HRESULT WINAPI ItemMenu_InvokeCommand( ...@@ -845,14 +831,6 @@ static HRESULT WINAPI ItemMenu_InvokeCommand(
static HRESULT WINAPI ItemMenu_GetCommandString(IContextMenu3 *iface, UINT_PTR cmdid, UINT flags, static HRESULT WINAPI ItemMenu_GetCommandString(IContextMenu3 *iface, UINT_PTR cmdid, UINT flags,
UINT *reserved, LPSTR name, UINT maxlen) UINT *reserved, LPSTR name, UINT maxlen)
{ {
static const WCHAR openW[] = {'o','p','e','n',0};
static const WCHAR exploreW[] = {'e','x','p','l','o','r','e',0};
static const WCHAR cutW[] = {'c','u','t',0};
static const WCHAR copyW[] = {'c','o','p','y',0};
static const WCHAR linkW[] = {'l','i','n','k',0};
static const WCHAR deleteW[] = {'d','e','l','e','t','e',0};
static const WCHAR propertiesW[] = {'p','r','o','p','e','r','t','i','e','s',0};
static const WCHAR renameW[] = {'r','e','n','a','m','e',0};
ContextMenu *This = impl_from_IContextMenu3(iface); ContextMenu *This = impl_from_IContextMenu3(iface);
const WCHAR *cmdW = NULL; const WCHAR *cmdW = NULL;
HRESULT hr = S_OK; HRESULT hr = S_OK;
...@@ -871,28 +849,28 @@ static HRESULT WINAPI ItemMenu_GetCommandString(IContextMenu3 *iface, UINT_PTR c ...@@ -871,28 +849,28 @@ static HRESULT WINAPI ItemMenu_GetCommandString(IContextMenu3 *iface, UINT_PTR c
switch (cmdid + FCIDM_BASE) switch (cmdid + FCIDM_BASE)
{ {
case FCIDM_SHVIEW_OPEN: case FCIDM_SHVIEW_OPEN:
cmdW = openW; cmdW = L"open";
break; break;
case FCIDM_SHVIEW_EXPLORE: case FCIDM_SHVIEW_EXPLORE:
cmdW = exploreW; cmdW = L"explore";
break; break;
case FCIDM_SHVIEW_CUT: case FCIDM_SHVIEW_CUT:
cmdW = cutW; cmdW = L"cut";
break; break;
case FCIDM_SHVIEW_COPY: case FCIDM_SHVIEW_COPY:
cmdW = copyW; cmdW = L"copy";
break; break;
case FCIDM_SHVIEW_CREATELINK: case FCIDM_SHVIEW_CREATELINK:
cmdW = linkW; cmdW = L"link";
break; break;
case FCIDM_SHVIEW_DELETE: case FCIDM_SHVIEW_DELETE:
cmdW = deleteW; cmdW = L"delete";
break; break;
case FCIDM_SHVIEW_PROPERTIES: case FCIDM_SHVIEW_PROPERTIES:
cmdW = propertiesW; cmdW = L"properties";
break; break;
case FCIDM_SHVIEW_RENAME: case FCIDM_SHVIEW_RENAME:
cmdW = renameW; cmdW = L"rename";
break; break;
} }
...@@ -1385,8 +1363,6 @@ static HRESULT WINAPI BackgroundMenu_GetCommandString( ...@@ -1385,8 +1363,6 @@ static HRESULT WINAPI BackgroundMenu_GetCommandString(
LPSTR lpszName, LPSTR lpszName,
UINT uMaxNameLen) UINT uMaxNameLen)
{ {
static const WCHAR pasteW[] = {'p','a','s','t','e',0};
static const WCHAR propertiesW[] = {'p','r','o','p','e','r','t','i','e','s',0};
ContextMenu *This = impl_from_IContextMenu3(iface); ContextMenu *This = impl_from_IContextMenu3(iface);
const WCHAR *cmdW = NULL; const WCHAR *cmdW = NULL;
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
...@@ -1405,10 +1381,10 @@ static HRESULT WINAPI BackgroundMenu_GetCommandString( ...@@ -1405,10 +1381,10 @@ static HRESULT WINAPI BackgroundMenu_GetCommandString(
switch (idCommand + FCIDM_BASE) switch (idCommand + FCIDM_BASE)
{ {
case FCIDM_SHVIEW_INSERT: case FCIDM_SHVIEW_INSERT:
cmdW = pasteW; cmdW = L"paste";
break; break;
case FCIDM_SHVIEW_PROPERTIES: case FCIDM_SHVIEW_PROPERTIES:
cmdW = propertiesW; cmdW = L"properties";
break; break;
} }
......
...@@ -55,15 +55,6 @@ typedef struct tagPOLICYDAT ...@@ -55,15 +55,6 @@ typedef struct tagPOLICYDAT
DWORD cache; /* cached value or 0xffffffff for invalid */ DWORD cache; /* cached value or 0xffffffff for invalid */
} POLICYDATA, *LPPOLICYDATA; } 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 */ /* application strings */
static const char strExplorer[] = {"Explorer"}; static const char strExplorer[] = {"Explorer"};
...@@ -853,8 +844,7 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy) ...@@ -853,8 +844,7 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy)
return p->cache; return p->cache;
} }
lstrcpyA(regstr, strRegistryPolicyA); lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
lstrcatA(regstr, "\\");
lstrcatA(regstr, p->appstr); lstrcatA(regstr, p->appstr);
/* return 0 and don't set the cache if any registry errors occur */ /* return 0 and don't set the cache if any registry errors occur */
...@@ -898,15 +888,15 @@ BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey) ...@@ -898,15 +888,15 @@ BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey)
{ {
if (SHELL_OsIsUnicode()) if (SHELL_OsIsUnicode())
{ {
if (lstrcmpiW(inpRegKey, strRegistryPolicyW) && if (lstrcmpiW(inpRegKey, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies") &&
lstrcmpiW(inpRegKey, strPolicyW)) lstrcmpiW(inpRegKey, L"Policy"))
/* doesn't match, fail */ /* doesn't match, fail */
return FALSE; return FALSE;
} }
else else
{ {
if (lstrcmpiA(inpRegKey, strRegistryPolicyA) && if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies") &&
lstrcmpiA(inpRegKey, strPolicyA)) lstrcmpiA(inpRegKey, "Policy"))
/* doesn't match, fail */ /* doesn't match, fail */
return FALSE; return FALSE;
} }
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(systray); WINE_DEFAULT_DEBUG_CHANNEL(systray);
static const WCHAR classname[] = /* Shell_TrayWnd */ {'S','h','e','l','l','_','T','r','a','y','W','n','d','\0'};
struct notify_data /* platform-independent format for NOTIFYICONDATA */ struct notify_data /* platform-independent format for NOTIFYICONDATA */
{ {
LONG hWnd; LONG hWnd;
...@@ -149,7 +147,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid) ...@@ -149,7 +147,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
return Shell_NotifyIconW(dwMessage, &newNid); return Shell_NotifyIconW(dwMessage, &newNid);
} }
tray = FindWindowExW(0, NULL, classname, NULL); tray = FindWindowExW(0, NULL, L"Shell_TrayWnd", NULL);
if (!tray) return FALSE; if (!tray) return FALSE;
cds.dwData = dwMessage; cds.dwData = dwMessage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment