mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d: Validate signal_event_pfn.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6a32ad8913
commit
ebca1d3396
@ -221,6 +221,11 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance,
|
||||
VkResult vr;
|
||||
HRESULT hr;
|
||||
|
||||
if (!create_info->signal_event_pfn)
|
||||
{
|
||||
ERR("Invalid signal event function pointer.\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
if (!create_info->create_thread_pfn != !create_info->join_thread_pfn)
|
||||
{
|
||||
ERR("Invalid create/join thread function pointers.\n");
|
||||
|
@ -74,9 +74,7 @@ static void test_create_instance(void)
|
||||
ULONG refcount;
|
||||
HRESULT hr;
|
||||
|
||||
memset(&create_info, 0, sizeof(create_info));
|
||||
create_info.wchar_size = sizeof(WCHAR);
|
||||
|
||||
create_info = instance_default_create_info;
|
||||
hr = vkd3d_create_instance(&create_info, &instance);
|
||||
ok(hr == S_OK, "Failed to create instance, hr %#x.\n", hr);
|
||||
refcount = vkd3d_instance_incref(instance);
|
||||
@ -85,11 +83,15 @@ static void test_create_instance(void)
|
||||
refcount = vkd3d_instance_decref(instance);
|
||||
ok(!refcount, "Instance has %u references left.\n", refcount);
|
||||
|
||||
create_info.signal_event_pfn = signal_event;
|
||||
create_info = instance_default_create_info;
|
||||
create_info.wchar_size = 1;
|
||||
hr = vkd3d_create_instance(&create_info, &instance);
|
||||
ok(hr == S_OK, "Failed to create instance, hr %#x.\n", hr);
|
||||
refcount = vkd3d_instance_decref(instance);
|
||||
ok(!refcount, "Instance has %u references left.\n", refcount);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
create_info = instance_default_create_info;
|
||||
create_info.signal_event_pfn = NULL;
|
||||
hr = vkd3d_create_instance(&create_info, &instance);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
}
|
||||
|
||||
static void test_create_device(void)
|
||||
|
Loading…
Reference in New Issue
Block a user