Author: jimtabor Date: Sun Jan 6 09:57:57 2008 New Revision: 31621
URL: http://svn.reactos.org/svn/reactos?rev=31621&view=rev Log: Fix regression in RealizePalette. Send broadcast message if palette was changed.
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/subsystems/win32/win32k/include/color.h trunk/reactos/subsystems/win32/win32k/include/painting.h trunk/reactos/subsystems/win32/win32k/ntuser/misc.c trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/objects/color.c trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Sun Jan 6 09:57:57 2008 @@ -373,7 +373,7 @@ ULONG lucExcLock; PVOID Tid;
- DHPDEV PDev; // GDIDEVICE.hPDev + DHPDEV PDev; // <- GDIDEVICE.hPDev DHPDEV for device. INT DC_Type; INT DC_Flags; PVOID pPDev; // PGDIDEVICE
Modified: trunk/reactos/subsystems/win32/win32k/include/color.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/color.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/color.h Sun Jan 6 09:57:57 2008 @@ -14,6 +14,6 @@ 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 */
Modified: trunk/reactos/subsystems/win32/win32k/include/painting.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/painting.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/painting.h Sun Jan 6 09:57:57 2008 @@ -12,5 +12,6 @@ BOOL FASTCALL IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PW32THREAD Thread, MSG *Message, BOOL Remove); +INT FASTCALL UserRealizePalette(HDC);
#endif /* _WIN32K_PAINTING_H */
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Sun Jan 6 09:57:57 2008 @@ -477,7 +477,7 @@ 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);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Sun Jan 6 09:57:57 2008 @@ -1886,6 +1886,24 @@ 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
Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/color.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c Sun Jan 6 09:57:57 2008 @@ -125,7 +125,7 @@ if (dc->w.hPalette == hPal) { DC_UnlockDc(dc); - NtGdiRealizePalette(hDC); + IntGdiRealizePalette(hDC); } else DC_UnlockDc(dc); @@ -484,7 +484,7 @@ 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
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sun Jan 6 09:57:57 2008 @@ -805,7 +805,7 @@ 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;