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
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(IDXGIAdapter
*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
))
37 IUnknown_AddRef(iface
);
42 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
48 static ULONG STDMETHODCALLTYPE
dxgi_adapter_AddRef(IDXGIAdapter
*iface
)
50 struct dxgi_adapter
*This
= (struct dxgi_adapter
*)iface
;
51 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
53 TRACE("%p increasing refcount to %u\n", This
, refcount
);
58 static ULONG STDMETHODCALLTYPE
dxgi_adapter_Release(IDXGIAdapter
*iface
)
60 struct dxgi_adapter
*This
= (struct dxgi_adapter
*)iface
;
61 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
63 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
67 HeapFree(GetProcessHeap(), 0, This
);
73 /* IDXGIObject methods */
75 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_SetPrivateData(IDXGIAdapter
*iface
,
76 REFGUID guid
, UINT data_size
, const void *data
)
78 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface
, debugstr_guid(guid
), data_size
, data
);
83 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter
*iface
,
84 REFGUID guid
, const IUnknown
*object
)
86 FIXME("iface %p, guid %s, object %p stub!\n", iface
, debugstr_guid(guid
), object
);
91 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_GetPrivateData(IDXGIAdapter
*iface
,
92 REFGUID guid
, UINT
*data_size
, void *data
)
94 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface
, debugstr_guid(guid
), data_size
, data
);
99 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_GetParent(IDXGIAdapter
*iface
, REFIID riid
, void **parent
)
101 FIXME("iface %p, riid %s, parent %p stub!\n", iface
, debugstr_guid(riid
), parent
);
106 /* IDXGIAdapter methods */
108 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_EnumOutputs(IDXGIAdapter
*iface
, UINT output_idx
, IDXGIOutput
**output
)
110 FIXME("iface %p, output_idx %u, output %p stub!\n", iface
, output_idx
, output
);
115 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_GetDesc(IDXGIAdapter
*iface
, DXGI_ADAPTER_DESC
*desc
)
117 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
122 static HRESULT STDMETHODCALLTYPE
dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter
*iface
,
123 REFGUID guid
, LARGE_INTEGER
*umd_version
)
125 FIXME("iface %p, guid %s, umd_version %p stub!\n", iface
, debugstr_guid(guid
), umd_version
);
130 const struct IDXGIAdapterVtbl dxgi_adapter_vtbl
=
132 /* IUnknown methods */
133 dxgi_adapter_QueryInterface
,
135 dxgi_adapter_Release
,
136 /* IDXGIObject methods */
137 dxgi_adapter_SetPrivateData
,
138 dxgi_adapter_SetPrivateDataInterface
,
139 dxgi_adapter_GetPrivateData
,
140 dxgi_adapter_GetParent
,
141 /* IDXGIAdapter methods */
142 dxgi_adapter_EnumOutputs
,
143 dxgi_adapter_GetDesc
,
144 dxgi_adapter_CheckInterfaceSupport
,