Jacek Caban : d3d8: Use proper helpers for iface calls.
Alexandre Julliard
julliard at winehq.org
Mon Aug 27 14:35:04 CDT 2012
Module: wine
Branch: master
Commit: 1524cc2ab7c20123fc6dee708073958fcdc7fbd6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1524cc2ab7c20123fc6dee708073958fcdc7fbd6
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Aug 27 12:27:34 2012 +0200
d3d8: Use proper helpers for iface calls.
---
dlls/d3d8/buffer.c | 8 ++++----
dlls/d3d8/device.c | 4 ++--
dlls/d3d8/directx.c | 2 +-
dlls/d3d8/surface.c | 6 +++---
dlls/d3d8/swapchain.c | 2 +-
dlls/d3d8/tests/device.c | 8 ++++----
dlls/d3d8/texture.c | 8 ++++----
dlls/d3d8/volume.c | 2 +-
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c
index b0a11ad..775595a 100644
--- a/dlls/d3d8/buffer.c
+++ b/dlls/d3d8/buffer.c
@@ -34,7 +34,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *i
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DVertexBuffer8_AddRef(iface);
*object = iface;
return S_OK;
}
@@ -302,7 +302,7 @@ HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *
}
buffer->parent_device = &device->IDirect3DDevice8_iface;
- IUnknown_AddRef(buffer->parent_device);
+ IDirect3DDevice8_AddRef(buffer->parent_device);
return D3D_OK;
}
@@ -329,7 +329,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DIndexBuffer8_AddRef(iface);
*object = iface;
return S_OK;
}
@@ -596,7 +596,7 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *de
}
buffer->parent_device = &device->IDirect3DDevice8_iface;
- IUnknown_AddRef(buffer->parent_device);
+ IDirect3DDevice8_AddRef(buffer->parent_device);
return D3D_OK;
}
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index fa7cb48..d90161f 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -307,7 +307,7 @@ static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID
if (IsEqualGUID(riid, &IID_IDirect3DDevice8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DDevice8_AddRef(iface);
*out = iface;
return S_OK;
}
@@ -2845,7 +2845,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
wined3d_surface_incref(*surface);
d3d_surface->container = container_parent;
- IUnknown_Release(d3d_surface->parent_device);
+ IDirect3DDevice8_Release(d3d_surface->parent_device);
d3d_surface->parent_device = NULL;
IDirect3DSurface8_Release(&d3d_surface->IDirect3DSurface8_iface);
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 89c2fcc..4339251 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -49,7 +49,7 @@ static HRESULT WINAPI d3d8_QueryInterface(IDirect3D8 *iface, REFIID riid, void *
if (IsEqualGUID(riid, &IID_IDirect3D8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3D8_AddRef(iface);
*out = iface;
return S_OK;
}
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c
index 91d263c..3a0f862 100644
--- a/dlls/d3d8/surface.c
+++ b/dlls/d3d8/surface.c
@@ -36,7 +36,7 @@ static HRESULT WINAPI d3d8_surface_QueryInterface(IDirect3DSurface8 *iface, REFI
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DSurface8_AddRef(iface);
*out = iface;
return S_OK;
}
@@ -69,7 +69,7 @@ static ULONG WINAPI d3d8_surface_AddRef(IDirect3DSurface8 *iface)
if (ref == 1)
{
if (surface->parent_device)
- IUnknown_AddRef(surface->parent_device);
+ IDirect3DDevice8_AddRef(surface->parent_device);
wined3d_mutex_lock();
wined3d_surface_incref(surface->wined3d_surface);
wined3d_mutex_unlock();
@@ -359,7 +359,7 @@ HRESULT surface_init(struct d3d8_surface *surface, struct d3d8_device *device,
}
surface->parent_device = &device->IDirect3DDevice8_iface;
- IUnknown_AddRef(surface->parent_device);
+ IDirect3DDevice8_AddRef(surface->parent_device);
return D3D_OK;
}
diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c
index 0410fb8..3482900 100644
--- a/dlls/d3d8/swapchain.c
+++ b/dlls/d3d8/swapchain.c
@@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_swapchain_QueryInterface(IDirect3DSwapChain8 *iface,
if (IsEqualGUID(riid, &IID_IDirect3DSwapChain8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DSwapChain8_AddRef(iface);
*out = iface;
return S_OK;
}
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index ddb72c6..b16d5bf 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -121,7 +121,7 @@ static HRESULT reset_device(IDirect3DDevice8 *device, HWND device_window, BOOL w
#define CHECK_RELEASE(obj,d,rc) \
if (obj) { \
int tmp1, rc_new = rc; \
- IUnknown_Release( obj ); \
+ IUnknown_Release( (IUnknown*)obj ); \
tmp1 = get_refcount( (IUnknown *)d ); \
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
trace("CreateTexture failed: %#08x\n", hr);
- if (texture) IUnknown_Release( texture );
+ if (texture) IDirect3DDevice8_Release( texture );
}
static void test_mipmap_levels(void)
@@ -210,10 +210,10 @@ static void test_mipmap_levels(void)
cleanup:
if (pDevice)
{
- UINT refcount = IUnknown_Release( pDevice );
+ UINT refcount = IDirect3DDevice8_Release( pDevice );
ok(!refcount, "Device has %u references left.\n", refcount);
}
- if (pD3d) IUnknown_Release( pD3d );
+ if (pD3d) IDirect3D8_Release( pD3d );
DestroyWindow( hwnd );
}
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index 59bc693..f139d4e 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -45,7 +45,7 @@ static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, R
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DTexture8_AddRef(iface);
*out = iface;
return S_OK;
}
@@ -413,7 +413,7 @@ static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *if
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DCubeTexture8_AddRef(iface);
*out = iface;
return S_OK;
}
@@ -433,7 +433,7 @@ static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
if (ref == 1)
{
- IUnknown_AddRef(texture->parent_device);
+ IDirect3DDevice8_AddRef(texture->parent_device);
wined3d_mutex_lock();
wined3d_texture_incref(texture->wined3d_texture);
wined3d_mutex_unlock();
@@ -806,7 +806,7 @@ static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *if
|| IsEqualGUID(riid, &IID_IDirect3DResource8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DVolumeTexture8_AddRef(iface);
*out = iface;
return S_OK;
}
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index 5c77193..ecd4bb1 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -35,7 +35,7 @@ static HRESULT WINAPI d3d8_volume_QueryInterface(IDirect3DVolume8 *iface, REFIID
if (IsEqualGUID(riid, &IID_IDirect3DVolume8)
|| IsEqualGUID(riid, &IID_IUnknown))
{
- IUnknown_AddRef(iface);
+ IDirect3DVolume8_AddRef(iface);
*out = iface;
return S_OK;
}
More information about the wine-cvs
mailing list