Commit d5c2a358 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

ddraw: Return a failure code in IDirectDrawSurfaceImpl::QueryInterface if…

ddraw: Return a failure code in IDirectDrawSurfaceImpl::QueryInterface if IDirect3D7::CreateDevice fails.
parent 4be9f0a7
......@@ -118,10 +118,15 @@ IDirectDrawSurfaceImpl_QueryInterface(IDirectDrawSurface7 *iface,
/* Call into IDirect3D7 for creation */
IDirect3D7_CreateDevice((IDirect3D7 *)&This->ddraw->IDirect3D7_vtbl, riid, (IDirectDrawSurface7 *)This, &d3d);
*obj = d3d ? (IDirect3DDevice *)&((IDirect3DDeviceImpl *)d3d)->IDirect3DDevice_vtbl : NULL;
TRACE("(%p) Returning IDirect3DDevice interface at %p\n", This, *obj);
if (d3d)
{
*obj = (IDirect3DDevice *)&((IDirect3DDeviceImpl *)d3d)->IDirect3DDevice_vtbl;
TRACE("(%p) Returning IDirect3DDevice interface at %p\n", This, *obj);
return S_OK;
}
return S_OK;
WARN("Unable to create a IDirect3DDevice instance, returning E_NOINTERFACE\n");
return E_NOINTERFACE;
}
else if (IsEqualGUID( &IID_IDirect3DTexture, riid ) ||
IsEqualGUID( &IID_IDirect3DTexture2, riid ))
......
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