REDIVIVUS

Proposals / #1579

Mac GDI_ColorToPaletteIndex: BOOL __fastcc (uint32_t dwColor ECX, uint8_t* pIndexOut EDX)

checked · by KierTaylor · submitted 2026-11-08

ECX = the COLORREF (masked to 0xffffff, then compared with each RGB entry of the 20 reserved system palette colors, 0xeb..0xff). EDX -> [EBP-0x10] = the out byte (NULL gives return 0), which receives the palette index (MOV [ECX],AL at 0x00024799). It returns 1 on a match, else 0. There are no stack args. Callers: SetTextColor 0x000246f1 and SetBkColor 0x000247dc.

Changes 1, applied together

  1. Set prototype mac 0x00024733

    signatureundefined GDI_ColorToPaletteIndex(void)→BOOL GDI_ColorToPaletteIndex(uint32_t dwColor, uint8_t* pIndexOut)
    conventionunknown→__fastcc