Commit ad5a448d authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Propagate HRESULTs in context creation functions.

parent 08d630e2
...@@ -4277,17 +4277,18 @@ static void adapter_gl_destroy_device(struct wined3d_device *device) ...@@ -4277,17 +4277,18 @@ static void adapter_gl_destroy_device(struct wined3d_device *device)
static HRESULT adapter_gl_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context) static HRESULT adapter_gl_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context)
{ {
struct wined3d_context_gl *context_gl; struct wined3d_context_gl *context_gl;
HRESULT hr;
TRACE("swapchain %p, context %p.\n", swapchain, context); TRACE("swapchain %p, context %p.\n", swapchain, context);
if (!(context_gl = heap_alloc_zero(sizeof(*context_gl)))) if (!(context_gl = heap_alloc_zero(sizeof(*context_gl))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (FAILED(wined3d_context_gl_init(context_gl, swapchain))) if (FAILED(hr = wined3d_context_gl_init(context_gl, swapchain)))
{ {
WARN("Failed to initialise context.\n"); WARN("Failed to initialise context.\n");
heap_free(context_gl); heap_free(context_gl);
return E_FAIL; return hr;
} }
TRACE("Created context %p.\n", context_gl); TRACE("Created context %p.\n", context_gl);
......
...@@ -291,17 +291,18 @@ static void adapter_vk_destroy_device(struct wined3d_device *device) ...@@ -291,17 +291,18 @@ static void adapter_vk_destroy_device(struct wined3d_device *device)
static HRESULT adapter_vk_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context) static HRESULT adapter_vk_create_context(struct wined3d_swapchain *swapchain, struct wined3d_context **context)
{ {
struct wined3d_context *context_vk; struct wined3d_context *context_vk;
HRESULT hr;
TRACE("swapchain %p, context %p.\n", swapchain, context); TRACE("swapchain %p, context %p.\n", swapchain, context);
if (!(context_vk = heap_alloc_zero(sizeof(*context_vk)))) if (!(context_vk = heap_alloc_zero(sizeof(*context_vk))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (FAILED(wined3d_context_vk_init(context_vk, swapchain))) if (FAILED(hr = wined3d_context_vk_init(context_vk, swapchain)))
{ {
WARN("Failed to initialise context.\n"); WARN("Failed to initialise context.\n");
heap_free(context_vk); heap_free(context_vk);
return E_FAIL; return hr;
} }
TRACE("Created context %p.\n", context_vk); TRACE("Created context %p.\n", context_vk);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment