GreQueryPaletteRealization

GreQueryPaletteRealization returns the mapping from the logical palette in the device context to the HW palette as an array of ULONGs. This is done by logically type-casting the index in the hardware palette to a ULONG. GreQueryPaletteRealization gives applications the ability to predict the outcome of color mixing operations.

This function can be hooked by the presentation driver.


 * Simulation support: This function is simulated by a handling routine in Revision 2.0 (or later) of the graphics engine.

Syntax
GreQueryPaletteRealization(hdc, ulStart, cclr, pclr, pInstance, lFunction);

Parameters

 * hdc (HDC) - input
 * Device context handle.


 * ulStart (ULONG) - input
 * Starting index, first palette entry to query.


 * cclr (ULONG) - input
 * Count of palette entries.


 * pclr (PULONG) - input
 * Pointer to an array of ULONGs.


 * pInstance (PVOID) - input
 * Pointer to instance data.


 * lFunction (ULONG) - input
 * HHigh-order WORD=flags; low-order WORD=NGreQueryPaletteRealization.

Returns

 * rc (ULONG) - returns
 * Return codes.


 * This function returns the count of the palette entries.


 * Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:


 * PMERR_INV_DC

Sample

 * 1) define INCL_GRE_PALETTE
 * 2) include 

HDC      hdc;        /*  Device context handle. */ ULONG    ulStart;    /*  Starting index, first palette entry to query. */ ULONG    cclr;       /*  Count of palette entries. */ PULONG   pclr;       /*  Pointer to an array of ULONGs. */ PVOID    pInstance;  /*  Pointer to instance data. */ ULONG    lFunction;  /*  HHigh-order WORD=flags; low-order WORD=NGreQueryPaletteRealization. */ ULONG    rc;         /*  Return codes. */

rc = GreQueryPaletteRealization(hdc, ulStart,      cclr, pclr, pInstance, lFunction);