IDirectDrawSurface::GetPalette

HRESULT GetPalette(

LPDIRECTDRAWPALETTE FAR * lplpDDPalette);

Returns the DirectDrawPalette structure associated with this surface.

·Returns DD_OK if successful, or one of the following error values otherwise:

DDERR_GENERIC DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS DDERR_NOEXCLUSIVEMODE

DDERR_NOPALETTEATTACHED DDERR_SURFACELOST

DDERR_UNSUPPORTED

lplpDDPalette

Address of a pointer to a DirectDrawPalette structure. This pointer will be filled in with the address of the DirectDrawPalette structure associated with this surface. This will be set to NULL if no DirectDrawPalette is associated with this surface.

If no palette has been explicitly associated with this surface, it returns NULL for the associated palette. However, if this is the primary surface or a back buffer to the primary surface, it returns a pointer to the system palette if the primary surface is in 8-bpp mode.