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
);
39 IClassFactory IClassFactory_iface
;
41 HRESULT (*cf
)(IUnknown
*,IUnknown
**);
44 static inline ClassFactory
*impl_from_IClassFactory(IClassFactory
*iface
)
46 return CONTAINING_RECORD(iface
, ClassFactory
, IClassFactory_iface
);
49 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
,
50 REFIID riid
, void **ppv
)
54 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
55 TRACE("(IID_IUnknown %p)\n", ppv
);
57 }else if(IsEqualGUID(&IID_IClassFactory
, riid
)) {
58 TRACE("IID_IClassFactory %p)\n", ppv
);
63 IUnknown_AddRef((IUnknown
*)*ppv
);
67 FIXME("(%s %p)\n", debugstr_guid(riid
), ppv
);
71 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
76 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
81 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
,
82 IUnknown
*pOuter
, REFIID riid
, void **ppv
)
84 ClassFactory
*This
= impl_from_IClassFactory(iface
);
87 TRACE("(%p, %p, %s, %p)\n", iface
, pOuter
, debugstr_guid(riid
), ppv
);
89 ret
= This
->cf(pOuter
, &obj
);
93 ret
= IUnknown_QueryInterface(obj
,riid
,ppv
);
94 IUnknown_Release(obj
);
98 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
100 FIXME("(%d)\n", dolock
);
104 static const IClassFactoryVtbl ClassFactoryVtbl
= {
105 ClassFactory_QueryInterface
,
107 ClassFactory_Release
,
108 ClassFactory_CreateInstance
,
109 ClassFactory_LockServer
112 /******************************************************************
113 * DllGetClassObject (msimtf.@)
115 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
117 if(IsEqualGUID(&CLSID_CActiveIMM
, rclsid
)) {
118 static ClassFactory cf
= {
119 { &ClassFactoryVtbl
},
120 ActiveIMMApp_Constructor
,
123 return IClassFactory_QueryInterface(&cf
.IClassFactory_iface
, riid
, ppv
);
126 FIXME("(%s %s %p)\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
127 return CLASS_E_CLASSNOTAVAILABLE
;