Fix regression in RealizePalette. Send broadcast message if palette was changed.

svn path=/trunk/; revision=31621
This commit is contained in:
James Tabor 2008-01-06 06:57:57 +00:00
parent 6880f63f6f
commit b5c759cceb
7 changed files with 25 additions and 6 deletions

View file

@ -373,7 +373,7 @@ typedef struct _DC
ULONG lucExcLock;
PVOID Tid;
DHPDEV PDev; // GDIDEVICE.hPDev
DHPDEV PDev; // <- GDIDEVICE.hPDev DHPDEV for device.
INT DC_Type;
INT DC_Flags;
PVOID pPDev; // PGDIDEVICE

View file

@ -14,6 +14,6 @@ const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate (VOID);
COLORREF STDCALL COLOR_LookupNearestColor (PALETTEENTRY* palPalEntry, INT size, COLORREF color);
INT STDCALL COLOR_PaletteLookupExactIndex (PALETTEENTRY* palPalEntry, INT size, COLORREF col);
INT STDCALL COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, INT size, XLATEOBJ *XlateObj, COLORREF col, BOOL skipReserved);
UINT STDCALL NtGdiRealizePalette (HDC);
UINT FASTCALL IntGdiRealizePalette (HDC);
#endif /* _WIN32K_COLOR_H */

View file

@ -12,5 +12,6 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL
IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PW32THREAD Thread,
MSG *Message, BOOL Remove);
INT FASTCALL UserRealizePalette(HDC);
#endif /* _WIN32K_PAINTING_H */

View file

@ -477,7 +477,7 @@ NtUserCallOneParam(
RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
case ONEPARAM_ROUTINE_REALIZEPALETTE:
RETURN (NtGdiRealizePalette((HDC) Param));
RETURN (UserRealizePalette((HDC) Param));
}
DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
Routine, Param);

View file

@ -1886,6 +1886,24 @@ cleanup:
return Ret;
}
INT
FASTCALL
UserRealizePalette(HDC hdc)
{
HWND hWnd;
DWORD Ret;
Ret = IntGdiRealizePalette(hdc);
if (Ret) // There was a change.
{
hWnd = IntWindowFromDC(hdc);
if (hWnd) // Send broadcast if dc is associated with a window.
{ // FYI: Thread locked in CallOneParam.
co_IntSendMessage((HWND)HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0);
}
}
return Ret;
}
BOOL
STDCALL

View file

@ -125,7 +125,7 @@ IntAnimatePalette(HPALETTE hPal,
if (dc->w.hPalette == hPal)
{
DC_UnlockDc(dc);
NtGdiRealizePalette(hDC);
IntGdiRealizePalette(hDC);
}
else
DC_UnlockDc(dc);
@ -484,7 +484,7 @@ A logical palette is a buffer between color-intensive applications and the syste
the dc palette.
-- If it is an RGB palette, then an XLATEOBJ is created between the RGB values and the dc palette.
*/
UINT STDCALL NtGdiRealizePalette(HDC hDC)
UINT FASTCALL IntGdiRealizePalette(HDC hDC)
{
/*
* This function doesn't do any real work now and there's plenty

View file

@ -805,7 +805,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
NewDC->IsIC = CreateAsIC;
NewDC->PDev = PrimarySurface.hPDev;
if(pUMdhpdev) pUMdhpdev = NewDC->PDev;
if(pUMdhpdev) pUMdhpdev = NewDC->PDev; // set DHPDEV for device.
NewDC->pPDev = (PVOID)&PrimarySurface;
NewDC->w.hBitmap = (HBITMAP)PrimarySurface.pSurface;