From c53d554b720cfc0328fa934840daa6a50bc653d2 Mon Sep 17 00:00:00 2001 From: Matthew Mastracci Date: Mon, 14 Mar 2005 17:16:03 +0000 Subject: [PATCH] Implement RegisterOCX. Stub for DelNodeRunDLL32. --- dlls/advpack/advpack.c | 55 +++++++++++++++++++++++++++++++++++++++ dlls/advpack/advpack.spec | 4 +-- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/dlls/advpack/advpack.c b/dlls/advpack/advpack.c index f1f1ce77ba5..a899941828c 100644 --- a/dlls/advpack/advpack.c +++ b/dlls/advpack/advpack.c @@ -28,10 +28,13 @@ #include "winnls.h" #include "setupapi.h" #include "advpub.h" +#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(advpack); +typedef HRESULT (WINAPI *DLLREGISTER) (void); + /*********************************************************************** * DllMain (ADVPACK.@) @@ -172,3 +175,55 @@ HRESULT WINAPI GetVersionFromFileEx( LPSTR lpszFilename, LPDWORD pdwMSVer, return S_OK; } + +/*********************************************************************** + * RegisterOCX (ADVPACK.@) + */ +void WINAPI RegisterOCX( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show ) +{ + WCHAR wszBuff[MAX_PATH]; + WCHAR* pwcComma; + HMODULE hm; + DLLREGISTER pfnRegister; + HRESULT hr; + + TRACE("(%s)\n", cmdline); + + MultiByteToWideChar(CP_ACP, 0, cmdline, strlen(cmdline), wszBuff, MAX_PATH); + if ((pwcComma = strchrW( wszBuff, ',' ))) *pwcComma = 0; + + TRACE("Parsed DLL name (%s)\n", debugstr_w(wszBuff)); + + hm = LoadLibraryExW(wszBuff, 0, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!hm) + { + ERR("Couldn't load DLL: %s\n", debugstr_w(wszBuff)); + return; + } + + pfnRegister = (DLLREGISTER)GetProcAddress(hm, "DllRegisterServer"); + if (pfnRegister == NULL) + { + ERR("DllRegisterServer entry point not found\n"); + } + else + { + hr = pfnRegister(); + if (hr != S_OK) + { + ERR("DllRegisterServer entry point returned %08lx\n", hr); + } + } + + TRACE("Successfully registered OCX\n"); + + FreeLibrary(hm); +} + +/*********************************************************************** + * DelNodeRunDLL32 (ADVPACK.@) + */ +void WINAPI DelNodeRunDLL32( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show ) +{ + FIXME("(%s) FIXME: stub\n", cmdline); +} diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec index 05296834137..b7e71b3d4ca 100644 --- a/dlls/advpack/advpack.spec +++ b/dlls/advpack/advpack.spec @@ -2,7 +2,7 @@ @ stub AdvInstallFile @ stub CloseINFEngine @ stub DelNode -@ stub DelNodeRunDLL32 +@ stdcall DelNodeRunDLL32(ptr ptr str long) @ stdcall DllMain(long long ptr) @ stdcall DoInfInstall(ptr) @ stub ExecuteCab @@ -23,7 +23,7 @@ @ stub RegRestoreAll @ stub RegSaveRestore @ stub RegSaveRestoreOnINF -@ stub RegisterOCX +@ stdcall RegisterOCX(ptr ptr str long) @ stub RunSetupCommand @ stub SetPerUserSecValues @ stub TranslateInfString