1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winevulkan: Handle invalid window in vkCreateSwapchainKHR.

This commit is contained in:
Rémi Bernon 2023-11-25 01:44:49 +01:00 committed by Alexandre Julliard
parent 0d969b1764
commit 9a1362695b
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -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;