[PATH] shell32: Fix a behavior of shfileoperationw

Ming Shao shaoming at uniontech.com
Fri Mar 25 04:10:13 CDT 2022


From: shaoming <shaoming at uniontech.com>

Signed-off-by: shaoming <shaoming at uniontech.com>
---
 dlls/shell32/shlfileop.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 17a8e7046c7..aa69c7a3232 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1519,6 +1519,14 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
     ZeroMemory(&flFrom, sizeof(FILE_LIST));
     ZeroMemory(&flTo, sizeof(FILE_LIST));
 
+    //windows look likes select first path when lpFileOp->pTo have more then one paths
+    if(lpFileOp->wFunc == FO_RENAME)
+    {
+        LPWSTR lpRefTo = lpFileOp->pTo;
+        while(*lpRefTo++);
+        if(*lpRefTo) *lpRefTo = '\0';
+    }
+
     if ((ret = parse_file_list(&flFrom, lpFileOp->pFrom)))
         return ret;
 
-- 
2.20.1






More information about the wine-devel mailing list