setupapi: Make do_file_copyW send "target newer" notifications.
diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index f7d3c5e..7c89efd 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -944,7 +944,8 @@
return ret;
}
-static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
+static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
+ PSP_FILE_CALLBACK_W handler, PVOID context )
{
BOOL rc = FALSE;
BOOL docopy = TRUE;
@@ -1011,20 +1012,32 @@
if (ret)
{
+ FILEPATHS_W filepaths;
+
TRACE("Versions: Source %li.%li target %li.%li\n",
SourceInfo->dwFileVersionMS, SourceInfo->dwFileVersionLS,
TargetInfo->dwFileVersionMS, TargetInfo->dwFileVersionLS);
+ /* used in case of notification */
+ filepaths.Target = target;
+ filepaths.Source = source;
+ filepaths.Win32Error = 0;
+ filepaths.Flags = 0;
+
if (TargetInfo->dwFileVersionMS > SourceInfo->dwFileVersionMS)
{
- FIXME("Notify that target version is greater..\n");
- docopy = FALSE;
+ if (handler)
+ docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
+ else
+ docopy = FALSE;
}
else if ((TargetInfo->dwFileVersionMS == SourceInfo->dwFileVersionMS)
&& (TargetInfo->dwFileVersionLS > SourceInfo->dwFileVersionLS))
{
- FIXME("Notify that target version is greater..\n");
- docopy = FALSE;
+ if (handler)
+ docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
+ else
+ docopy = FALSE;
}
else if ((style & SP_COPY_NEWER_ONLY) &&
(TargetInfo->dwFileVersionMS ==
@@ -1032,8 +1045,10 @@
&&(TargetInfo->dwFileVersionLS ==
SourceInfo->dwFileVersionLS))
{
- FIXME("Notify that target version is greater..\n");
- docopy = FALSE;
+ if (handler)
+ docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
+ else
+ docopy = FALSE;
}
}
}
@@ -1169,7 +1184,7 @@
}
}
if (do_file_copyW( op_result == FILEOP_NEWPATH ? newpath : paths.Source,
- paths.Target, op->style )) break; /* success */
+ paths.Target, op->style, handler, context )) break; /* success */
/* try to extract it from the cabinet file */
if (op->src_tag)
{