msimtf: Added Dll[Un]RegisterServer implementation.

This commit is contained in:
Jacek Caban 2007-10-16 20:50:20 +02:00 committed by Alexandre Julliard
parent 07bf51efbd
commit 0101e58d43
5 changed files with 108 additions and 4 deletions

1
.gitignore vendored
View File

@ -266,6 +266,7 @@ dlls/msi/tests/*.ok
dlls/msi/tests/msi_crosstest.exe
dlls/msi/tests/testlist.c
dlls/msimg32/libmsimg32.def
dlls/msimtf/rsrc.res
dlls/msrle32/rsrc.res
dlls/msvcrt/libmsvcrt.def
dlls/msvcrt/rsrc.res

View File

@ -4,8 +4,10 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msimtf.dll
IMPORTS = kernel32
EXTRALIBS = -luuid
C_SRCS = main.c
RC_SRCS = rsrc.rc
@MAKE_DLL_RULES@

View File

@ -19,14 +19,23 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "advpub.h"
#include "ole2.h"
#include "dimm.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msimtf);
static HINSTANCE msimtf_instance;
/******************************************************************
* DllMain (msimtf.@)
*/
@ -37,6 +46,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
msimtf_instance = hInstDLL;
DisableThreadLibraryCalls(hInstDLL);
break;
case DLL_PROCESS_DETACH:
@ -63,13 +73,59 @@ 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;
typeof(RegInstallA) *pRegInstall;
STRTABLEA strtable;
STRENTRYA pse[1];
static CLSID const *clsids[34];
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 = (typeof(RegInstallA)*)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)
{
FIXME("()\n");
return S_OK;
return register_server(TRUE);
}
/***********************************************************************
@ -77,6 +133,5 @@ HRESULT WINAPI DllRegisterServer(void)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
FIXME("()\n");
return S_OK;
return register_server(FALSE);
}

26
dlls/msimtf/msimtf.inf Normal file
View File

@ -0,0 +1,26 @@
[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}"

20
dlls/msimtf/rsrc.rc Normal file
View File

@ -0,0 +1,20 @@
/*
* Copyright 2007 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @makedep: msimtf.inf */
REGINST REGINST msimtf.inf