diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index 351ee1e4c5c..8200062da7e 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -1429,6 +1429,29 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH return SHNotifyCopyFileW(op, szFrom, szTo, FALSE) == 0; } +#ifdef __REACTOS__ +static BOOL move_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo) +{ + if (PathFileExistsW(szTo)) + { + if (op->req->fFlags & FOF_RENAMEONCOLLISION) + { + CStringW newPath = try_find_new_name(szTo); + if (!newPath.IsEmpty()) + { + return SHNotifyMoveFileW(op, szFrom, newPath, FALSE) == 0; + } + } + else if (!(op->req->fFlags & FOF_NOCONFIRMATION)) + { + if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) + return FALSE; + } + } + + return SHNotifyMoveFileW(op, szFrom, szTo, FALSE) == 0; +} +#endif /* copy a file or directory to another directory */ static void copy_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, const FILE_ENTRY *feTo) { @@ -1815,8 +1838,15 @@ static DWORD move_files(FILE_OPERATION *op, BOOL multiDest, const FILE_LIST *flF if (fileDest->bExists && IsAttribDir(fileDest->attributes)) move_to_dir(op, entryToMove, fileDest); +#ifdef __REACTOS__ + else if (IsAttribDir(entryToMove->attributes)) + move_dir_to_dir(op, entryToMove, fileDest->szFullPath); + else + move_file_to_file(op, entryToMove->szFullPath, fileDest->szFullPath); +#else else SHNotifyMoveFileW(op, entryToMove->szFullPath, fileDest->szFullPath, IsAttribDir(entryToMove->attributes)); +#endif if (op->progress != NULL) op->bCancelled |= op->progress->HasUserCancelled();