From c4ca63418f68487a9ed77de8c935daedf0b01a14 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 20 Apr 2006 10:08:44 -0500 Subject: [PATCH] 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 8da353c7471..0921159c48e 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 252fd89f238..e7911cae144 100644 --- a/dlls/advpack/install.c +++ b/dlls/advpack/install.c @@ -62,8 +62,35 @@ static const WCHAR RegisterOCXs[] = {'R','e','g','i','s','t','e','r','O','C','X' /* 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