From abf8728e1f2f966650eaa5528a1f593a6e1986bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ri=C4=8Dardas=20Barkauskas?= Date: Mon, 8 Aug 2011 01:26:00 +0300 Subject: [PATCH] ddraw: Don't allow setting palette on non root surfaces. --- dlls/ddraw/surface.c | 5 +++++ dlls/ddraw/tests/d3d.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 2b06cb97efe..c6ae89b91fb 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -4233,6 +4233,11 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir return DDERR_INVALIDPIXELFORMAT; } + if (!This->is_complex_root) + { + return DDERR_NOTONMIPMAPSUBLEVEL; + } + /* Find the old palette */ EnterCriticalSection(&ddraw_cs); hr = IDirectDrawSurface_GetPalette(iface, &oldPal); diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 2197c64090f..685ed45afac 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -3006,7 +3006,7 @@ static void DeviceLoadTest(void) ok(hr==DDERR_NOPALETTEATTACHED, "IDirectDrawSurface7_GetPalette returned: %x\n", hr); hr = IDirectDrawSurface7_SetPalette(texture_levels[0][1], palettes[1]); - todo_wine ok(hr==DDERR_NOTONMIPMAPSUBLEVEL, "IDirectDrawSurface7_SetPalette returned: %x\n", hr); + ok(hr==DDERR_NOTONMIPMAPSUBLEVEL, "IDirectDrawSurface7_SetPalette returned: %x\n", hr); hr = IDirectDrawSurface7_SetPalette(texture_levels[1][0], palettes[2]); ok(hr==DD_OK, "IDirectDrawSurface7_SetPalette returned: %x\n", hr); -- 2.11.4.GIT