The function vkCreateWin32SurfaceKHR takes a VkWin32SurfaceCreateInfoKHR structure. When that structure’s hwnd field is not 0, but is not a valid window handle, vkCreateWin32SurfaceKHR will return VK_SUCCESS. Passing an invalid hwnd will result in some functions returning an VK_ERROR_SURFACE_LOST_KHR error when called using the surface created with an invalid hwnd.
While this is clearly an issue with the application’s code, and not so much an implementation bug, the driver clearly can tell that there’s something wrong with the window handle but instead of giving an error during the surface creation, it succeeds and fails when you try to use the surface.
Would it be possible to make vkCreateWin32SurfaceKHR fail if the window handle is not valid?