From b3abc343c373ee5fd0764a3ceedeef52589c0ab2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 22 Nov 2019 12:51:50 +0100 Subject: [PATCH] setupapi: Handle copy errors in SetupCommitFileQueueW(). Signed-off-by: Alexandre Julliard --- dlls/setupapi/queue.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index f7da3a7128e..2d2c8334748 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -1051,9 +1051,6 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style, VersionSizeTarget = GetFileVersionInfoSizeW(target,&zero); } - TRACE("SizeTarget %i ... SizeSource %i\n",VersionSizeTarget, - VersionSizeSource); - if (VersionSizeSource && VersionSizeTarget) { LPVOID VersionSource; @@ -1143,7 +1140,7 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style, if (docopy) { rc = CopyFileW(source,target,FALSE); - TRACE("Did copy... rc was %i\n",rc); + if (!rc) WARN( "failed to copy, err %u\n", GetLastError() ); } else SetLastError(ERROR_SUCCESS); @@ -1468,6 +1465,24 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC handler( context, SPFILENOTIFY_ENDCOPY, (UINT_PTR)&paths, 0 ); break; } + paths.Win32Error = GetLastError(); + if (paths.Win32Error == ERROR_PATH_NOT_FOUND || + paths.Win32Error == ERROR_FILE_NOT_FOUND) + continue; + + newpath[0] = 0; + op_result = handler( context, SPFILENOTIFY_COPYERROR, (UINT_PTR)&paths, (UINT_PTR)newpath ); + if (op_result == FILEOP_ABORT) + goto done; + else if (op_result == FILEOP_SKIP) + break; + else if (op_result == FILEOP_NEWPATH) + { + lstrcpyW(op->media->root, newpath); + build_filepathsW(op, &paths); + } + else if (op_result != FILEOP_DOIT) + FIXME("Unhandled return value %#x.\n", op_result); } } else