d3d8: Use proper helpers for iface calls.
This commit is contained in:
parent
2097c5ddb6
commit
1524cc2ab7
|
@ -34,7 +34,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *i
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DVertexBuffer8_AddRef(iface);
|
||||||
*object = iface;
|
*object = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer->parent_device = &device->IDirect3DDevice8_iface;
|
buffer->parent_device = &device->IDirect3DDevice8_iface;
|
||||||
IUnknown_AddRef(buffer->parent_device);
|
IDirect3DDevice8_AddRef(buffer->parent_device);
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DIndexBuffer8_AddRef(iface);
|
||||||
*object = iface;
|
*object = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *de
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer->parent_device = &device->IDirect3DDevice8_iface;
|
buffer->parent_device = &device->IDirect3DDevice8_iface;
|
||||||
IUnknown_AddRef(buffer->parent_device);
|
IDirect3DDevice8_AddRef(buffer->parent_device);
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,7 @@ static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID
|
||||||
if (IsEqualGUID(riid, &IID_IDirect3DDevice8)
|
if (IsEqualGUID(riid, &IID_IDirect3DDevice8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DDevice8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -2845,7 +2845,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
|
||||||
wined3d_surface_incref(*surface);
|
wined3d_surface_incref(*surface);
|
||||||
|
|
||||||
d3d_surface->container = container_parent;
|
d3d_surface->container = container_parent;
|
||||||
IUnknown_Release(d3d_surface->parent_device);
|
IDirect3DDevice8_Release(d3d_surface->parent_device);
|
||||||
d3d_surface->parent_device = NULL;
|
d3d_surface->parent_device = NULL;
|
||||||
|
|
||||||
IDirect3DSurface8_Release(&d3d_surface->IDirect3DSurface8_iface);
|
IDirect3DSurface8_Release(&d3d_surface->IDirect3DSurface8_iface);
|
||||||
|
|
|
@ -49,7 +49,7 @@ static HRESULT WINAPI d3d8_QueryInterface(IDirect3D8 *iface, REFIID riid, void *
|
||||||
if (IsEqualGUID(riid, &IID_IDirect3D8)
|
if (IsEqualGUID(riid, &IID_IDirect3D8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3D8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ static HRESULT WINAPI d3d8_surface_QueryInterface(IDirect3DSurface8 *iface, REFI
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DSurface8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ static ULONG WINAPI d3d8_surface_AddRef(IDirect3DSurface8 *iface)
|
||||||
if (ref == 1)
|
if (ref == 1)
|
||||||
{
|
{
|
||||||
if (surface->parent_device)
|
if (surface->parent_device)
|
||||||
IUnknown_AddRef(surface->parent_device);
|
IDirect3DDevice8_AddRef(surface->parent_device);
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
wined3d_surface_incref(surface->wined3d_surface);
|
wined3d_surface_incref(surface->wined3d_surface);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
@ -359,7 +359,7 @@ HRESULT surface_init(struct d3d8_surface *surface, struct d3d8_device *device,
|
||||||
}
|
}
|
||||||
|
|
||||||
surface->parent_device = &device->IDirect3DDevice8_iface;
|
surface->parent_device = &device->IDirect3DDevice8_iface;
|
||||||
IUnknown_AddRef(surface->parent_device);
|
IDirect3DDevice8_AddRef(surface->parent_device);
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_swapchain_QueryInterface(IDirect3DSwapChain8 *iface,
|
||||||
if (IsEqualGUID(riid, &IID_IDirect3DSwapChain8)
|
if (IsEqualGUID(riid, &IID_IDirect3DSwapChain8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DSwapChain8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ static HRESULT reset_device(IDirect3DDevice8 *device, HWND device_window, BOOL w
|
||||||
#define CHECK_RELEASE(obj,d,rc) \
|
#define CHECK_RELEASE(obj,d,rc) \
|
||||||
if (obj) { \
|
if (obj) { \
|
||||||
int tmp1, rc_new = rc; \
|
int tmp1, rc_new = rc; \
|
||||||
IUnknown_Release( obj ); \
|
IUnknown_Release( (IUnknown*)obj ); \
|
||||||
tmp1 = get_refcount( (IUnknown *)d ); \
|
tmp1 = get_refcount( (IUnknown *)d ); \
|
||||||
ok(tmp1 == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, tmp1); \
|
ok(tmp1 == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, tmp1); \
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ static void check_mipmap_levels(IDirect3DDevice8 *device, UINT width, UINT heigh
|
||||||
} else
|
} else
|
||||||
trace("CreateTexture failed: %#08x\n", hr);
|
trace("CreateTexture failed: %#08x\n", hr);
|
||||||
|
|
||||||
if (texture) IUnknown_Release( texture );
|
if (texture) IDirect3DDevice8_Release( texture );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_mipmap_levels(void)
|
static void test_mipmap_levels(void)
|
||||||
|
@ -210,10 +210,10 @@ static void test_mipmap_levels(void)
|
||||||
cleanup:
|
cleanup:
|
||||||
if (pDevice)
|
if (pDevice)
|
||||||
{
|
{
|
||||||
UINT refcount = IUnknown_Release( pDevice );
|
UINT refcount = IDirect3DDevice8_Release( pDevice );
|
||||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||||
}
|
}
|
||||||
if (pD3d) IUnknown_Release( pD3d );
|
if (pD3d) IDirect3D8_Release( pD3d );
|
||||||
DestroyWindow( hwnd );
|
DestroyWindow( hwnd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, R
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DTexture8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *if
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DCubeTexture8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
|
||||||
|
|
||||||
if (ref == 1)
|
if (ref == 1)
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(texture->parent_device);
|
IDirect3DDevice8_AddRef(texture->parent_device);
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
wined3d_texture_incref(texture->wined3d_texture);
|
wined3d_texture_incref(texture->wined3d_texture);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
@ -806,7 +806,7 @@ static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *if
|
||||||
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DVolumeTexture8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_volume_QueryInterface(IDirect3DVolume8 *iface, REFIID
|
||||||
if (IsEqualGUID(riid, &IID_IDirect3DVolume8)
|
if (IsEqualGUID(riid, &IID_IDirect3DVolume8)
|
||||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
IUnknown_AddRef(iface);
|
IDirect3DVolume8_AddRef(iface);
|
||||||
*out = iface;
|
*out = iface;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue