diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 8800a554441..7ead3451d50 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -147,8 +147,8 @@ void FreeChangeNotifications(void); #define ASK_CREATE_FOLDER 4 #define ASK_OVERWRITE_FILE 5 -BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI); -BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI); +BOOL SHELL_DeleteDirectoryW(LPCWSTR pwszDir, BOOL bShowUI); +BOOL SHELL_DeleteFileW(LPCWSTR pwszFile, BOOL bShowUI); BOOL SHELL_ConfirmDialog(int nKindOfDialog, LPCSTR szDir); /* 16-bit functions */ diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 19c5bca4d00..1ac8d0ff0da 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -1164,7 +1164,8 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) { IGenericSFImpl *This = impl_from_ISFHelper(iface); UINT i; - char szPath[MAX_PATH]; + WCHAR wszPath[MAX_PATH]; + int iPathLen; BOOL bConfirm = TRUE; TRACE ("(%p)(%u %p)\n", This, cidl, apidl); @@ -1179,18 +1180,22 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) bConfirm = FALSE; } + if (This->sPathTarget) + lstrcpynW(wszPath, This->sPathTarget, MAX_PATH); + else + wszPath[0] = '\0'; + PathAddBackslashW(wszPath); + iPathLen = lstrlenW(wszPath); + for (i = 0; i < cidl; i++) { - if (!WideCharToMultiByte(CP_ACP, 0, This->sPathTarget, -1, szPath, MAX_PATH, NULL, NULL)) - szPath[0] = '\0'; - PathAddBackslashA (szPath); - _ILSimpleGetText (apidl[i], szPath + strlen (szPath), MAX_PATH); + _ILSimpleGetTextW (apidl[i], wszPath+iPathLen, MAX_PATH-iPathLen); if (_ILIsFolder (apidl[i])) { LPITEMIDLIST pidl; - TRACE ("delete %s\n", szPath); - if (!SHELL_DeleteDirectoryA (szPath, bConfirm)) { - TRACE ("delete %s failed, bConfirm=%d\n", szPath, bConfirm); + TRACE ("delete %s\n", debugstr_w(wszPath)); + if (!SHELL_DeleteDirectoryW (wszPath, bConfirm)) { + TRACE ("delete %s failed, bConfirm=%d\n", debugstr_w(wszPath), bConfirm); return E_FAIL; } pidl = ILCombine (This->pidlRoot, apidl[i]); @@ -1199,9 +1204,9 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) } else if (_ILIsValue (apidl[i])) { LPITEMIDLIST pidl; - TRACE ("delete %s\n", szPath); - if (!SHELL_DeleteFileA (szPath, bConfirm)) { - TRACE ("delete %s failed, bConfirm=%d\n", szPath, bConfirm); + TRACE ("delete %s\n", debugstr_w(wszPath)); + if (!SHELL_DeleteFileW (wszPath, bConfirm)) { + TRACE ("delete %s failed, bConfirm=%d\n", debugstr_w(wszPath), bConfirm); return E_FAIL; } pidl = ILCombine (This->pidlRoot, apidl[i]); diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 3e087da37df..64e66e3929c 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -55,7 +55,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); static const WCHAR wWildcardFile[] = {'*',0}; static const WCHAR wWildcardChars[] = {'*','?',0}; -static BOOL SHELL_DeleteDirectoryW(LPCWSTR path, BOOL bShowUI); static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyRemoveDirectoryA(LPCSTR path); @@ -170,7 +169,7 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI) return ret; } -static BOOL SHELL_DeleteDirectoryW(LPCWSTR pszDir, BOOL bShowUI) +BOOL SHELL_DeleteDirectoryW(LPCWSTR pszDir, BOOL bShowUI) { BOOL ret = TRUE; HANDLE hFind;