James Hawkins : advpack: Implement the RegisterOCXs callback.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Apr 20 13:19:47 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Thu Apr 20 10:08:44 2006 -0500

advpack: Implement the RegisterOCXs callback.

---

 dlls/advpack/advpack_private.h |    1 +
 dlls/advpack/install.c         |   31 +++++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/dlls/advpack/advpack_private.h b/dlls/advpack/advpack_private.h
index 8da353c..0921159 100644
--- a/dlls/advpack/advpack_private.h
+++ b/dlls/advpack/advpack_private.h
@@ -21,6 +21,7 @@
 #ifndef __ADVPACK_PRIVATE_H
 #define __ADVPACK_PRIVATE_H
 
+HRESULT do_ocx_reg(HMODULE hocx, BOOL do_reg);
 LPWSTR get_parameter(LPWSTR *params, WCHAR separator);
 void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir);
 
diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c
index 252fd89..e7911ca 100644
--- a/dlls/advpack/install.c
+++ b/dlls/advpack/install.c
@@ -62,8 +62,35 @@ static const WCHAR RegisterOCXs[] = {'R'
 /* Advanced INF callbacks */
 static HRESULT register_ocxs_callback(HINF hinf, PCWSTR field, void *arg)
 {
-    FIXME("Unhandled command: RegisterOCXs\n");
-    return E_FAIL;
+    HMODULE hm;
+    INFCONTEXT context;
+    HRESULT hr = S_OK;
+
+    BOOL ok = SetupFindFirstLineW(hinf, field, NULL, &context);
+    
+    for (; ok; ok = SetupFindNextLine(&context, &context))
+    {
+        WCHAR buffer[MAX_INF_STRING_LENGTH];
+
+        /* get OCX filename */
+        if (!SetupGetStringFieldW(&context, 1, buffer,
+                                  sizeof(buffer) / sizeof(WCHAR), NULL))
+            continue;
+
+        hm = LoadLibraryExW(buffer, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+        if (!hm)
+        {
+            hr = E_FAIL;
+            continue;
+        }
+
+        if (do_ocx_reg(hm, TRUE))
+            hr = E_FAIL;
+
+        FreeLibrary(hm);
+    }
+
+    return hr;
 }
 
 /* sequentially returns pointers to parameters in a parameter list




More information about the wine-cvs mailing list