diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index adac98de..55cfdb3e 100644 --- a/src/dxgi/dxgi_factory.cpp +++ b/src/dxgi/dxgi_factory.cpp @@ -52,6 +52,8 @@ namespace dxvk { IDXGISwapChain** ppSwapChain) { if (ppSwapChain == nullptr || pDesc == nullptr || pDevice == NULL) return DXGI_ERROR_INVALID_CALL; + if (pDesc->OutputWindow == nullptr) + return DXGI_ERROR_INVALID_CALL; try { *ppSwapChain = ref(new DxgiSwapChain(this, pDevice, pDesc)); diff --git a/src/dxgi/dxgi_main.cpp b/src/dxgi/dxgi_main.cpp index 495b3ec0..b602e721 100644 --- a/src/dxgi/dxgi_main.cpp +++ b/src/dxgi/dxgi_main.cpp @@ -9,7 +9,9 @@ namespace dxvk { if (riid != __uuidof(IDXGIFactory) && riid != __uuidof(IDXGIFactory1)) { Logger::err("CreateDXGIFactory: Requested version of IDXGIFactory not supported"); - return DXGI_ERROR_UNSUPPORTED; + Logger::err(str::format(riid)); + *ppFactory = nullptr; + return E_NOINTERFACE; } try { diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index 30f97663..6005c43c 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -139,8 +139,11 @@ namespace dxvk { if (pFullscreen != nullptr) *pFullscreen = !m_desc.Windowed; - if ((ppTarget != nullptr) && !m_desc.Windowed) - hr = this->GetContainingOutput(ppTarget); + if (ppTarget != nullptr) { + *ppTarget = nullptr; + if (!m_desc.Windowed) + hr = this->GetContainingOutput(ppTarget); + } return hr; }