Commit cf636cc3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Allow querying the surface interface if a device was created from a surface.

parent c70e17e8
......@@ -299,6 +299,8 @@ struct IDirect3DDeviceImpl
/* Required to keep track which of two available texture blending modes in d3ddevice3 is used */
BOOL legacyTextureBlending;
BOOL from_surface;
D3DMATRIX legacy_projection;
D3DMATRIX legacy_clipspace;
......
......@@ -179,6 +179,13 @@ IDirect3DDeviceImpl_7_QueryInterface(IDirect3DDevice7 *iface,
TRACE("(%p) Returning IDirect3DDevice7 interface at %p\n", This, *obj);
}
/* DirectDrawSurface */
else if (IsEqualGUID(&IID_IDirectDrawSurface, refiid) && This->from_surface)
{
*obj = &This->target->IDirectDrawSurface_iface;
TRACE("Returning IDirectDrawSurface interface %p.\n", *obj);
}
/* Unknown interface */
else
{
......
......@@ -199,6 +199,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
if (d3d)
{
device_impl = impl_from_IDirect3DDevice7(d3d);
device_impl->from_surface = TRUE;
*obj = &device_impl->IDirect3DDevice_iface;
TRACE("(%p) Returning IDirect3DDevice interface at %p\n", This, *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