Rebase against 661cc2a1dec5e44e074702707272228178f21487.

This commit is contained in:
Elizabeth Figura
2025-04-15 23:07:07 -05:00
parent aa0c8391eb
commit 6912feaf65
4 changed files with 50 additions and 283 deletions

View File

@@ -1,4 +1,4 @@
From 578afa6089ac629fca4aec814cba2b534aabbf28 Mon Sep 17 00:00:00 2001
From 27709a4b0e9aa604d2936f8cf79c8958e9d94763 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 26 Feb 2015 23:21:26 +0100
Subject: [PATCH] shell32: Pass FILE_INFORMATION into SHNotify* functions.
@@ -9,12 +9,12 @@ Preparation of the progressbar work. Based on a patch by Huw Campbell.
1 file changed, 104 insertions(+), 110 deletions(-)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 9d2d4dc3f82..4bd486a7426 100644
index 40cc93eb53d..94e5ab45b37 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -55,16 +55,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define DE_SAMEFILE 0x71
#define DE_DESTSAMETREE 0x7D
@@ -68,16 +68,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define DE_FLDDESTISFILE 0x7E
#define DE_FILEDESTISFLD 0x80
-static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec);
-static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec);
@@ -29,7 +29,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
typedef struct
{
SHFILEOPSTRUCTW *req;
@@ -73,6 +63,42 @@ typedef struct
@@ -86,6 +76,42 @@ typedef struct
BOOL bCancelled;
} FILE_OPERATION;
@@ -72,7 +72,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
/* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations
*/
struct confirm_msg_info
@@ -336,7 +362,7 @@ HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status)
@@ -349,7 +375,7 @@ HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status)
* Asks for confirmation when bShowUI is true and deletes the directory and
* all its subdirectories and files if necessary.
*/
@@ -81,7 +81,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
DWORD ret = 0;
HANDLE hFind;
@@ -346,16 +372,18 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
@@ -359,16 +385,18 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
PathCombineW(szTemp, pszDir, L"*");
hFind = FindFirstFileW(szTemp, &wfd);
@@ -104,7 +104,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
} while (!ret && FindNextFileW(hFind, &wfd));
}
FindClose(hFind);
@@ -486,22 +514,9 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
@@ -499,22 +527,9 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
return (SHNotifyRemoveDirectoryA(path) == ERROR_SUCCESS);
}
@@ -130,7 +130,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
LPWSTR wPath;
DWORD retCode;
@@ -511,7 +526,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
@@ -524,7 +539,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
if (!retCode)
{
@@ -139,7 +139,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
free(wPath);
}
return retCode;
@@ -519,12 +534,14 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
@@ -532,12 +547,14 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
/***********************************************************************/
@@ -155,7 +155,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
ret = DeleteFileW(path);
if (!ret)
{
@@ -547,8 +564,8 @@ static DWORD SHNotifyDeleteFileW(LPCWSTR path)
@@ -560,8 +577,8 @@ static DWORD SHNotifyDeleteFileW(LPCWSTR path)
DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
{
if (SHELL_OsIsUnicode())
@@ -166,7 +166,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
}
/************************************************************************
@@ -557,18 +574,21 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
@@ -570,18 +587,21 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
* Moves a file. Also triggers a change notify if one exists.
*
* PARAMS
@@ -189,7 +189,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
ret = MoveFileExW(src, dest, MOVEFILE_REPLACE_EXISTING);
/* MOVEFILE_REPLACE_EXISTING fails with dirs, so try MoveFile */
@@ -603,6 +623,7 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
@@ -616,6 +636,7 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
* Copies a file. Also triggers a change notify if one exists.
*
* PARAMS
@@ -197,7 +197,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
* src [I] path to source file to move
* dest [I] path to target file to move to
* bFailIfExists [I] if TRUE, the target file will not be overwritten if
@@ -611,13 +632,15 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
@@ -624,13 +645,15 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
* RETURNS
* ERROR_SUCCESS if successful
*/
@@ -214,7 +214,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
/* Destination file may already exist with read only attribute */
attribs = GetFileAttributesW(dest);
if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
@@ -897,30 +920,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
@@ -910,30 +933,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
return retCode;
}
@@ -245,7 +245,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
static inline void grow_list(FILE_LIST *list)
{
FILE_ENTRY *new = _recalloc(list->feFiles, list->num_alloc * 2, sizeof(*new));
@@ -1085,7 +1084,7 @@ static void destroy_file_list(FILE_LIST *flList)
@@ -1099,7 +1098,7 @@ static void destroy_file_list(FILE_LIST *flList)
static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
{
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
@@ -254,7 +254,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
if (IsDotDir(feFrom->szFilename))
return;
@@ -1111,17 +1110,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
@@ -1125,17 +1124,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
PathCombineW(szFrom, feFrom->szFullPath, L"*.*");
szFrom[lstrlenW(szFrom) + 1] = '\0';
@@ -264,8 +264,8 @@ index 9d2d4dc3f82..4bd486a7426 100644
- fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */
+ ZeroMemory(&flFromNew, sizeof(FILE_LIST));
+ ZeroMemory(&flToNew, sizeof(FILE_LIST));
+ parse_file_list(&flFromNew, szFrom);
+ parse_file_list(&flToNew, szTo);
+ parse_file_list(&flFromNew, szFrom, TRUE);
+ parse_file_list(&flToNew, szTo, TRUE);
- /* Don't ask the user about overwriting files when he accepted to overwrite the
- folder. FIXME: this is not exactly what Windows does - e.g. there would be
@@ -280,7 +280,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
}
static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo)
@@ -1132,7 +1130,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH
@@ -1146,7 +1144,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH
return FALSE;
}
@@ -289,7 +289,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
}
/* copy a file or directory to another directory */
@@ -1172,7 +1170,7 @@ static void create_dest_dirs(LPCWSTR szDestDir)
@@ -1186,7 +1184,7 @@ static void create_dest_dirs(LPCWSTR szDestDir)
}
/* the FO_COPY operation */
@@ -298,7 +298,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
DWORD i;
const FILE_ENTRY *entryToCopy;
@@ -1195,7 +1193,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
@@ -1209,7 +1207,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
fileDest = &flTo->feFiles[0];
}
@@ -307,7 +307,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
if (flFrom->bAnyFromWildcard)
return ERROR_CANCELLED;
@@ -1247,8 +1245,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
@@ -1261,8 +1259,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
{
entryToCopy = &flFrom->feFiles[i];
@@ -317,7 +317,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
fileDest = &flTo->feFiles[i];
}
@@ -1319,7 +1316,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
@@ -1333,7 +1330,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
}
/* the FO_DELETE operation */
@@ -326,7 +326,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
const FILE_ENTRY *fileEntry;
DWORD i;
@@ -1330,12 +1327,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
@@ -1344,12 +1341,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
return ERROR_SUCCESS;
/* Windows also checks only the first item */
@@ -343,7 +343,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
return 0;
}
@@ -1344,7 +1341,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
@@ -1358,7 +1355,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
fileEntry = &flFrom->feFiles[i];
if (!IsAttribFile(fileEntry->attributes) &&
@@ -352,7 +352,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
continue;
if (bTrash)
@@ -1354,14 +1351,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
@@ -1368,14 +1365,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
continue;
/* Note: Windows silently deletes the file in such a situation, we show a dialog */
@@ -370,7 +370,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
break;
}
}
@@ -1371,7 +1368,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
@@ -1385,7 +1382,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
ret = DeleteFileW(fileEntry->szFullPath) ?
ERROR_SUCCESS : GetLastError();
else
@@ -379,7 +379,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
if (ret)
return ret;
@@ -1381,12 +1378,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
@@ -1395,12 +1392,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
}
/* move a directory to another directory */
@@ -394,7 +394,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
lstrcpyW(to, feTo->szFullPath);
else
PathCombineW(to, feTo->szFullPath, feFrom->szFilename);
@@ -1397,15 +1394,14 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
@@ -1411,15 +1408,14 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
with wildcard and restart SHFileOperationW */
if (PathFileExistsW(to))
{
@@ -412,7 +412,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
/* Don't ask the user about overwriting files when he accepted to overwrite the
folder. FIXME: this is not exactly what Windows does - e.g. there would be
@@ -1418,22 +1414,22 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
@@ -1432,22 +1428,22 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
}
else
{
@@ -439,7 +439,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
DWORD i;
INT mismatched = 0;
@@ -1447,14 +1443,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
@@ -1461,14 +1457,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
if (!flTo->dwNumFiles)
return ERROR_FILE_NOT_FOUND;
@@ -456,7 +456,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
flFrom->dwNumFiles > flTo->dwNumFiles)
{
return ERROR_CANCELLED;
@@ -1464,7 +1458,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
@@ -1478,7 +1472,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
if (ret && ret != ERROR_ALREADY_EXISTS)
return ret;
@@ -465,7 +465,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
mismatched = flFrom->dwNumFiles - flTo->dwNumFiles;
fileDest = &flTo->feFiles[0];
@@ -1475,7 +1469,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
@@ -1489,7 +1483,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
if (!PathFileExistsW(fileDest->szDirectory))
return ERROR_CANCELLED;
@@ -474,7 +474,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
{
if (i >= flTo->dwNumFiles)
break;
@@ -1491,12 +1485,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
@@ -1505,12 +1499,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
if (fileDest->bExists && IsAttribDir(fileDest->attributes))
{
if (IsAttribDir(entryToMove->attributes))
@@ -490,25 +490,25 @@ index 9d2d4dc3f82..4bd486a7426 100644
}
if (mismatched > 0)
@@ -1511,7 +1505,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
@@ -1525,7 +1519,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
}
/* the FO_RENAME files */
-static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo)
+static int rename_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FILE_LIST *flTo)
/* The FO_RENAME operation of SHFileOperation. */
-static DWORD rename_files(SHFILEOPSTRUCTW *op, const FILE_LIST *from, const FILE_LIST *to)
+static DWORD rename_files(FILE_OPERATION *op, const FILE_LIST *from, const FILE_LIST *to)
{
const FILE_ENTRY *feFrom;
const FILE_ENTRY *feTo;
@@ -1533,7 +1527,7 @@ static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, con
if (feTo->bExists)
return ERROR_ALREADY_EXISTS;
const FILE_ENTRY *entry_from, *entry_to;
- return SHNotifyMoveFileW(feFrom->szFullPath, feTo->szFullPath);
+ return SHNotifyMoveFileW(op, feFrom->szFullPath, feTo->szFullPath);
@@ -1550,7 +1544,7 @@ static DWORD rename_files(SHFILEOPSTRUCTW *op, const FILE_LIST *from, const FILE
if (entry_to->bExists && IsAttribDir(entry_from->attributes) != IsAttribDir(entry_to->attributes))
return IsAttribDir(entry_to->attributes) ? DE_FILEDESTISFLD : DE_FLDDESTISFILE;
- return SHNotifyMoveFileW(entry_from->szFullPath, entry_to->szFullPath);
+ return SHNotifyMoveFileW(op, entry_from->szFullPath, entry_to->szFullPath);
}
/* alert the user if an unsupported flag is used */
@@ -1580,16 +1574,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
@@ -1597,16 +1591,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
switch (lpFileOp->wFunc)
{
case FO_COPY:
@@ -530,5 +530,5 @@ index 9d2d4dc3f82..4bd486a7426 100644
default:
ret = ERROR_INVALID_PARAMETER;
--
2.43.0
2.47.2