From 438d0fed865b9e55dad0efa4dd98dc0afafe80a5 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Thu, 16 Feb 2017 15:12:14 +0100 Subject: [PATCH] ddraw/tests: Validate the "surface" pointer is unmodified after CreateSurface() without cooperative level. Signed-off-by: Henri Verbeet Signed-off-by: Alex Henrie Signed-off-by: Alexandre Julliard --- dlls/ddraw/tests/ddraw1.c | 2 ++ dlls/ddraw/tests/ddraw2.c | 2 ++ dlls/ddraw/tests/ddraw4.c | 2 ++ dlls/ddraw/tests/ddraw7.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index c682466026a..1001d4f299f 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3296,8 +3296,10 @@ static void test_coop_level_surf_create(void) ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + surface = (void *)0xdeadbeef; hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); IDirectDraw_Release(ddraw); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index d6491ea440a..1836f76d55c 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -3517,8 +3517,10 @@ static void test_coop_level_surf_create(void) ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + surface = (void *)0xdeadbeef; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); IDirectDraw2_Release(ddraw); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index bda2ebfa544..557854a99ef 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -3647,8 +3647,10 @@ static void test_coop_level_surf_create(void) ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + surface = (void *)0xdeadbeef; hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); IDirectDraw4_Release(ddraw); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 31e76403f9c..827496b84ba 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -3373,8 +3373,10 @@ static void test_coop_level_surf_create(void) ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + surface = (void *)0xdeadbeef; hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOCOOPERATIVELEVELSET, "Surface creation returned hr %#x.\n", hr); + ok(surface == (void *)0xdeadbeef, "Got unexpected surface %p.\n", surface); IDirectDraw7_Release(ddraw); }