[PATCH 3/5] d3d8: Check the device status in present calls.

Michael Stefaniuc mstefani at redhat.com
Mon Jun 30 04:34:09 CDT 2014


On 06/30/2014 11:17 AM, Henri Verbeet wrote:
> diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c
> index e9f4976..067a3e0 100644
> --- a/dlls/d3d8/swapchain.c
> +++ b/dlls/d3d8/swapchain.c
> @@ -91,11 +91,15 @@ static HRESULT WINAPI d3d8_swapchain_Present(IDirect3DSwapChain8 *iface,
>          const RGNDATA *dirty_region)
>  {
>      struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface);
> +    struct d3d8_device *device = impl_from_IDirect3DDevice8(swapchain->parent_device);
I kinda don't like this: impl_from_IFoo() should be called only from
methods of IFoo. For the rest there is unsafe_impl_from_IFoo().
But in this case, my first impulse would be to make
swapchain->parent_device a struct d3d8_device thus avoiding the
impl_from_IDirect3DDevice8() altogether.

bye
	michael



More information about the wine-devel mailing list