ddraw: AddAttachedSurface() just references whatever we pass it.
This commit is contained in:
parent
a534925a48
commit
0d8e6719d5
|
@ -1605,8 +1605,8 @@ static HRESULT WINAPI ddraw_surface7_AddAttachedSurface(IDirectDrawSurface7 *ifa
|
||||||
{
|
{
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ddraw_surface7_AddRef(&attachment_impl->IDirectDrawSurface7_iface);
|
|
||||||
attachment_impl->attached_iface = (IUnknown *)attachment;
|
attachment_impl->attached_iface = (IUnknown *)attachment;
|
||||||
|
IUnknown_AddRef(attachment_impl->attached_iface);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1624,9 +1624,9 @@ static HRESULT WINAPI ddraw_surface4_AddAttachedSurface(IDirectDrawSurface4 *ifa
|
||||||
{
|
{
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ddraw_surface4_AddRef(&attachment_impl->IDirectDrawSurface4_iface);
|
|
||||||
ddraw_surface7_Release(&attachment_impl->IDirectDrawSurface7_iface);
|
|
||||||
attachment_impl->attached_iface = (IUnknown *)attachment;
|
attachment_impl->attached_iface = (IUnknown *)attachment;
|
||||||
|
IUnknown_AddRef(attachment_impl->attached_iface);
|
||||||
|
ddraw_surface7_Release(&attachment_impl->IDirectDrawSurface7_iface);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ddraw_surface3_AddAttachedSurface(IDirectDrawSurface3 *iface, IDirectDrawSurface3 *attachment)
|
static HRESULT WINAPI ddraw_surface3_AddAttachedSurface(IDirectDrawSurface3 *iface, IDirectDrawSurface3 *attachment)
|
||||||
|
@ -1670,8 +1670,8 @@ static HRESULT WINAPI ddraw_surface3_AddAttachedSurface(IDirectDrawSurface3 *ifa
|
||||||
{
|
{
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ddraw_surface3_AddRef(&attachment_impl->IDirectDrawSurface3_iface);
|
|
||||||
attachment_impl->attached_iface = (IUnknown *)attachment;
|
attachment_impl->attached_iface = (IUnknown *)attachment;
|
||||||
|
IUnknown_AddRef(attachment_impl->attached_iface);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1689,9 +1689,9 @@ static HRESULT WINAPI ddraw_surface2_AddAttachedSurface(IDirectDrawSurface2 *ifa
|
||||||
{
|
{
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ddraw_surface2_AddRef(&attachment_impl->IDirectDrawSurface2_iface);
|
|
||||||
ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface);
|
|
||||||
attachment_impl->attached_iface = (IUnknown *)attachment;
|
attachment_impl->attached_iface = (IUnknown *)attachment;
|
||||||
|
IUnknown_AddRef(attachment_impl->attached_iface);
|
||||||
|
ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1709,9 +1709,9 @@ static HRESULT WINAPI ddraw_surface1_AddAttachedSurface(IDirectDrawSurface *ifac
|
||||||
{
|
{
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ddraw_surface1_AddRef(&attachment_impl->IDirectDrawSurface_iface);
|
|
||||||
ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface);
|
|
||||||
attachment_impl->attached_iface = (IUnknown *)attachment;
|
attachment_impl->attached_iface = (IUnknown *)attachment;
|
||||||
|
IUnknown_AddRef(attachment_impl->attached_iface);
|
||||||
|
ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -662,6 +662,7 @@ static void test_surface_interface_mismatch(void)
|
||||||
IDirect3DMaterial *background = NULL;
|
IDirect3DMaterial *background = NULL;
|
||||||
DDSURFACEDESC surface_desc;
|
DDSURFACEDESC surface_desc;
|
||||||
DWORD z_depth = 0;
|
DWORD z_depth = 0;
|
||||||
|
ULONG refcount;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
D3DCOLOR color;
|
D3DCOLOR color;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
@ -728,7 +729,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
/* Using a different surface interface version still works */
|
/* Using a different surface interface version still works */
|
||||||
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
||||||
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
||||||
IDirectDrawSurface_Release(ds);
|
refcount = IDirectDrawSurface_Release(ds);
|
||||||
|
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
|
|
@ -687,6 +687,7 @@ static void test_surface_interface_mismatch(void)
|
||||||
IDirect3DMaterial2 *background = NULL;
|
IDirect3DMaterial2 *background = NULL;
|
||||||
DDSURFACEDESC surface_desc;
|
DDSURFACEDESC surface_desc;
|
||||||
DWORD z_depth = 0;
|
DWORD z_depth = 0;
|
||||||
|
ULONG refcount;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
D3DCOLOR color;
|
D3DCOLOR color;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
@ -753,7 +754,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
/* Using a different surface interface version still works */
|
/* Using a different surface interface version still works */
|
||||||
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
||||||
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
||||||
IDirectDrawSurface_Release(ds);
|
refcount = IDirectDrawSurface_Release(ds);
|
||||||
|
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
|
|
@ -875,6 +875,7 @@ static void test_surface_interface_mismatch(void)
|
||||||
IDirect3DViewport3 *viewport = NULL;
|
IDirect3DViewport3 *viewport = NULL;
|
||||||
DDSURFACEDESC2 surface_desc;
|
DDSURFACEDESC2 surface_desc;
|
||||||
DDPIXELFORMAT z_fmt;
|
DDPIXELFORMAT z_fmt;
|
||||||
|
ULONG refcount;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
D3DCOLOR color;
|
D3DCOLOR color;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
@ -936,7 +937,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
/* Using a different surface interface version still works */
|
/* Using a different surface interface version still works */
|
||||||
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
||||||
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
||||||
IDirectDrawSurface4_Release(ds);
|
refcount = IDirectDrawSurface4_Release(ds);
|
||||||
|
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
|
|
@ -841,6 +841,7 @@ static void test_surface_interface_mismatch(void)
|
||||||
IDirect3DDevice7 *device = NULL;
|
IDirect3DDevice7 *device = NULL;
|
||||||
DDSURFACEDESC2 surface_desc;
|
DDSURFACEDESC2 surface_desc;
|
||||||
DDPIXELFORMAT z_fmt;
|
DDPIXELFORMAT z_fmt;
|
||||||
|
ULONG refcount;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
D3DCOLOR color;
|
D3DCOLOR color;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
@ -900,7 +901,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
/* Using a different surface interface version still works */
|
/* Using a different surface interface version still works */
|
||||||
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
hr = IDirectDrawSurface3_AddAttachedSurface(surface3, (IDirectDrawSurface3 *)ds);
|
||||||
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x.\n", hr);
|
||||||
IDirectDrawSurface7_Release(ds);
|
refcount = IDirectDrawSurface7_Release(ds);
|
||||||
|
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue