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.
This commit is contained in:
Rob Shearman 2008-04-12 10:06:56 +01:00 committed by Alexandre Julliard
parent bab7871cac
commit b2603687cc
2 changed files with 8 additions and 2 deletions

View File

@ -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 = \

View File

@ -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);