mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
libs/vkd3d: Return S_FALSE from D3D12CreateDevice() when device is NULL.
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
72859f8898
commit
9ce53b74df
@ -28,7 +28,7 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||
|
||||
TRACE("create_info %p, iid %s, device %p.\n", create_info, debugstr_guid(iid), device);
|
||||
|
||||
if (!create_info || !device)
|
||||
if (!create_info)
|
||||
return E_INVALIDARG;
|
||||
if (create_info->type != VKD3D_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
|
||||
{
|
||||
@ -76,6 +76,12 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (!device)
|
||||
{
|
||||
ID3D12Device_Release(&object->ID3D12Device_iface);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
return return_interface((IUnknown *)&object->ID3D12Device_iface, &IID_ID3D12Device,
|
||||
iid, device);
|
||||
}
|
||||
|
@ -1080,6 +1080,9 @@ static void test_create_device(void)
|
||||
ok(hr == S_OK, "Failed to create device, hr %#x.\n", hr);
|
||||
ID3D12Device_Release(device);
|
||||
|
||||
hr = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, NULL);
|
||||
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_9_1, &IID_ID3D12Device, (void **)&device);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
hr = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_9_2, &IID_ID3D12Device, (void **)&device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user