Module: wine Branch: master Commit: a748f685a502891bc8fa5f4719f80b6feb39ac9c URL: https://source.winehq.org/git/wine.git/?a=commit;h=a748f685a502891bc8fa5f471...
Author: Zebediah Figura z.figura12@gmail.com Date: Fri May 17 17:36:52 2019 -0500
setupapi: Clear the Win32 error if no copy was necessary.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 a0a9012..4a70c5b 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 c27c9ca..624751f 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);