Module: wine Branch: master Commit: abf8728e1f2f966650eaa5528a1f593a6e1986bb URL: http://source.winehq.org/git/wine.git/?a=commit;h=abf8728e1f2f966650eaa5528a...
Author: Ričardas Barkauskas rbarkauskas@codeweavers.com Date: Mon Aug 8 01:26:00 2011 +0300
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 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 2b06cb9..c6ae89b 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 2197c64..685ed45 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);