Commit 125b9495 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dxgi: COM cleanup for the IDXGIOutput iface.

parent c40a6eee
...@@ -228,7 +228,7 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, IWineDXGIFactory *parent ...@@ -228,7 +228,7 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, IWineDXGIFactory *parent
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
dxgi_output_init(output, adapter); dxgi_output_init(output, adapter);
adapter->output = (IDXGIOutput *)output; adapter->output = &output->IDXGIOutput_iface;
return S_OK; return S_OK;
} }
...@@ -102,7 +102,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l ...@@ -102,7 +102,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
/* IDXGIOutput */ /* IDXGIOutput */
struct dxgi_output struct dxgi_output
{ {
const struct IDXGIOutputVtbl *vtbl; IDXGIOutput IDXGIOutput_iface;
LONG refcount; LONG refcount;
struct dxgi_adapter *adapter; struct dxgi_adapter *adapter;
}; };
......
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
static inline struct dxgi_output *impl_from_IDXGIOutput(IDXGIOutput *iface)
{
return CONTAINING_RECORD(iface, struct dxgi_output, IDXGIOutput_iface);
}
/* IUnknown methods */ /* IUnknown methods */
static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface, REFIID riid, void **object) static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface, REFIID riid, void **object)
...@@ -46,7 +51,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface, ...@@ -46,7 +51,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface,
static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface) static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface)
{ {
struct dxgi_output *This = (struct dxgi_output *)iface; struct dxgi_output *This = impl_from_IDXGIOutput(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);
...@@ -56,7 +61,7 @@ static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface) ...@@ -56,7 +61,7 @@ static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface)
static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface) static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface)
{ {
struct dxgi_output *This = (struct dxgi_output *)iface; struct dxgi_output *This = impl_from_IDXGIOutput(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);
...@@ -98,7 +103,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface, ...@@ -98,7 +103,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface, static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
REFIID riid, void **parent) REFIID riid, void **parent)
{ {
struct dxgi_output *This = (struct dxgi_output *)iface; struct dxgi_output *This = impl_from_IDXGIOutput(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);
...@@ -117,7 +122,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OU ...@@ -117,7 +122,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OU
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface, static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
DXGI_FORMAT format, UINT flags, UINT *mode_count, DXGI_MODE_DESC *desc) DXGI_FORMAT format, UINT flags, UINT *mode_count, DXGI_MODE_DESC *desc)
{ {
struct dxgi_output *This = (struct dxgi_output *)iface; struct dxgi_output *This = impl_from_IDXGIOutput(iface);
enum wined3d_format_id wined3d_format; enum wined3d_format_id wined3d_format;
struct wined3d *wined3d; struct wined3d *wined3d;
UINT i; UINT i;
...@@ -279,7 +284,7 @@ static const struct IDXGIOutputVtbl dxgi_output_vtbl = ...@@ -279,7 +284,7 @@ static const struct IDXGIOutputVtbl dxgi_output_vtbl =
void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
{ {
output->vtbl = &dxgi_output_vtbl; output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl;
output->refcount = 1; output->refcount = 1;
output->adapter = adapter; output->adapter = adapter;
} }
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