From b2603687ccac5a6ce51132a1da9a7111cf5e2326 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sat, 12 Apr 2008 10:06:56 +0100 Subject: [PATCH] qmgr: Dynamically link to advpack.dll. Use RegInstall instead of RegInstallA as RegInstallA isn't available in some native versions of advpack commonly installed by programs. --- dlls/qmgr/Makefile.in | 2 +- dlls/qmgr/qmgr_main.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/qmgr/Makefile.in b/dlls/qmgr/Makefile.in index de636dbfe8..57609ca23c 100644 --- a/dlls/qmgr/Makefile.in +++ b/dlls/qmgr/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = qmgr.dll -IMPORTS = advpack wininet urlmon ole32 advapi32 kernel32 +IMPORTS = wininet urlmon ole32 advapi32 kernel32 EXTRALIBS = -luuid C_SRCS = \ diff --git a/dlls/qmgr/qmgr_main.c b/dlls/qmgr/qmgr_main.c index 2a21a2803e..5094874dab 100644 --- a/dlls/qmgr/qmgr_main.c +++ b/dlls/qmgr/qmgr_main.c @@ -141,6 +141,9 @@ static HRESULT register_server(BOOL do_register) { HRESULT hr; STRTABLEA strtable; + HMODULE hAdvpack; + HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); + static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; TRACE("(%x)\n", do_register); @@ -150,9 +153,12 @@ static HRESULT register_server(BOOL do_register) return hr; } + hAdvpack = LoadLibraryW(wszAdvpack); + pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); + hr = init_register_strtable(&strtable); if (SUCCEEDED(hr)) - hr = RegInstallA(hInst, do_register ? "RegisterDll" : "UnregisterDll", + hr = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable); cleanup_register_strtable(&strtable);