2 * Copyright 2007 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(msimtf
);
36 extern HRESULT
ActiveIMMApp_Constructor(IUnknown
*punkOuter
, IUnknown
**ppOut
);
38 static HINSTANCE msimtf_instance
;
40 /******************************************************************
43 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
47 case DLL_PROCESS_ATTACH
:
48 msimtf_instance
= hInstDLL
;
49 DisableThreadLibraryCalls(hInstDLL
);
56 IClassFactory IClassFactory_iface
;
58 HRESULT (*cf
)(IUnknown
*,IUnknown
**);
61 static inline ClassFactory
*impl_from_IClassFactory(IClassFactory
*iface
)
63 return CONTAINING_RECORD(iface
, ClassFactory
, IClassFactory_iface
);
66 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
,
67 REFIID riid
, void **ppv
)
71 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
72 TRACE("(IID_IUnknown %p)\n", ppv
);
74 }else if(IsEqualGUID(&IID_IClassFactory
, riid
)) {
75 TRACE("IID_IClassFactory %p)\n", ppv
);
80 IUnknown_AddRef((IUnknown
*)*ppv
);
84 FIXME("(%s %p)\n", debugstr_guid(riid
), ppv
);
88 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
93 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
98 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
,
99 IUnknown
*pOuter
, REFIID riid
, void **ppv
)
101 ClassFactory
*This
= impl_from_IClassFactory(iface
);
104 TRACE("(%p, %p, %s, %p)\n", iface
, pOuter
, debugstr_guid(riid
), ppv
);
106 ret
= This
->cf(pOuter
, &obj
);
110 ret
= IUnknown_QueryInterface(obj
,riid
,ppv
);
111 IUnknown_Release(obj
);
115 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
117 FIXME("(%d)\n", dolock
);
121 static const IClassFactoryVtbl ClassFactoryVtbl
= {
122 ClassFactory_QueryInterface
,
124 ClassFactory_Release
,
125 ClassFactory_CreateInstance
,
126 ClassFactory_LockServer
129 /******************************************************************
130 * DllGetClassObject (msimtf.@)
132 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
134 if(IsEqualGUID(&CLSID_CActiveIMM
, rclsid
)) {
135 static ClassFactory cf
= {
136 { &ClassFactoryVtbl
},
137 ActiveIMMApp_Constructor
,
140 return IClassFactory_QueryInterface(&cf
.IClassFactory_iface
, riid
, ppv
);
143 FIXME("(%s %s %p)\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
144 return CLASS_E_CLASSNOTAVAILABLE
;
147 /******************************************************************
148 * DllCanUnloadNow (msimtf.@)
150 HRESULT WINAPI
DllCanUnloadNow(void)
155 /***********************************************************************
156 * DllRegisterServer (msimtf.@)
158 HRESULT WINAPI
DllRegisterServer(void)
160 return __wine_register_resources( msimtf_instance
);
163 /***********************************************************************
164 * DllUnregisterServer (msimtf.@)
166 HRESULT WINAPI
DllUnregisterServer(void)
168 return __wine_unregister_resources( msimtf_instance
);