Commit f8e7ddd7 authored by Markus Amsler's avatar Markus Amsler Committed by Alexandre Julliard

Revert "d3d: Remove AddRef from IWineD3DDevice_GetBackBuffer.".

This reverts commit 478a414e.
parent b657cd5f
......@@ -295,6 +295,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface
rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, 0, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, (IWineD3DSurface **)&retSurface);
if (rc == D3D_OK && NULL != retSurface && NULL != ppBackBuffer) {
IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(retSurface);
}
return rc;
}
......
......@@ -80,6 +80,7 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8
hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE )Type, &mySurface);
if (hrc == D3D_OK && NULL != mySurface) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(mySurface);
}
return hrc;
}
......
......@@ -205,6 +205,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 ifa
rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, iSwapChain, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, (IWineD3DSurface **)&retSurface);
if (rc == D3D_OK && NULL != retSurface && NULL != ppBackBuffer) {
IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(retSurface);
}
return rc;
}
......
......@@ -88,6 +88,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN9
hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE) Type, &mySurface);
if (hrc == D3D_OK && NULL != mySurface) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(mySurface);
}
/* Do not touch the **ppBackBuffer pointer otherwise! (see device test) */
return hrc;
......
......@@ -1212,6 +1212,9 @@ IDirectDrawImpl_GetGDISurface(IDirectDraw7 *iface,
return DDERR_NOTFOUND;
}
/* GetBackBuffer AddRef()ed the surface, release it */
IWineD3DSurface_Release(Surf);
IWineD3DSurface_GetParent(Surf,
(IUnknown **) &ddsurf);
IDirectDrawSurface7_Release(ddsurf); /* For the GetParent */
......
......@@ -461,6 +461,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetBackBuffer(IWineD3DSwapChain *ifa
*ppBackBuffer = This->backBuffer[iBackBuffer];
TRACE("(%p) : BackBuf %d Type %d returning %p\n", This, iBackBuffer, Type, *ppBackBuffer);
/* Note inc ref on returned surface */
if(*ppBackBuffer) IWineD3DSurface_AddRef(*ppBackBuffer);
return WINED3D_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