wined3d: Pass the D3DCB_CreateAdditionalSwapChain() error code to the upper layers (needed for d3d9).

This commit is contained in:
Francois Gouget 2007-06-12 17:49:58 +02:00 committed by Alexandre Julliard
parent 00c8dbe2aa
commit 6f24b198f3
1 changed files with 4 additions and 2 deletions

View File

@ -1803,6 +1803,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
IWineD3DSwapChainImpl *swapchain;
HRESULT hr;
DWORD state;
TRACE("(%p)->(%p,%p)\n", This, pPresentationParameters, D3DCB_CreateAdditionalSwapChain);
@ -1818,9 +1819,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
/* Setup the implicit swapchain */
TRACE("Creating implicit swapchain\n");
if (FAILED(D3DCB_CreateAdditionalSwapChain((IUnknown *) This->parent, pPresentationParameters, (IWineD3DSwapChain **)&swapchain)) || !swapchain) {
hr=D3DCB_CreateAdditionalSwapChain((IUnknown *) This->parent, pPresentationParameters, (IWineD3DSwapChain **)&swapchain);
if (FAILED(hr) || !swapchain) {
WARN("Failed to create implicit swapchain\n");
return WINED3DERR_INVALIDCALL;
return hr;
}
This->NumberOfSwapChains = 1;