partial sync of shlfileop to wine 1.1.23

svn path=/trunk/; revision=41304
This commit is contained in:
Christoph von Wittich 2009-06-06 15:17:54 +00:00
parent 524cdfd04f
commit 602e8eec8d

View file

@ -90,7 +90,7 @@ static void confirm_msg_move_button(HWND hDlg, INT iId, INT *xPos, INT yOffset,
/* Note: we paint the text manually and don't use the static control to make /* Note: we paint the text manually and don't use the static control to make
* sure the text has the same height as the one computed in WM_INITDIALOG * sure the text has the same height as the one computed in WM_INITDIALOG
*/ */
static INT_PTR CALLBACK ConfirmMsgBox_Paint(HWND hDlg) static INT_PTR ConfirmMsgBox_Paint(HWND hDlg)
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
HFONT hOldFont; HFONT hOldFont;
@ -104,13 +104,13 @@ static INT_PTR CALLBACK 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, (LPWSTR)GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK); DrawTextW(hdc, GetPropW(hDlg, CONFIRM_MSG_PROP), -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;
} }
static INT_PTR CALLBACK ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam) static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam)
{ {
struct confirm_msg_info *info = (struct confirm_msg_info *)lParam; struct confirm_msg_info *info = (struct confirm_msg_info *)lParam;
INT xPos, yOffset; INT xPos, yOffset;
@ -121,7 +121,7 @@ static INT_PTR CALLBACK 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, (HANDLE)info->lpszText); SetPropW(hDlg, CONFIRM_MSG_PROP, 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 */
@ -233,11 +233,13 @@ static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids)
ids->text_resource_id = IDS_DELETESELECTED_TEXT; ids->text_resource_id = IDS_DELETESELECTED_TEXT;
return TRUE; return TRUE;
case ASK_OVERWRITE_FILE: case ASK_OVERWRITE_FILE:
ids->hIconInstance = NULL;
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE; ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION; ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
ids->text_resource_id = IDS_OVERWRITEFILE_TEXT; ids->text_resource_id = IDS_OVERWRITEFILE_TEXT;
return TRUE; return TRUE;
case ASK_OVERWRITE_FOLDER: case ASK_OVERWRITE_FOLDER:
ids->hIconInstance = NULL;
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE; ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION; ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
ids->text_resource_id = IDS_OVERWRITEFOLDER_TEXT; ids->text_resource_id = IDS_OVERWRITEFOLDER_TEXT;
@ -554,11 +556,11 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
* path [I] path of directory to create * path [I] path of directory to create
* *
* RETURNS * RETURNS
* ERRROR_SUCCESS or one of the following values: * ERROR_SUCCESS or one of the following values:
* ERROR_BAD_PATHNAME if the path is relative * ERROR_BAD_PATHNAME if the path is relative
* ERROR_FILE_EXISTS when a file with that name exists * ERROR_FILE_EXISTS when a file with that name exists
* ERROR_PATH_NOT_FOUND can't find the path, probably invalid * ERROR_PATH_NOT_FOUND can't find the path, probably invalid
* ERROR_INVLID_NAME if the path contains invalid chars * ERROR_INVALID_NAME if the path contains invalid chars
* ERROR_ALREADY_EXISTS when the directory already exists * ERROR_ALREADY_EXISTS when the directory already exists
* ERROR_FILENAME_EXCED_RANGE if the filename was to long to process * ERROR_FILENAME_EXCED_RANGE if the filename was to long to process
* *
@ -585,9 +587,9 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path)
* sec [I] security attributes to use or NULL * sec [I] security attributes to use or NULL
* *
* RETURNS * RETURNS
* ERRROR_SUCCESS or one of the following values: * ERROR_SUCCESS or one of the following values:
* ERROR_BAD_PATHNAME or ERROR_PATH_NOT_FOUND if the path is relative * ERROR_BAD_PATHNAME or ERROR_PATH_NOT_FOUND if the path is relative
* ERROR_INVLID_NAME if the path contains invalid chars * ERROR_INVALID_NAME if the path contains invalid chars
* ERROR_FILE_EXISTS when a file with that name exists * ERROR_FILE_EXISTS when a file with that name exists
* ERROR_ALREADY_EXISTS when the directory already exists * ERROR_ALREADY_EXISTS when the directory already exists
* ERROR_FILENAME_EXCED_RANGE if the filename was to long to process * ERROR_FILENAME_EXCED_RANGE if the filename was to long to process
@ -604,7 +606,7 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path)
* If hWnd is set to NULL, no user interface is displayed and the function * If hWnd is set to NULL, no user interface is displayed and the function
* returns ERROR_CANCELLED. * returns ERROR_CANCELLED.
*/ */
int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, const SECURITY_ATTRIBUTES *sec) int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES sec)
{ {
LPWSTR wPath; LPWSTR wPath;
DWORD retCode; DWORD retCode;
@ -625,7 +627,7 @@ int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, const SECURITY_ATTRIBUTE
* *
* See SHCreateDirectoryExA. * See SHCreateDirectoryExA.
*/ */
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, const SECURITY_ATTRIBUTES *sec) int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
{ {
int ret = ERROR_BAD_PATHNAME; int ret = ERROR_BAD_PATHNAME;
TRACE("(%p, %s, %p)\n", hWnd, debugstr_w(path), sec); TRACE("(%p, %s, %p)\n", hWnd, debugstr_w(path), sec);
@ -636,7 +638,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, const SECURITY_ATTRIBUT
} }
else else
{ {
ret = SHNotifyCreateDirectoryW(path, (LPSECURITY_ATTRIBUTES)sec); ret = SHNotifyCreateDirectoryW(path, sec);
/* Refuse to work on certain error codes before trying to create directories recursively */ /* Refuse to work on certain error codes before trying to create directories recursively */
if (ret != ERROR_SUCCESS && if (ret != ERROR_SUCCESS &&
ret != ERROR_FILE_EXISTS && ret != ERROR_FILE_EXISTS &&
@ -656,7 +658,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, const SECURITY_ATTRIBUT
{ {
*pSlash = 0; /* terminate path at separator */ *pSlash = 0; /* terminate path at separator */
ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? (LPSECURITY_ATTRIBUTES)sec : NULL); ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? sec : NULL);
} }
*pSlash++ = '\\'; /* put the separator back */ *pSlash++ = '\\'; /* put the separator back */
} }
@ -834,13 +836,13 @@ static void __inline grow_list(FILE_LIST *list)
/* adds a file to the FILE_ENTRY struct /* adds a file to the FILE_ENTRY struct
*/ */
static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile) static void add_file_to_entry(FILE_ENTRY *feFile, LPCWSTR szFile)
{ {
DWORD dwLen = wcslen(szFile) + 1; DWORD dwLen = lstrlenW(szFile) + 1;
LPWSTR ptr; LPCWSTR ptr;
feFile->szFullPath = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); feFile->szFullPath = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
wcscpy(feFile->szFullPath, szFile); lstrcpyW(feFile->szFullPath, szFile);
ptr = StrRChrW(szFile, NULL, '\\'); ptr = StrRChrW(szFile, NULL, '\\');
if (ptr) if (ptr)
@ -849,31 +851,32 @@ static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile)
feFile->szDirectory = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); feFile->szDirectory = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
lstrcpynW(feFile->szDirectory, szFile, dwLen); lstrcpynW(feFile->szDirectory, szFile, dwLen);
dwLen = wcslen(feFile->szFullPath) - dwLen + 1; dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1;
feFile->szFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); feFile->szFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
wcscpy(feFile->szFilename, ptr + 1); /* skip over backslash */ lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */
} }
feFile->bFromWildcard = FALSE; feFile->bFromWildcard = FALSE;
} }
static LPWSTR wildcard_to_file(LPWSTR szWildCard, LPWSTR szFileName) static LPWSTR wildcard_to_file(LPCWSTR szWildCard, LPCWSTR szFileName)
{ {
LPWSTR szFullPath, ptr; LPCWSTR ptr;
LPWSTR szFullPath;
DWORD dwDirLen, dwFullLen; DWORD dwDirLen, dwFullLen;
ptr = StrRChrW(szWildCard, NULL, '\\'); ptr = StrRChrW(szWildCard, NULL, '\\');
dwDirLen = ptr - szWildCard + 1; dwDirLen = ptr - szWildCard + 1;
dwFullLen = dwDirLen + wcslen(szFileName) + 1; dwFullLen = dwDirLen + lstrlenW(szFileName) + 1;
szFullPath = HeapAlloc(GetProcessHeap(), 0, dwFullLen * sizeof(WCHAR)); szFullPath = HeapAlloc(GetProcessHeap(), 0, dwFullLen * sizeof(WCHAR));
lstrcpynW(szFullPath, szWildCard, dwDirLen + 1); lstrcpynW(szFullPath, szWildCard, dwDirLen + 1);
wcscat(szFullPath, szFileName); lstrcatW(szFullPath, szFileName);
return szFullPath; return szFullPath;
} }
static void parse_wildcard_files(FILE_LIST *flList, LPWSTR szFile, LPDWORD pdwListIndex) static void parse_wildcard_files(FILE_LIST *flList, LPCWSTR szFile, LPDWORD pdwListIndex)
{ {
WIN32_FIND_DATAW wfd; WIN32_FIND_DATAW wfd;
HANDLE hFile = FindFirstFileW(szFile, &wfd); HANDLE hFile = FindFirstFileW(szFile, &wfd);
@ -904,7 +907,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
{ {
LPCWSTR ptr = szFiles; LPCWSTR ptr = szFiles;
WCHAR szCurFile[MAX_PATH]; WCHAR szCurFile[MAX_PATH];
DWORD i = 0, dwDirLen; DWORD i = 0;
if (!szFiles) if (!szFiles)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
@ -929,13 +932,13 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
/* change relative to absolute path */ /* change relative to absolute path */
if (PathIsRelativeW(ptr)) if (PathIsRelativeW(ptr))
{ {
dwDirLen = GetCurrentDirectoryW(MAX_PATH, szCurFile) + 1; GetCurrentDirectoryW(MAX_PATH, szCurFile);
PathCombineW(szCurFile, szCurFile, ptr); PathCombineW(szCurFile, szCurFile, ptr);
flList->feFiles[i].bFromRelative = TRUE; flList->feFiles[i].bFromRelative = TRUE;
} }
else else
{ {
wcscpy(szCurFile, ptr); lstrcpyW(szCurFile, ptr);
flList->feFiles[i].bFromRelative = FALSE; flList->feFiles[i].bFromRelative = FALSE;
} }
@ -957,7 +960,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
} }
/* advance to the next string */ /* advance to the next string */
ptr += wcslen(ptr) + 1; ptr += lstrlenW(ptr) + 1;
i++; i++;
} }
flList->dwNumFiles = i; flList->dwNumFiles = i;
@ -983,7 +986,7 @@ static void destroy_file_list(FILE_LIST *flList)
HeapFree(GetProcessHeap(), 0, flList->feFiles); HeapFree(GetProcessHeap(), 0, flList->feFiles);
} }
static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR szDestPath) static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
{ {
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
SHFILEOPSTRUCTW fileOp; SHFILEOPSTRUCTW fileOp;
@ -996,7 +999,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR
if (PathFileExistsW(szDestPath)) if (PathFileExistsW(szDestPath))
PathCombineW(szTo, szDestPath, feFrom->szFilename); PathCombineW(szTo, szDestPath, feFrom->szFilename);
else else
wcscpy(szTo, szDestPath); lstrcpyW(szTo, szDestPath);
if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) { if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) {
if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op)) if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op))
@ -1008,13 +1011,13 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR
} }
} }
szTo[wcslen(szTo) + 1] = '\0'; szTo[lstrlenW(szTo) + 1] = '\0';
SHNotifyCreateDirectoryW(szTo, NULL); SHNotifyCreateDirectoryW(szTo, NULL);
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
szFrom[wcslen(szFrom) + 1] = '\0'; szFrom[lstrlenW(szFrom) + 1] = '\0';
memcpy(&fileOp, op->req, sizeof(fileOp)); fileOp = *op->req;
fileOp.pFrom = szFrom; fileOp.pFrom = szFrom;
fileOp.pTo = szTo; fileOp.pTo = szTo;
fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */ fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */
@ -1055,10 +1058,10 @@ static void copy_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, const FILE
copy_dir_to_dir(op, feFrom, feTo->szFullPath); copy_dir_to_dir(op, feFrom, feTo->szFullPath);
} }
static void create_dest_dirs(LPWSTR szDestDir) static void create_dest_dirs(LPCWSTR szDestDir)
{ {
WCHAR dir[MAX_PATH]; WCHAR dir[MAX_PATH];
LPWSTR ptr = StrChrW(szDestDir, '\\'); LPCWSTR ptr = StrChrW(szDestDir, '\\');
/* make sure all directories up to last one are created */ /* make sure all directories up to last one are created */
while (ptr && (ptr = StrChrW(ptr + 1, '\\'))) while (ptr && (ptr = StrChrW(ptr + 1, '\\')))
@ -1075,55 +1078,64 @@ static void create_dest_dirs(LPWSTR szDestDir)
} }
/* the FO_COPY operation */ /* the FO_COPY operation */
static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FILE_LIST *flTo) static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *flTo)
{ {
DWORD i; DWORD i;
const FILE_ENTRY *entryToCopy; const FILE_ENTRY *entryToCopy;
const FILE_ENTRY *fileDest = &flTo->feFiles[0]; const FILE_ENTRY *fileDest = &flTo->feFiles[0];
BOOL bCancelIfAnyDirectories = FALSE;
if (flFrom->bAnyDontExist) if (flFrom->bAnyDontExist)
return ERROR_SHELL_INTERNAL_FILE_NOT_FOUND; return ERROR_SHELL_INTERNAL_FILE_NOT_FOUND;
if (op->req->fFlags & FOF_MULTIDESTFILES && flFrom->bAnyFromWildcard) if (op->req->fFlags & FOF_MULTIDESTFILES)
{
if (flFrom->bAnyFromWildcard)
return ERROR_CANCELLED; return ERROR_CANCELLED;
if (!(op->req->fFlags & FOF_MULTIDESTFILES) && flTo->dwNumFiles != 1) if (flFrom->dwNumFiles != flTo->dwNumFiles)
{
if (flFrom->dwNumFiles != 1 && !IsAttribDir(fileDest->attributes))
return ERROR_CANCELLED; return ERROR_CANCELLED;
if (op->req->fFlags & FOF_MULTIDESTFILES && flFrom->dwNumFiles != 1 && flTo->dwNumFiles = 1;
flFrom->dwNumFiles != flTo->dwNumFiles) }
else if (IsAttribDir(fileDest->attributes))
{
for (i = 1; i < flTo->dwNumFiles; i++)
if (!IsAttribDir(flTo->feFiles[i].attributes) ||
!IsAttribDir(flFrom->feFiles[i].attributes))
{ {
return ERROR_CANCELLED; return ERROR_CANCELLED;
} }
}
}
else if (flFrom->dwNumFiles != 1)
{
if (flTo->dwNumFiles != 1 && !IsAttribDir(fileDest->attributes))
return ERROR_CANCELLED;
if (flFrom->dwNumFiles > 1 && flTo->dwNumFiles == 1 && if (PathFileExistsW(fileDest->szFullPath) &&
!PathFileExistsW(flTo->feFiles[0].szFullPath) &&
IsAttribFile(fileDest->attributes)) IsAttribFile(fileDest->attributes))
{ {
bCancelIfAnyDirectories = TRUE; return ERROR_CANCELLED;
} }
if (flFrom->dwNumFiles > 1 && flTo->dwNumFiles == 1 && fileDest->bFromRelative && if (flTo->dwNumFiles == 1 && fileDest->bFromRelative &&
!PathFileExistsW(fileDest->szFullPath)) !PathFileExistsW(fileDest->szFullPath))
{ {
op->req->fAnyOperationsAborted = TRUE;
return ERROR_CANCELLED; return ERROR_CANCELLED;
} }
if (!(op->req->fFlags & FOF_MULTIDESTFILES) && flFrom->dwNumFiles != 1 &&
PathFileExistsW(fileDest->szFullPath) &&
IsAttribFile(fileDest->attributes))
{
return ERROR_CANCELLED;
} }
for (i = 0; i < flFrom->dwNumFiles; i++) for (i = 0; i < flFrom->dwNumFiles; i++)
{ {
entryToCopy = &flFrom->feFiles[i]; entryToCopy = &flFrom->feFiles[i];
if (op->req->fFlags & FOF_MULTIDESTFILES) if ((op->req->fFlags & FOF_MULTIDESTFILES) &&
flTo->dwNumFiles > 1)
{
fileDest = &flTo->feFiles[i]; fileDest = &flTo->feFiles[i];
}
if (IsAttribDir(entryToCopy->attributes) && if (IsAttribDir(entryToCopy->attributes) &&
!lstrcmpiW(entryToCopy->szFullPath, fileDest->szDirectory)) !lstrcmpiW(entryToCopy->szFullPath, fileDest->szDirectory))
@ -1131,9 +1143,6 @@ static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FIL
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (IsAttribDir(entryToCopy->attributes) && bCancelIfAnyDirectories)
return ERROR_CANCELLED;
create_dest_dirs(fileDest->szDirectory); create_dest_dirs(fileDest->szDirectory);
if (!lstrcmpiW(entryToCopy->szFullPath, fileDest->szFullPath)) if (!lstrcmpiW(entryToCopy->szFullPath, fileDest->szFullPath))
@ -1145,7 +1154,7 @@ static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FIL
} }
if ((flFrom->dwNumFiles > 1 && flTo->dwNumFiles == 1) || if ((flFrom->dwNumFiles > 1 && flTo->dwNumFiles == 1) ||
(flFrom->dwNumFiles == 1 && IsAttribDir(fileDest->attributes))) IsAttribDir(fileDest->attributes))
{ {
copy_to_dir(op, entryToCopy, fileDest); copy_to_dir(op, entryToCopy, fileDest);
} }
@ -1179,7 +1188,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
WCHAR tmp[8]; WCHAR tmp[8];
const WCHAR format[] = {'%','d',0}; const WCHAR format[] = {'%','d',0};
_snwprintf(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles); wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, 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
@ -1257,7 +1266,7 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, LPWSTR szDestPath) static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
{ {
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
SHFILEOPSTRUCTW fileOp; SHFILEOPSTRUCTW fileOp;
@ -1270,12 +1279,12 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
SHNotifyCreateDirectoryW(szDestPath, NULL); SHNotifyCreateDirectoryW(szDestPath, NULL);
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
szFrom[wcslen(szFrom) + 1] = '\0'; szFrom[lstrlenW(szFrom) + 1] = '\0';
wcscpy(szTo, szDestPath); lstrcpyW(szTo, szDestPath);
szTo[wcslen(szDestPath) + 1] = '\0'; szTo[lstrlenW(szDestPath) + 1] = '\0';
memcpy(&fileOp, lpFileOp, sizeof(fileOp)); fileOp = *lpFileOp;
fileOp.pFrom = szFrom; fileOp.pFrom = szFrom;
fileOp.pTo = szTo; fileOp.pTo = szTo;
@ -1579,7 +1588,7 @@ DWORD WINAPI SheChangeDirW(LPWSTR path)
/************************************************************************* /*************************************************************************
* IsNetDrive [SHELL32.66] * IsNetDrive [SHELL32.66]
*/ */
INT WINAPI IsNetDrive(INT drive) BOOL WINAPI IsNetDrive(DWORD drive)
{ {
char root[4]; char root[4];
strcpy(root, "A:\\"); strcpy(root, "A:\\");