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
23 extern HRESULT
ActiveIMMApp_Constructor(IUnknown
*punkOuter
, IUnknown
**ppOut
);
25 static HINSTANCE msimtf_instance
;
27 /******************************************************************
30 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
34 case DLL_WINE_PREATTACH
:
35 return FALSE
; /* prefer native version */
36 case DLL_PROCESS_ATTACH
:
37 msimtf_instance
= hInstDLL
;
38 DisableThreadLibraryCalls(hInstDLL
);
45 IClassFactory IClassFactory_iface
;
47 HRESULT (*cf
)(IUnknown
*,IUnknown
**);
50 static inline ClassFactory
*impl_from_IClassFactory(IClassFactory
*iface
)
52 return CONTAINING_RECORD(iface
, ClassFactory
, IClassFactory_iface
);
55 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
,
56 REFIID riid
, void **ppv
)
60 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
61 TRACE("(IID_IUnknown %p)\n", ppv
);
63 }else if(IsEqualGUID(&IID_IClassFactory
, riid
)) {
64 TRACE("IID_IClassFactory %p)\n", ppv
);
69 IUnknown_AddRef((IUnknown
*)*ppv
);
73 FIXME("(%s %p)\n", debugstr_guid(riid
), ppv
);
77 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
82 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
87 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
,
88 IUnknown
*pOuter
, REFIID riid
, void **ppv
)
90 ClassFactory
*This
= impl_from_IClassFactory(iface
);
93 TRACE("(%p, %p, %s, %p)\n", iface
, pOuter
, debugstr_guid(riid
), ppv
);
95 ret
= This
->cf(pOuter
, &obj
);
99 ret
= IUnknown_QueryInterface(obj
,riid
,ppv
);
100 IUnknown_Release(obj
);
104 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
106 FIXME("(%d)\n", dolock
);
110 static const IClassFactoryVtbl ClassFactoryVtbl
= {
111 ClassFactory_QueryInterface
,
113 ClassFactory_Release
,
114 ClassFactory_CreateInstance
,
115 ClassFactory_LockServer
118 /******************************************************************
119 * DllGetClassObject (msimtf.@)
121 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
123 if(IsEqualGUID(&CLSID_CActiveIMM
, rclsid
)) {
124 static ClassFactory cf
= {
125 { &ClassFactoryVtbl
},
126 ActiveIMMApp_Constructor
,
129 return IClassFactory_QueryInterface((IClassFactory
*)&cf
, riid
, ppv
);
132 FIXME("(%s %s %p)\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
133 return CLASS_E_CLASSNOTAVAILABLE
;
136 /******************************************************************
137 * DllCanUnloadNow (msimtf.@)
139 HRESULT WINAPI
DllCanUnloadNow(void)
144 /***********************************************************************
145 * DllRegisterServer (msimtf.@)
147 HRESULT WINAPI
DllRegisterServer(void)
149 return __wine_register_resources( msimtf_instance
);
152 /***********************************************************************
153 * DllUnregisterServer (msimtf.@)
155 HRESULT WINAPI
DllUnregisterServer(void)
157 return __wine_unregister_resources( msimtf_instance
);