[PATCH 3/4] setupapi: Clear the Win32 error if no copy was necessary.

Zebediah Figura z.figura12 at gmail.com
Fri May 17 17:36:52 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/setupapi/queue.c         | 2 ++
 dlls/setupapi/tests/install.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index a0a9012b0a..4a70c5b390 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -1145,6 +1145,8 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
         rc = CopyFileW(source,target,FALSE);
         TRACE("Did copy... rc was %i\n",rc);
     }
+    else
+        SetLastError(ERROR_SUCCESS);
 
     /* after copy processing */
     if (style & SP_COPY_DELETESOURCE)
diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c
index c27c9ca772..624751fcda 100644
--- a/dlls/setupapi/tests/install.c
+++ b/dlls/setupapi/tests/install.c
@@ -1369,7 +1369,7 @@ static void test_install_file(void)
     SetLastError(0xdeadbeef);
     ret = SetupInstallFileA(hinf, &infctx, "one.txt", "src", "one.txt", SP_COPY_REPLACEONLY, NULL, NULL);
     ok(!ret, "Expected failure.\n");
-    todo_wine ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
+    ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
     ok(!file_exists("dst/one.txt"), "Destination file should not exist.\n");
 
     ret = SetupFindFirstLineA(hinf, "section1", "two.txt", &infctx);
-- 
2.21.0




More information about the wine-devel mailing list