Commit 4551135f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ddraw: Use proper helpers for iface calls.

parent 1524cc2a
......@@ -75,7 +75,7 @@ static HRESULT WINAPI d3d_material3_QueryInterface(IDirect3DMaterial3 *iface, RE
if (IsEqualGUID(&IID_IUnknown, riid))
{
IUnknown_AddRef(iface);
IDirect3DMaterial3_AddRef(iface);
*obp = iface;
TRACE(" Creating IUnknown interface at %p.\n", *obp);
return S_OK;
......
......@@ -5440,13 +5440,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *
if (!iface) return NULL;
if (iface->lpVtbl != &ddraw_surface7_vtbl)
{
HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface7, (void **)&iface);
HRESULT hr = IDirectDrawSurface7_QueryInterface(iface, &IID_IDirectDrawSurface7, (void **)&iface);
if (FAILED(hr))
{
WARN("Object %p doesn't expose interface IDirectDrawSurface7.\n", iface);
return NULL;
}
IUnknown_Release(iface);
IDirectDrawSurface7_Release(iface);
}
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface7_iface);
}
......@@ -5456,13 +5456,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *
if (!iface) return NULL;
if (iface->lpVtbl != &ddraw_surface4_vtbl)
{
HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface4, (void **)&iface);
HRESULT hr = IDirectDrawSurface4_QueryInterface(iface, &IID_IDirectDrawSurface4, (void **)&iface);
if (FAILED(hr))
{
WARN("Object %p doesn't expose interface IDirectDrawSurface4.\n", iface);
return NULL;
}
IUnknown_Release(iface);
IDirectDrawSurface4_Release(iface);
}
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface4_iface);
}
......@@ -5472,13 +5472,13 @@ static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSur
if (!iface) return NULL;
if (iface->lpVtbl != &ddraw_surface3_vtbl)
{
HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface3, (void **)&iface);
HRESULT hr = IDirectDrawSurface3_QueryInterface(iface, &IID_IDirectDrawSurface3, (void **)&iface);
if (FAILED(hr))
{
WARN("Object %p doesn't expose interface IDirectDrawSurface3.\n", iface);
return NULL;
}
IUnknown_Release(iface);
IDirectDrawSurface3_Release(iface);
}
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface3_iface);
}
......@@ -5488,13 +5488,13 @@ static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSur
if (!iface) return NULL;
if (iface->lpVtbl != &ddraw_surface2_vtbl)
{
HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface2, (void **)&iface);
HRESULT hr = IDirectDrawSurface2_QueryInterface(iface, &IID_IDirectDrawSurface2, (void **)&iface);
if (FAILED(hr))
{
WARN("Object %p doesn't expose interface IDirectDrawSurface2.\n", iface);
return NULL;
}
IUnknown_Release(iface);
IDirectDrawSurface2_Release(iface);
}
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface2_iface);
}
......@@ -5504,13 +5504,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *if
if (!iface) return NULL;
if (iface->lpVtbl != &ddraw_surface1_vtbl)
{
HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface, (void **)&iface);
HRESULT hr = IDirectDrawSurface_QueryInterface(iface, &IID_IDirectDrawSurface, (void **)&iface);
if (FAILED(hr))
{
WARN("Object %p doesn't expose interface IDirectDrawSurface.\n", iface);
return NULL;
}
IUnknown_Release(iface);
IDirectDrawSurface_Release(iface);
}
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface_iface);
}
......
......@@ -66,21 +66,21 @@ static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 *
if ( IsEqualGUID( &IID_IUnknown, riid ) )
{
IUnknown_AddRef(iface);
IDirect3DVertexBuffer7_AddRef(iface);
*obj = iface;
TRACE(" Creating IUnknown interface at %p.\n", *obj);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirect3DVertexBuffer, riid ) )
{
IUnknown_AddRef(iface);
IDirect3DVertexBuffer7_AddRef(iface);
*obj = &buffer->IDirect3DVertexBuffer_iface;
TRACE(" Creating IDirect3DVertexBuffer interface %p\n", *obj);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirect3DVertexBuffer7, riid ) )
{
IUnknown_AddRef(iface);
IDirect3DVertexBuffer7_AddRef(iface);
*obj = iface;
TRACE(" Creating IDirect3DVertexBuffer7 interface %p\n", *obj);
return S_OK;
......
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