winevulkan: Handle invalid window in vkCreateSwapchainKHR.
This commit is contained in:
parent
0d969b1764
commit
9a1362695b
2 changed files with 6 additions and 2 deletions
|
@ -858,7 +858,6 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
|
|||
|
||||
swapchain = 0xdeadbeef;
|
||||
vr = create_swapchain(physical_device, surface, device, NULL, &swapchain);
|
||||
todo_wine
|
||||
ok(vr == VK_ERROR_INITIALIZATION_FAILED /* Nvidia */ || vr == VK_SUCCESS /* AMD */,
|
||||
"Got unexpected vr %d.\n", vr);
|
||||
if (vr == VK_SUCCESS)
|
||||
|
@ -928,7 +927,6 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
|
|||
|
||||
swapchain = 0xdeadbeef;
|
||||
vr = create_swapchain(physical_device, surface, device, hwnd, &swapchain);
|
||||
todo_wine
|
||||
ok(vr == VK_ERROR_INITIALIZATION_FAILED /* Nvidia */ || vr == VK_SUCCESS /* AMD */,
|
||||
"Got unexpected vr %d.\n", vr);
|
||||
if (vr == VK_SUCCESS)
|
||||
|
|
|
@ -1570,6 +1570,12 @@ VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCrea
|
|||
VkSurfaceCapabilitiesKHR capabilities;
|
||||
VkResult res;
|
||||
|
||||
if (!NtUserIsWindow(surface->hwnd))
|
||||
{
|
||||
ERR("surface %p, hwnd %p is invalid!\n", surface, surface->hwnd);
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
if (surface) create_info_host.surface = surface->driver_surface;
|
||||
if (old_swapchain) create_info_host.oldSwapchain = old_swapchain->host_swapchain;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue