Zebediah Figura : setupapi: Don' t fail a queued copy if no copy was necessary.
Alexandre Julliard
julliard at winehq.org
Mon May 20 15:50:47 CDT 2019
Module: wine
Branch: master
Commit: 8bc25b24af0276985ad080c8364c11cfff3a1fe5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8bc25b24af0276985ad080c8364c11cfff3a1fe5
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Fri May 17 17:36:53 2019 -0500
setupapi: Don't fail a queued copy if no copy was necessary.
This fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47219
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/setupapi/queue.c | 2 +-
dlls/setupapi/tests/install.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index 4a70c5b..d51a228 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -1309,7 +1309,7 @@ static BOOL queue_copy_file( const WCHAR *source, const WCHAR *dest,
if (op->dst_path && !create_full_pathW(op->dst_path))
return FALSE;
- if (do_file_copyW(source, dest, op->style, handler, context))
+ if (do_file_copyW(source, dest, op->style, handler, context) || GetLastError() == ERROR_SUCCESS)
return TRUE;
/* try to extract it from the cabinet file */
diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c
index 624751f..a0a4596 100644
--- a/dlls/setupapi/tests/install.c
+++ b/dlls/setupapi/tests/install.c
@@ -1468,6 +1468,16 @@ static void test_need_media(void)
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
+ got_need_media = 0;
+ queue = SetupOpenFileQueue();
+ ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
+ ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", "File One", NULL,
+ "dst", NULL, SP_COPY_WARNIFSKIP | SP_COPY_REPLACEONLY);
+ ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
+ run_queue(queue, need_media_cb);
+ ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
+ ok(!file_exists("dst/one.txt"), "Destination file should exist.\n");
+
/* Test with a subdirectory. */
got_need_media = 0;
More information about the wine-cvs
mailing list