[PATCH] shell32: Choose return value for SHFileOperationW depending on windows version

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed May 9 21:05:41 CDT 2018


From: Michael Müller <michael at fds-team.de>

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/shell32/shlfileop.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 4507b72..244b34b 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1019,7 +1019,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
 
     /* empty list */
     if (!szFiles[0])
-        return ERROR_ACCESS_DENIED;
+        return ERROR_ACCESS_DENIED;  /* S_OK for Windows 95/98 */
         
     flList->feFiles = heap_alloc_zero(flList->num_alloc * sizeof(FILE_ENTRY));
 
@@ -1525,7 +1525,19 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
     ZeroMemory(&flTo, sizeof(FILE_LIST));
 
     if ((ret = parse_file_list(&flFrom, lpFileOp->pFrom)))
+    {
+        if (ret != ERROR_ACCESS_DENIED)
+            return ret;
+
+        /* Windows 95/98 */
+        if (GetVersion() & 0x80000000)
+            return S_OK;
+
+        WARN("The return value of this function call depends on the windows version.\n");
+        WARN("For older software it might be necessary to set the windows version to 95/98 using winecfg.\n");
+
         return ret;
+    }
 
     if (lpFileOp->wFunc != FO_DELETE)
         parse_file_list(&flTo, lpFileOp->pTo);
-- 
1.9.1



More information about the wine-devel mailing list