mfmediaengine: Add missing initialization of vertex buffer components (Coverity).
[wine.git] / dlls / msimtf / main.c
blob8fc1a50dd0a57f761f25b7abeb05702388faa02e
1 /*
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
19 #include <stdarg.h>
20 #include <stdio.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "rpcproxy.h"
30 #include "dimm.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(msimtf);
36 extern HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut);
38 typedef struct {
39 IClassFactory IClassFactory_iface;
41 HRESULT (*cf)(IUnknown*,IUnknown**);
42 } ClassFactory;
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)
52 *ppv = NULL;
54 if(IsEqualGUID(&IID_IUnknown, riid)) {
55 TRACE("(IID_IUnknown %p)\n", ppv);
56 *ppv = iface;
57 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
58 TRACE("IID_IClassFactory %p)\n", ppv);
59 *ppv = iface;
62 if(*ppv) {
63 IUnknown_AddRef((IUnknown*)*ppv);
64 return S_OK;
67 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
68 return E_NOINTERFACE;
71 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
73 return 2;
76 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
78 return 1;
81 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface,
82 IUnknown *pOuter, REFIID riid, void **ppv)
84 ClassFactory *This = impl_from_IClassFactory(iface);
85 HRESULT ret;
86 IUnknown *obj;
87 TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
89 ret = This->cf(pOuter, &obj);
90 if (FAILED(ret))
91 return ret;
93 ret = IUnknown_QueryInterface(obj,riid,ppv);
94 IUnknown_Release(obj);
95 return ret;
98 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
100 FIXME("(%d)\n", dolock);
101 return S_OK;
104 static const IClassFactoryVtbl ClassFactoryVtbl = {
105 ClassFactory_QueryInterface,
106 ClassFactory_AddRef,
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;