Frank Richter : setupapi: Make do_file_copyW send "target newer" notifications.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 28 05:09:14 CDT 2006


Module: wine
Branch: master
Commit: 8aecf251df44ba9b2a9ab47356a8a7482a594b1c
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=8aecf251df44ba9b2a9ab47356a8a7482a594b1c

Author: Frank Richter <frank.richter at gmail.com>
Date:   Fri Aug 25 21:24:43 2006 +0200

setupapi: Make do_file_copyW send "target newer" notifications.

---

 dlls/setupapi/queue.c |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

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 @@ 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;
@@ -1011,20 +1012,32 @@ static BOOL do_file_copyW( LPCWSTR sourc
 
                 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 @@ 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_PTR)&filepaths, 0);
+                        else
+                            docopy = FALSE;
                     }
                 }
             }
@@ -1169,7 +1184,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)
                 {




More information about the wine-cvs mailing list