diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index 2b18110fa6e..7c2b3ba2511 100644 --- a/dlls/d3d10_1/tests/d3d10_1.c +++ b/dlls/d3d10_1/tests/d3d10_1.c @@ -252,7 +252,7 @@ static void test_create_device(void) swapchain_desc.OutputWindow = NULL; hr = D3D10CreateDeviceAndSwapChain1(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, supported_feature_level, D3D10_1_SDK_VERSION, &swapchain_desc, &swapchain, &device); - todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "D3D10CreateDeviceAndSwapChain1 returned %#x.\n", hr); + ok(hr == DXGI_ERROR_INVALID_CALL, "D3D10CreateDeviceAndSwapChain1 returned %#x.\n", hr); ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); ok(!device, "Got unexpected device pointer %p.\n", device); diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ca71718c4e9..2625e08f834 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -1616,7 +1616,7 @@ static void test_create_device(void) swapchain_desc.OutputWindow = NULL; hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &swapchain_desc, &swapchain, &device, &feature_level, &immediate_context); - todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); + ok(hr == DXGI_ERROR_INVALID_CALL, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); ok(!device, "Got unexpected device pointer %p.\n", device); ok(!feature_level, "Got unexpected feature level %#x.\n", feature_level); diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index aa9cdb88fb6..bea116b9df2 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -258,7 +258,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IDXGIFactor "output %p, swapchain %p.\n", iface, device, window, swapchain_desc, fullscreen_desc, output, swapchain); - if (!device || !swapchain_desc || !swapchain) + if (!device || !window || !swapchain_desc || !swapchain) { WARN("Invalid pointer.\n"); return DXGI_ERROR_INVALID_CALL; @@ -292,10 +292,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IDXGIFactor WARN("BufferCount is %u.\n", swapchain_desc->BufferCount); return DXGI_ERROR_INVALID_CALL; } - if (!window) - { - FIXME("No output window, should use factory output window.\n"); - } if (FAILED(hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device))) { diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 4ad5b9f6745..c4bf826c6ae 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -1077,7 +1077,6 @@ static void test_create_swapchain(void) return; } - creation_desc.OutputWindow = 0; creation_desc.BufferDesc.Width = 800; creation_desc.BufferDesc.Height = 600; creation_desc.BufferDesc.RefreshRate.Numerator = 60; @@ -1089,14 +1088,11 @@ static void test_create_swapchain(void) creation_desc.SampleDesc.Quality = 0; creation_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; creation_desc.BufferCount = 1; - creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); + creation_desc.OutputWindow = NULL; creation_desc.Windowed = TRUE; creation_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; creation_desc.Flags = 0; - memset(&initial_state, 0, sizeof(initial_state)); - capture_fullscreen_state(&initial_state.fullscreen_state, creation_desc.OutputWindow); - hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&obj); ok(SUCCEEDED(hr), "IDXGIDevice does not implement IUnknown.\n"); @@ -1112,6 +1108,14 @@ static void test_create_swapchain(void) refcount = get_refcount((IUnknown *)device); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + creation_desc.OutputWindow = NULL; + hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain); + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + + creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); + memset(&initial_state, 0, sizeof(initial_state)); + capture_fullscreen_state(&initial_state.fullscreen_state, creation_desc.OutputWindow); + hr = IDXGIFactory_CreateSwapChain(factory, NULL, &creation_desc, &swapchain); ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); hr = IDXGIFactory_CreateSwapChain(factory, obj, NULL, &swapchain);