From 6d1ba98f5b45e96335a17f0dedbedbd5ffdb673f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 5 Feb 2010 11:54:51 +0100 Subject: [PATCH] ddraw/tests: Fix a test that fails on Win2k. --- dlls/ddraw/tests/ddrawmodes.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index c584684b072..aa727318b71 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -665,9 +665,10 @@ static void testddraw7(void) { dddi2Bytes = FIELD_OFFSET(DDDEVICEIDENTIFIER2, dwWHQLLevel) + sizeof(DWORD); - pdddi2 = HeapAlloc( GetProcessHeap(), 0, dddi2Bytes + sizeof(DWORD) ); + pdddi2 = HeapAlloc( GetProcessHeap(), 0, dddi2Bytes + 2*sizeof(DWORD) ); pend = (DWORD *)((char *)pdddi2 + dddi2Bytes); - *pend = 0xdeadbeef; + pend[0] = 0xdeadbeef; + pend[1] = 0xdeadbeef; hr = IDirectDraw7_GetDeviceIdentifier(dd7, pdddi2, 0); ok(hr==DD_OK, "get device identifier failed with %08x\n", hr); @@ -678,7 +679,9 @@ static void testddraw7(void) ok(pdddi2->szDriver[MAX_DDDEVICEID_STRING - 1]==0, "szDriver not cleared\n"); ok(pdddi2->szDescription[MAX_DDDEVICEID_STRING - 1]==0, "szDescription not cleared\n"); /* verify that 8 byte structure size alignment will not overwrite memory */ - ok(*pend==0xdeadbeef, "memory beyond DDDEVICEIDENTIFIER2 overwritten\n"); + ok(pend[0]==0xdeadbeef || broken(pend[0] != 0xdeadbeef), /* win2k */ + "memory beyond DDDEVICEIDENTIFIER2 overwritten\n"); + ok(pend[1]==0xdeadbeef, "memory beyond DDDEVICEIDENTIFIER2 overwritten\n"); } IDirectDraw_Release(dd7);