inetcomm: Add a stub implementation of ISMTPTransport2.
[wine/multimedia.git] / dlls / dxgi / device.c
blob195c502d61b039567c0c6568c430b5d80a322963
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_device_QueryInterface(IDXGIDevice *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_IDXGIDevice))
37 IUnknown_AddRef(iface);
38 *object = iface;
39 return S_OK;
42 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
44 *object = NULL;
45 return E_NOINTERFACE;
48 static ULONG STDMETHODCALLTYPE dxgi_device_AddRef(IDXGIDevice *iface)
50 struct dxgi_device *This = (struct dxgi_device *)iface;
51 ULONG refcount = InterlockedIncrement(&This->refcount);
53 TRACE("%p increasing refcount to %u\n", This, refcount);
55 return refcount;
58 static ULONG STDMETHODCALLTYPE dxgi_device_Release(IDXGIDevice *iface)
60 struct dxgi_device *This = (struct dxgi_device *)iface;
61 ULONG refcount = InterlockedDecrement(&This->refcount);
63 TRACE("%p decreasing refcount to %u\n", This, refcount);
65 if (!refcount)
67 HeapFree(GetProcessHeap(), 0, This);
70 return refcount;
73 /* IDXGIObject methods */
75 static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IDXGIDevice *iface, REFGUID guid, UINT data_size, const void *data)
77 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
79 return E_NOTIMPL;
82 static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IDXGIDevice *iface, REFGUID guid, const IUnknown *object)
84 FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
86 return E_NOTIMPL;
89 static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IDXGIDevice *iface, REFGUID guid, UINT *data_size, void *data)
91 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
93 return E_NOTIMPL;
96 static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IDXGIDevice *iface, REFIID riid, void **parent)
98 FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent);
100 return E_NOTIMPL;
103 /* IDXGIDevice methods */
105 static HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IDXGIDevice *iface, IDXGIAdapter **adapter)
107 FIXME("iface %p, adapter %p stub!\n", iface, adapter);
109 return E_NOTIMPL;
112 static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IDXGIDevice *iface,
113 const DXGI_SURFACE_DESC *desc, UINT surface_count, DXGI_USAGE usage,
114 const DXGI_SHARED_RESOURCE *shared_resource, IDXGISurface **surface)
116 FIXME("iface %p, desc %p, surface_count %u, usage %#x, shared_resource %p, surface %p stub!\n",
117 iface, desc, surface_count, usage, shared_resource, surface);
119 return E_NOTIMPL;
122 static HRESULT STDMETHODCALLTYPE dxgi_device_QueryResourceResidency(IDXGIDevice *iface,
123 IUnknown *const *resources, DXGI_RESIDENCY *residency, UINT resource_count)
125 FIXME("iface %p, resources %p, residency %p, resource_count %u stub!\n",
126 iface, resources, residency, resource_count);
128 return E_NOTIMPL;
131 static HRESULT STDMETHODCALLTYPE dxgi_device_SetGPUThreadPriority(IDXGIDevice *iface, INT priority)
133 FIXME("iface %p, priority %d stub!\n", iface, priority);
135 return E_NOTIMPL;
138 static HRESULT STDMETHODCALLTYPE dxgi_device_GetGPUThreadPriority(IDXGIDevice *iface, INT *priority)
140 FIXME("iface %p, priority %p stub!\n", iface, priority);
142 return E_NOTIMPL;
145 const struct IDXGIDeviceVtbl dxgi_device_vtbl =
147 /* IUnknown methods */
148 dxgi_device_QueryInterface,
149 dxgi_device_AddRef,
150 dxgi_device_Release,
151 /* IDXGIObject methods */
152 dxgi_device_SetPrivateData,
153 dxgi_device_SetPrivateDataInterface,
154 dxgi_device_GetPrivateData,
155 dxgi_device_GetParent,
156 /* IDXGIDevice methods */
157 dxgi_device_GetAdapter,
158 dxgi_device_CreateSurface,
159 dxgi_device_QueryResourceResidency,
160 dxgi_device_SetGPUThreadPriority,
161 dxgi_device_GetGPUThreadPriority,