Commit 2486da82 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dxgi: COM cleanup for the IWineDXGIAdapter iface.

parent 31510a1a
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
static inline struct dxgi_adapter *impl_from_IWineDXGIAdapter(IWineDXGIAdapter *iface)
{
return CONTAINING_RECORD(iface, struct dxgi_adapter, IWineDXGIAdapter_iface);
}
/* IUnknown methods */ /* IUnknown methods */
static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *iface, REFIID riid, void **object) static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *iface, REFIID riid, void **object)
...@@ -48,7 +53,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *i ...@@ -48,7 +53,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *i
static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface) static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
ULONG refcount = InterlockedIncrement(&This->refcount); ULONG refcount = InterlockedIncrement(&This->refcount);
TRACE("%p increasing refcount to %u\n", This, refcount); TRACE("%p increasing refcount to %u\n", This, refcount);
...@@ -58,7 +63,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface) ...@@ -58,7 +63,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface)
static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface) static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
ULONG refcount = InterlockedDecrement(&This->refcount); ULONG refcount = InterlockedDecrement(&This->refcount);
TRACE("%p decreasing refcount to %u\n", This, refcount); TRACE("%p decreasing refcount to %u\n", This, refcount);
...@@ -100,7 +105,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IWineDXGIAdapter *i ...@@ -100,7 +105,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IWineDXGIAdapter *i
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface, REFIID riid, void **parent) static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface, REFIID riid, void **parent)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
TRACE("iface %p, riid %s, parent %p\n", iface, debugstr_guid(riid), parent); TRACE("iface %p, riid %s, parent %p\n", iface, debugstr_guid(riid), parent);
...@@ -112,7 +117,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface, ...@@ -112,7 +117,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface,
static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *iface,
UINT output_idx, IDXGIOutput **output) UINT output_idx, IDXGIOutput **output)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output); TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output);
...@@ -132,7 +137,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac ...@@ -132,7 +137,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc) static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
WINED3DADAPTER_IDENTIFIER adapter_id; WINED3DADAPTER_IDENTIFIER adapter_id;
char description[128]; char description[128];
struct wined3d *wined3d; struct wined3d *wined3d;
...@@ -187,7 +192,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IWineDXGIAda ...@@ -187,7 +192,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IWineDXGIAda
static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface) static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface)
{ {
struct dxgi_adapter *This = (struct dxgi_adapter *)iface; struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface);
TRACE("iface %p, returning %u\n", iface, This->ordinal); TRACE("iface %p, returning %u\n", iface, This->ordinal);
...@@ -217,7 +222,7 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, IWineDXGIFactory *parent ...@@ -217,7 +222,7 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, IWineDXGIFactory *parent
{ {
struct dxgi_output *output; struct dxgi_output *output;
adapter->vtbl = &dxgi_adapter_vtbl; adapter->IWineDXGIAdapter_iface.lpVtbl = &dxgi_adapter_vtbl;
adapter->parent = parent; adapter->parent = parent;
adapter->refcount = 1; adapter->refcount = 1;
adapter->ordinal = ordinal; adapter->ordinal = ordinal;
......
...@@ -112,7 +112,7 @@ void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) ...@@ -112,7 +112,7 @@ void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
/* IDXGIAdapter */ /* IDXGIAdapter */
struct dxgi_adapter struct dxgi_adapter
{ {
const struct IWineDXGIAdapterVtbl *vtbl; IWineDXGIAdapter IWineDXGIAdapter_iface;
IWineDXGIFactory *parent; IWineDXGIFactory *parent;
LONG refcount; LONG refcount;
UINT ordinal; UINT ordinal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment