[2/6] WineD3D: Add a function for initializing surface sysmem

Henri Verbeet hverbeet at gmail.com
Wed Dec 2 15:10:05 CST 2009


2009/12/2 Stefan Dösinger <stefan at codeweavers.com>:
> -        updateSurfaceDesc((IWineD3DSurfaceImpl *)swapchain->frontBuffer, pPresentationParameters);
> +        hr = updateSurfaceDesc((IWineD3DSurfaceImpl *)swapchain->frontBuffer, pPresentationParameters);
> +        if(FAILED(hr))
> +        {
> +            IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
> +            return hr;
> +        }
> +
>          for(i = 0; i < swapchain->presentParms.BackBufferCount; i++) {
> -            updateSurfaceDesc((IWineD3DSurfaceImpl *)swapchain->backBuffer[i], pPresentationParameters);
> +            hr = updateSurfaceDesc((IWineD3DSurfaceImpl *)swapchain->backBuffer[i], pPresentationParameters);
> +            if(FAILED(hr))
> +            {
> +                IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
> +                return hr;
> +            }
>          }
IWineD3DDeviceImpl_Reset() suffers from similar issues in general, so
maybe we just don't care, but if one of the updateSurfaceDesc() calls
fails you're left with inconsistent surface sizes.

> +    This->Flags |= SFLAG_INSYSMEM;
Why is this in surface_init_sysmem(), instead of a ModifyLocation()
call after the call to surface_init_sysmem()?



More information about the wine-devel mailing list