setupapi: Implement SetupInstallFileExA/W.

Hans Leidekker hans at codeweavers.com
Mon Jan 26 04:03:50 CST 2009


Fixes http://bugs.winehq.org/show_bug.cgi?id=17125

 -Hans

diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index da20e6c..64eacbe 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -1063,17 +1063,17 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
 }
 
 /***********************************************************************
- *            SetupInstallFileA   (SETUPAPI.@)
+ *            SetupInstallFileExA   (SETUPAPI.@)
  */
-BOOL WINAPI SetupInstallFileA( HINF hinf, PINFCONTEXT inf_context, PCSTR source, PCSTR root,
-                               PCSTR dest, DWORD style, PSP_FILE_CALLBACK_A handler, PVOID context )
+BOOL WINAPI SetupInstallFileExA( HINF hinf, PINFCONTEXT inf_context, PCSTR source, PCSTR root,
+                                 PCSTR dest, DWORD style, PSP_FILE_CALLBACK_A handler, PVOID context, PBOOL in_use )
 {
     BOOL ret = FALSE;
     struct callback_WtoA_context ctx;
     UNICODE_STRING sourceW, rootW, destW;
 
-    TRACE("%p %p %s %s %s %x %p %p\n", hinf, inf_context, debugstr_a(source), debugstr_a(root),
-          debugstr_a(dest), style, handler, context);
+    TRACE("%p %p %s %s %s %x %p %p %p\n", hinf, inf_context, debugstr_a(source), debugstr_a(root),
+          debugstr_a(dest), style, handler, context, in_use);
 
     sourceW.Buffer = rootW.Buffer = destW.Buffer = NULL;
     if (source && !RtlCreateUnicodeStringFromAsciiz( &sourceW, source ))
@@ -1095,7 +1095,7 @@ BOOL WINAPI SetupInstallFileA( HINF hinf, PINFCONTEXT inf_context, PCSTR source,
     ctx.orig_context = context;
     ctx.orig_handler = handler;
 
-    ret = SetupInstallFileW( hinf, inf_context, sourceW.Buffer, rootW.Buffer, destW.Buffer, style, QUEUE_callback_WtoA, &ctx );
+    ret = SetupInstallFileExW( hinf, inf_context, sourceW.Buffer, rootW.Buffer, destW.Buffer, style, QUEUE_callback_WtoA, &ctx, in_use );
 
 exit:
     RtlFreeUnicodeString( &sourceW );
@@ -1105,10 +1105,19 @@ exit:
 }
 
 /***********************************************************************
- *            SetupInstallFileW   (SETUPAPI.@)
+ *            SetupInstallFileA   (SETUPAPI.@)
  */
-BOOL WINAPI SetupInstallFileW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source, PCWSTR root,
-                               PCWSTR dest, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context )
+BOOL WINAPI SetupInstallFileA( HINF hinf, PINFCONTEXT inf_context, PCSTR source, PCSTR root,
+                               PCSTR dest, DWORD style, PSP_FILE_CALLBACK_A handler, PVOID context )
+{
+    return SetupInstallFileExA( hinf, inf_context, source, root, dest, style, handler, context, NULL );
+}
+
+/***********************************************************************
+ *            SetupInstallFileExW   (SETUPAPI.@)
+ */
+BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source, PCWSTR root,
+                                 PCWSTR dest, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context, PBOOL in_use )
 {
     static const WCHAR CopyFiles[] = {'C','o','p','y','F','i','l','e','s',0};
 
@@ -1116,8 +1125,10 @@ BOOL WINAPI SetupInstallFileW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source
     WCHAR *buffer, *p, *inf_source = NULL;
     unsigned int len;
 
-    TRACE("%p %p %s %s %s %x %p %p\n", hinf, inf_context, debugstr_w(source), debugstr_w(root),
-          debugstr_w(dest), style, handler, context);
+    TRACE("%p %p %s %s %s %x %p %p %p\n", hinf, inf_context, debugstr_w(source), debugstr_w(root),
+          debugstr_w(dest), style, handler, context, in_use);
+
+    if (in_use) FIXME("no file in use support\n");
 
     if (hinf)
     {
@@ -1170,6 +1181,15 @@ BOOL WINAPI SetupInstallFileW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source
 }
 
 /***********************************************************************
+ *            SetupInstallFileW   (SETUPAPI.@)
+ */
+BOOL WINAPI SetupInstallFileW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source, PCWSTR root,
+                               PCWSTR dest, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context )
+{
+    return SetupInstallFileExW( hinf, inf_context, source, root, dest, style, handler, context, NULL );
+}
+
+/***********************************************************************
  *            SetupCommitFileQueueW   (SETUPAPI.@)
  */
 BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBACK_W handler,
diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec
index 6c86043..724b143 100644
--- a/dlls/setupapi/setupapi.spec
+++ b/dlls/setupapi/setupapi.spec
@@ -437,8 +437,8 @@
 @ stdcall SetupInitializeFileLogA (str long)
 @ stdcall SetupInitializeFileLogW (wstr long)
 @ stdcall SetupInstallFileA(ptr ptr str str str long ptr ptr)
-@ stub SetupInstallFileExA
-@ stub SetupInstallFileExW
+@ stdcall SetupInstallFileExA(ptr ptr str str str long ptr ptr ptr)
+@ stdcall SetupInstallFileExW(ptr ptr wstr wstr wstr long ptr ptr ptr)
 @ stdcall SetupInstallFileW(ptr ptr wstr wstr wstr long ptr ptr)
 @ stdcall SetupInstallFilesFromInfSectionA(long long long str str long)
 @ stdcall SetupInstallFilesFromInfSectionW(long long long wstr wstr long)



More information about the wine-patches mailing list