d2d1: Create feature level 10.0 device context state objects.
[wine.git] / dlls / mmcndmgr / mmcndmgr.c
blobf5d35e2c43cd0329895d41a266959f1c2d27e40e
1 /*
3 * Copyright 2011 Alistair Leslie-Hughes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
22 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27 #include "rpcproxy.h"
29 #include "wine/debug.h"
31 #include "initguid.h"
32 #include "mmc.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mmc);
36 static HRESULT WINAPI mmcversion_QueryInterface(IMMCVersionInfo *iface, REFIID riid, void **ppv)
38 TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
40 if ( IsEqualGUID( riid, &IID_IMMCVersionInfo ) ||
41 IsEqualGUID( riid, &IID_IUnknown ) )
43 *ppv = iface;
45 else
47 TRACE("Unsupported interface %s\n", debugstr_guid(riid));
48 *ppv = NULL;
49 return E_NOINTERFACE;
52 IMMCVersionInfo_AddRef(iface);
53 return S_OK;
56 static ULONG WINAPI mmcversion_AddRef(IMMCVersionInfo *iface)
58 return 2;
61 static ULONG WINAPI mmcversion_Release(IMMCVersionInfo *iface)
63 return 1;
66 static HRESULT WINAPI mmcversion_GetMMCVersion(IMMCVersionInfo *iface, LONG *pVersionMajor, LONG *pVersionMinor)
68 TRACE("(%p, %p, %p): stub\n", iface, pVersionMajor, pVersionMinor);
70 if(pVersionMajor)
71 *pVersionMajor = 3;
73 if(pVersionMinor)
74 *pVersionMinor = 0;
76 return S_OK;
79 static const struct IMMCVersionInfoVtbl mmcversionVtbl =
81 mmcversion_QueryInterface,
82 mmcversion_AddRef,
83 mmcversion_Release,
84 mmcversion_GetMMCVersion
87 static IMMCVersionInfo mmcVersionInfo = { &mmcversionVtbl };
89 /***********************************************************
90 * ClassFactory implementation
92 typedef HRESULT (*CreateInstanceFunc)(IUnknown*,REFIID,void**);
94 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFGUID riid, void **ppvObject)
96 if(IsEqualGUID(&IID_IClassFactory, riid) || IsEqualGUID(&IID_IUnknown, riid)) {
97 IClassFactory_AddRef(iface);
98 *ppvObject = iface;
99 return S_OK;
102 WARN("not supported iid %s\n", debugstr_guid(riid));
103 *ppvObject = NULL;
104 return E_NOINTERFACE;
107 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
109 TRACE("(%p)\n", iface);
110 return 2;
113 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
115 TRACE("(%p)\n", iface);
117 return 1;
120 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
121 REFIID riid, void **ppv)
123 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
124 return IMMCVersionInfo_QueryInterface(&mmcVersionInfo, riid, ppv);
127 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
129 TRACE("(%p)->(%x)\n", iface, fLock);
130 return S_OK;
133 static const IClassFactoryVtbl MMCClassFactoryVtbl = {
134 ClassFactory_QueryInterface,
135 ClassFactory_AddRef,
136 ClassFactory_Release,
137 ClassFactory_CreateInstance,
138 ClassFactory_LockServer
141 static IClassFactory MMCVersionInfoFactory = { &MMCClassFactoryVtbl };
143 HRESULT WINAPI DllGetClassObject( REFCLSID riid, REFIID iid, LPVOID *ppv )
145 TRACE("%s %s %p\n", debugstr_guid(riid), debugstr_guid(iid), ppv );
147 if( IsEqualCLSID( riid, &CLSID_MMCVersionInfo ))
149 TRACE("(CLSID_MMCVersionInfo %s %p)\n", debugstr_guid(riid), ppv);
150 return IClassFactory_QueryInterface(&MMCVersionInfoFactory, iid, ppv);
153 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
154 return CLASS_E_CLASSNOTAVAILABLE;