Commit 6f929659 authored by Andrew John Hughes's avatar Andrew John Hughes Committed by Alexandre Julliard

Extended SetSystemPaletteUse to deal with error conditions.

parent 043680c1
......@@ -1386,10 +1386,11 @@ typedef struct
#define TT_POLYGON_TYPE 24
/* Get/SetSystemPaletteUse() values */
#define SYSPAL_ERROR 0
#define SYSPAL_STATIC 1
#define SYSPAL_NOSTATIC 2
#define SYSPAL_ERROR 0
#define SYSPAL_STATIC 1
#define SYSPAL_NOSTATIC 2
#define SYSPAL_NOSTATIC256 3
#ifndef _PALETTEENTRY_DEFINED
#define _PALETTEENTRY_DEFINED
typedef struct tagPALETTEENTRY
......
......@@ -454,9 +454,21 @@ UINT WINAPI SetSystemPaletteUse(
UINT use) /* [in] Palette-usage flag */
{
UINT old = SystemPaletteUse;
FIXME("(%p,%04x): stub\n", hdc, use );
SystemPaletteUse = use;
return old;
/* Device doesn't support colour palettes */
if (!(GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE)) {
return SYSPAL_ERROR;
}
switch (use) {
case SYSPAL_NOSTATIC:
case SYSPAL_NOSTATIC256: /* WINVER >= 0x0500 */
case SYSPAL_STATIC:
SystemPaletteUse = use;
return old;
default:
return SYSPAL_ERROR;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment