From: Alex Henrie Subject: [PATCH 3/7] ddraw: Fix IDirectDraw_CreateSurface's invalid descriptor error code. Message-Id: <20170215065349.8863-3-alexhenrie24@gmail.com> Date: Tue, 14 Feb 2017 23:53:45 -0700 In-Reply-To: <20170215065349.8863-1-alexhenrie24@gmail.com> References: <20170215065349.8863-1-alexhenrie24@gmail.com> Signed-off-by: Alex Henrie --- dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/tests/ddraw1.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 254dae70eb..0ca9ba9225 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -3000,7 +3000,7 @@ static HRESULT WINAPI ddraw1_CreateSurface(IDirectDraw *iface, { WARN("Application supplied invalid surface descriptor\n"); wined3d_mutex_unlock(); - return DDERR_INVALIDPARAMS; + return E_INVALIDARG; } if ((surface_desc->ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_BACKBUFFER)) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 278b9c6006..7ab1a09547 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -1978,6 +1978,11 @@ static void test_surface_qi(void) } IDirect3DDevice_Release(device); + surface = (IDirectDrawSurface *)0xdeadbeef; + hr = IDirectDraw_CreateSurface(ddraw, NULL, &surface, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(surface == (IDirectDrawSurface *)0xdeadbeef, "Got unexpected surface %p\n", surface); + memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; -- 2.11.1