ddraw: Don't allow setting palette on non root surfaces.
This commit is contained in:
parent
1a609ecab8
commit
abf8728e1f
|
@ -4233,6 +4233,11 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir
|
||||||
return DDERR_INVALIDPIXELFORMAT;
|
return DDERR_INVALIDPIXELFORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!This->is_complex_root)
|
||||||
|
{
|
||||||
|
return DDERR_NOTONMIPMAPSUBLEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Find the old palette */
|
/* Find the old palette */
|
||||||
EnterCriticalSection(&ddraw_cs);
|
EnterCriticalSection(&ddraw_cs);
|
||||||
hr = IDirectDrawSurface_GetPalette(iface, &oldPal);
|
hr = IDirectDrawSurface_GetPalette(iface, &oldPal);
|
||||||
|
|
|
@ -3006,7 +3006,7 @@ static void DeviceLoadTest(void)
|
||||||
ok(hr==DDERR_NOPALETTEATTACHED, "IDirectDrawSurface7_GetPalette returned: %x\n", hr);
|
ok(hr==DDERR_NOPALETTEATTACHED, "IDirectDrawSurface7_GetPalette returned: %x\n", hr);
|
||||||
|
|
||||||
hr = IDirectDrawSurface7_SetPalette(texture_levels[0][1], palettes[1]);
|
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]);
|
hr = IDirectDrawSurface7_SetPalette(texture_levels[1][0], palettes[2]);
|
||||||
ok(hr==DD_OK, "IDirectDrawSurface7_SetPalette returned: %x\n", hr);
|
ok(hr==DD_OK, "IDirectDrawSurface7_SetPalette returned: %x\n", hr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue