Commit 0da53e3d authored by Alexandre Julliard's avatar Alexandre Julliard

msimtf: Convert dll registration to the IRegistrar mechanism.

parent b13722cd
......@@ -5,6 +5,6 @@ C_SRCS = \
activeimmapp.c \
main.c
RC_SRCS = rsrc.rc
IDL_R_SRCS = msimtf.idl
@MAKE_DLL_RULES@
......@@ -31,7 +31,6 @@
#include "winuser.h"
#include "winerror.h"
#include "objbase.h"
#include "advpub.h"
#include "dimm.h"
#include "imm.h"
......
......@@ -27,9 +27,8 @@
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "advpub.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "dimm.h"
#include "wine/debug.h"
......@@ -159,59 +158,12 @@ HRESULT WINAPI DllCanUnloadNow(void)
return S_FALSE;
}
#define INF_SET_CLSID(clsid) \
do \
{ \
static CHAR name[] = "CLSID_" #clsid; \
\
pse[i].pszName = name; \
clsids[i++] = &CLSID_ ## clsid; \
} while (0)
static HRESULT register_server(BOOL doregister)
{
HRESULT hres;
HMODULE hAdvpack;
HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
STRTABLEA strtable;
STRENTRYA pse[1];
static CLSID const *clsids[34];
unsigned int i = 0;
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
INF_SET_CLSID(CActiveIMM);
for(i = 0; i < sizeof(pse)/sizeof(pse[0]); i++) {
pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39);
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
}
strtable.cEntries = sizeof(pse)/sizeof(pse[0]);
strtable.pse = pse;
hAdvpack = LoadLibraryW(wszAdvpack);
pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall");
hres = pRegInstall(msimtf_instance, doregister ? "RegisterDll" : "UnregisterDll", &strtable);
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
HeapFree(GetProcessHeap(), 0, pse[i].pszValue);
return hres;
}
#undef INF_SET_CLSID
/***********************************************************************
* DllRegisterServer (msimtf.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
return register_server(TRUE);
return __wine_register_resources( msimtf_instance, NULL );
}
/***********************************************************************
......@@ -219,5 +171,5 @@ HRESULT WINAPI DllRegisterServer(void)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return register_server(FALSE);
return __wine_unregister_resources( msimtf_instance, NULL );
}
/*
* Copyright 2007 Jacek Caban for CodeWeavers
* COM Classes for msimtf
*
* Copyright 2010 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -16,5 +18,21 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @makedep: msimtf.inf */
REGINST REGINST msimtf.inf
[
helpstring("CActiveIMMApp"),
threading(apartment),
uuid(4955dd33-b159-11d0-8fcf-00aa006bcc59)
]
coclass CActiveIMM { interface IActiveIMMApp; }
[
threading(apartment),
uuid(c1ee01f2-b3b6-4a6a-9ddd-e988c088ec82)
]
coclass CActiveIMMAppEx { interface IActiveIMMApp; }
[
threading(apartment),
uuid(50d5107a-d278-4871-8989-f4ceaaf59cfc)
]
coclass CActiveIMMAppEx_Trident { interface IActiveIMMApp; }
[version]
Signature="$CHICAGO$"
[RegisterDll]
AddReg=Classes.Reg
[UnregisterDll]
DelReg=Classes.Reg
[Classes.Reg]
HKCR,"CLSID\%CLSID_CActiveIMM%",,,"CActiveIMMApp"
HKCR,"CLSID\%CLSID_CActiveIMM%\InProcServer32",,,"msimtf.dll"
HKCR,"CLSID\%CLSID_CActiveIMM%\InProcServer32","ThreadingModel",,"Apartment"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx_Trident%",,,"CActiveIMMAppEx_Trident"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx_Trident%\InProcServer32",,,"msimtf.dll"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx_Trident%\InProcServer32","ThreadingModel",,"Apartment"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx%",,,"CActiveIMMAppEx"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx%\InProcServer32",,,"msimtf.dll"
HKCR,"CLSID\%CLSID_CActiveIMMAppEx%\InProcServer32","ThreadingModel",,"Apartment"
[Strings]
CLSID_CActiveIMMAppEx_Trident={50D5107A-D278-4871-8989-F4CEAAF59CFC}
CLSID_CActiveIMMAppEx="{C1EE01F2-B3B6-4A6A-9DDD-E988C088EC82}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment