hlink: Implement DllRegisterServer.

This commit is contained in:
Mike McCormack 2006-06-06 20:42:39 +09:00 committed by Alexandre Julliard
parent 58709d2263
commit b23b4f5d01
3 changed files with 45 additions and 2 deletions

View File

@ -29,5 +29,5 @@
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stub -private DllRegisterServer
@ stub -private DllUnregisterServer
@ stdcall -private DllRegisterServer()
# @ stub -private DllUnregisterServer

View File

@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "ole2.h"
#include "unknwn.h"
@ -312,3 +313,44 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
return IClassFactory_QueryInterface(pcf, iid, ppv);
}
static HRESULT register_clsid(LPCGUID guid)
{
static const WCHAR clsid[] =
{'C','L','S','I','D','\\',0};
static const WCHAR ips[] =
{'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
static const WCHAR hlink[] =
{'h','l','i','n','k','.','d','l','l',0};
static const WCHAR threading_model[] =
{'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0};
static const WCHAR apartment[] =
{'A','p','a','r','t','m','e','n','t',0};
WCHAR path[80];
HKEY key = NULL;
LONG r;
lstrcpyW(path, clsid);
StringFromGUID2(guid, &path[6], 80);
lstrcatW(path, ips);
r = RegCreateKeyW(HKEY_CLASSES_ROOT, path, &key);
if (r != ERROR_SUCCESS)
return E_FAIL;
RegSetValueExW(key, NULL, 0, REG_SZ, (LPBYTE)hlink, sizeof hlink);
RegSetValueExW(key, threading_model, 0, REG_SZ, (LPBYTE)apartment, sizeof apartment);
RegCloseKey(key);
return S_OK;
}
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT r;
r = register_clsid(&CLSID_StdHlink);
if (SUCCEEDED(r))
r = register_clsid(&CLSID_StdHlinkBrowseContext);
return S_OK;
}

View File

@ -2091,6 +2091,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,dswave.dll,1
11,,dxdiagn.dll,1
11,,hhctrl.ocx,1
11,,hlink.dll,1
11,,itss.dll,1
11,,mlang.dll,1
11,,mshtml.dll,1