setupapi: Make do_file_copyW send "target newer" notifications.
Frank Richter
frank.richter at gmail.com
Fri Aug 25 14:24:43 CDT 2006
-------------- next part --------------
>From 0ae9dfa483b43fda8527ed5683793424d3d5a747 Mon Sep 17 00:00:00 2001
From: Frank Richter frank.richter at gmail.com <frank.richter at gmail.com>
Date: Fri, 25 Aug 2006 21:24:12 +0200
Subject: [PATCH] setupapi: Make do_file_copyW send "target newer" notifications.
---
dlls/setupapi/queue.c | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index f7d3c5e..8c429b9 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -944,7 +944,8 @@ static BOOL create_full_pathW(const WCHA
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;
@@ -992,6 +993,7 @@ static BOOL do_file_copyW( LPCWSTR sourc
UINT length;
WCHAR SubBlock[2]={'\\',0};
DWORD ret;
+ FILEPATHS_W filepaths;
VersionSource = HeapAlloc(GetProcessHeap(),0,VersionSizeSource);
VersionTarget = HeapAlloc(GetProcessHeap(),0,VersionSizeTarget);
@@ -1014,17 +1016,27 @@ static BOOL do_file_copyW( LPCWSTR sourc
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)&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)&filepaths, 0);
+ else
+ docopy = FALSE;
}
else if ((style & SP_COPY_NEWER_ONLY) &&
(TargetInfo->dwFileVersionMS ==
@@ -1032,8 +1044,10 @@ static BOOL do_file_copyW( LPCWSTR sourc
&&(TargetInfo->dwFileVersionLS ==
SourceInfo->dwFileVersionLS))
{
- FIXME("Notify that target version is greater..\n");
- docopy = FALSE;
+ if (handler)
+ docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT)&filepaths, 0);
+ else
+ docopy = FALSE;
}
}
}
@@ -1169,7 +1183,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND
}
}
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)
{
--
1.4.1.1
More information about the wine-patches
mailing list