[PATCH] wined3d: Propagate HRESULTs in context creation functions.
Józef Kucia
jkucia at codeweavers.com
Wed May 8 05:04:06 CDT 2019
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 5 +++--
dlls/wined3d/adapter_vk.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 1f4ba793ed85..b08ba62ad037 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -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)
{
struct wined3d_context_gl *context_gl;
+ HRESULT hr;
TRACE("swapchain %p, context %p.\n", swapchain, context);
if (!(context_gl = heap_alloc_zero(sizeof(*context_gl))))
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");
heap_free(context_gl);
- return E_FAIL;
+ return hr;
}
TRACE("Created context %p.\n", context_gl);
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index d39e6514454a..fad78ae5931e 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -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)
{
struct wined3d_context *context_vk;
+ HRESULT hr;
TRACE("swapchain %p, context %p.\n", swapchain, context);
if (!(context_vk = heap_alloc_zero(sizeof(*context_vk))))
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");
heap_free(context_vk);
- return E_FAIL;
+ return hr;
}
TRACE("Created context %p.\n", context_vk);
--
2.21.0
More information about the wine-devel
mailing list