comctl32/tests: Move v6 test initialisation routines into separate file.
[wine/multimedia.git] / dlls / dxgi / adapter.c
blobd2c64ad8e0915d8bcfe478ac4a66e159ecfb2584
1 /*
2 * Copyright 2008 Henri Verbeet 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
20 #include "config.h"
21 #include "wine/port.h"
23 #include "dxgi_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *iface, REFIID riid, void **object)
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
33 if (IsEqualGUID(riid, &IID_IUnknown)
34 || IsEqualGUID(riid, &IID_IDXGIObject)
35 || IsEqualGUID(riid, &IID_IDXGIAdapter)
36 || IsEqualGUID(riid, &IID_IWineDXGIAdapter))
38 IUnknown_AddRef(iface);
39 *object = iface;
40 return S_OK;
43 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
45 *object = NULL;
46 return E_NOINTERFACE;
49 static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface)
51 struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
54 TRACE("%p increasing refcount to %u\n", This, refcount);
56 return refcount;
59 static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface)
61 struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
66 if (!refcount)
68 HeapFree(GetProcessHeap(), 0, This);
71 return refcount;
74 /* IDXGIObject methods */
76 static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IWineDXGIAdapter *iface,
77 REFGUID guid, UINT data_size, const void *data)
79 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
81 return E_NOTIMPL;
84 static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IWineDXGIAdapter *iface,
85 REFGUID guid, const IUnknown *object)
87 FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
89 return E_NOTIMPL;
92 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IWineDXGIAdapter *iface,
93 REFGUID guid, UINT *data_size, void *data)
95 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
97 return E_NOTIMPL;
100 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface, REFIID riid, void **parent)
102 struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
104 TRACE("iface %p, riid %s, parent %p\n", iface, debugstr_guid(riid), parent);
106 return IDXGIFactory_QueryInterface(This->parent, riid, parent);
109 /* IDXGIAdapter methods */
111 static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *iface,
112 UINT output_idx, IDXGIOutput **output)
114 FIXME("iface %p, output_idx %u, output %p stub!\n", iface, output_idx, output);
116 return E_NOTIMPL;
119 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc)
121 FIXME("iface %p, desc %p stub!\n", iface, desc);
123 return E_NOTIMPL;
126 static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IWineDXGIAdapter *iface,
127 REFGUID guid, LARGE_INTEGER *umd_version)
129 FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version);
131 return E_NOTIMPL;
134 /* IWineDXGIAdapter methods */
136 static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface)
138 struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
140 TRACE("iface %p, returning %u\n", iface, This->ordinal);
142 return This->ordinal;
145 const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
147 /* IUnknown methods */
148 dxgi_adapter_QueryInterface,
149 dxgi_adapter_AddRef,
150 dxgi_adapter_Release,
151 /* IDXGIObject methods */
152 dxgi_adapter_SetPrivateData,
153 dxgi_adapter_SetPrivateDataInterface,
154 dxgi_adapter_GetPrivateData,
155 dxgi_adapter_GetParent,
156 /* IDXGIAdapter methods */
157 dxgi_adapter_EnumOutputs,
158 dxgi_adapter_GetDesc,
159 dxgi_adapter_CheckInterfaceSupport,
160 /* IWineDXGIAdapter methods */
161 dxgi_adapter_get_ordinal,