Add simple implementation of advpack.DoInfInstall

Dmitry Timoshkov dmitry at baikal.ru
Mon Nov 1 05:18:06 CST 2004


Hello,

now dcom95 can be installed with builtin advpack.dll.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Add simple implementation of advpack.DoInfInstall.

diff -up cvs/hq/wine/dlls/advpack/advpack.c wine/dlls/advpack/advpack.c
--- cvs/hq/wine/dlls/advpack/advpack.c	2004-10-28 09:58:15.000000000 +0900
+++ wine/dlls/advpack/advpack.c	2004-11-01 18:52:08.000000000 +0800
@@ -19,8 +19,12 @@
  */
 
 #include <stdarg.h>
+
 #include "windef.h"
 #include "winbase.h"
+#include "winuser.h"
+#include "setupapi.h"
+#include "advpub.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(advpack);
@@ -51,3 +55,40 @@ void WINAPI LaunchINFSectionEx( HWND hWn
 {
     FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(cmdline), show );
 }
+
+/* this structure very closely resembles parameters of RunSetupCommand() */
+typedef struct
+{
+    HWND hwnd;
+    LPCSTR title;
+    LPCSTR inf_name;
+    LPCSTR dir;
+    LPCSTR section_name;
+} SETUPCOMMAND_PARAMS;
+
+/***********************************************************************
+ *		DoInfInstall  (ADVPACK.@)
+ */
+BOOL WINAPI DoInfInstall(const SETUPCOMMAND_PARAMS *setup)
+{
+    BOOL ret;
+    HINF hinf;
+    void *callback_context;
+
+    TRACE("%p %s %s %s %s\n", setup->hwnd, debugstr_a(setup->title),
+          debugstr_a(setup->inf_name), debugstr_a(setup->dir),
+          debugstr_a(setup->section_name));
+
+    hinf = SetupOpenInfFileA(setup->inf_name, NULL, INF_STYLE_WIN4, NULL);
+    if (hinf == INVALID_HANDLE_VALUE) return FALSE;
+
+    callback_context = SetupInitDefaultQueueCallback(setup->hwnd);
+
+    ret = SetupInstallFromInfSectionA(NULL, hinf, setup->section_name, SPINST_ALL,
+                                      NULL, NULL, 0, SetupDefaultQueueCallbackA,
+                                      callback_context, NULL, NULL);
+    SetupTermDefaultQueueCallback(callback_context);
+    SetupCloseInfFile(hinf);
+
+    return ret;
+}
diff -up cvs/hq/wine/dlls/advpack/advpack.spec wine/dlls/advpack/advpack.spec
--- cvs/hq/wine/dlls/advpack/advpack.spec	2004-10-28 09:58:15.000000000 +0900
+++ wine/dlls/advpack/advpack.spec	2004-11-01 13:34:09.000000000 +0800
@@ -4,7 +4,7 @@
 @ stub DelNode
 @ stub DelNodeRunDLL32
 @ stub DllMain
-@ stub DoInfInstall
+@ stdcall DoInfInstall(ptr)
 @ stub ExecuteCab
 @ stub ExtractFiles
 @ stub FileSaveMarkNotExist






More information about the wine-patches mailing list