Spot the deliberate mistake : IntGdiSetRegeionOwner
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: 21 January 2010 01:39 To: [email protected] Subject: [ros-diffs] [jimtabor] 45170: [Win32k] - Implement IntGdiSetBrushOwner for bug 5124. Author: jimtabor Date: Thu Jan 21 02:39:19 2010 New Revision: 45170 URL: http://svn.reactos.org/svn/reactos?rev=45170&view=rev Log: [Win32k] - Implement IntGdiSetBrushOwner for bug 5124. Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/brush.h?rev=45170&r1=45169&r2=45170&view=diff ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] Thu Jan 21 02:39:19 2010 @@ -132,4 +132,6 @@ VOID FASTCALL FreeObjectAttr(PVOID); +BOOL FASTCALL IntGdiSetBrushOwner(PBRUSH,DWORD); + #endif Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/gdiobj.h?rev=45170&r1=45169&r2=45170&view=diff ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] Thu Jan 21 02:39:19 2010 @@ -82,9 +82,10 @@ #define GDIOBJFLAG_IGNOREPID (0x1) #define GDIOBJFLAG_IGNORELOCK (0x2) -BOOL FASTCALL GreDeleteObject(HGDIOBJ hObject); -BOOL FASTCALL IsObjectDead(HGDIOBJ); -BOOL FASTCALL IntGdiSetDCOwnerEx( HDC, DWORD, BOOL); +BOOL FASTCALL GreDeleteObject(HGDIOBJ hObject); +BOOL FASTCALL IsObjectDead(HGDIOBJ); +BOOL FASTCALL IntGdiSetDCOwnerEx( HDC, DWORD, BOOL); +BOOL FASTCALL IntGdiSetRegeionOwner(HRGN,DWORD); /*! * Release GDI object. Every object locked by GDIOBJ_LockObj() must be unlocked. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c?rev=45170&r1=45169&r2=45170&view=diff ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Thu Jan 21 02:39:19 2010 @@ -195,8 +195,7 @@ Monitor->rcMonitor.right, Monitor->rcMonitor.bottom ); - // Replace with IntGdiSetRegeionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); - GDIOBJ_SetOwnership(Monitor->hrgnMonitor, NULL); + IntGdiSetRegeionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); if (gMonitorList == NULL) { Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c?rev=45170&r1=45169&r2=45170&view=diff ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Thu Jan 21 02:39:19 2010 @@ -1562,6 +1562,36 @@ BOOL FASTCALL +IntGdiSetRegeionOwner(HRGN hRgn, DWORD OwnerMask) +{ + INT Index; + PGDI_TABLE_ENTRY Entry; +/* + System Regions: + These regions do not use attribute sections and when allocated, use gdiobj + level functions. + */ + // FIXME! HAX!!! Remove this once we get everything right! + KeEnterCriticalRegion(); + Index = GDI_HANDLE_GET_INDEX(hRgn); + Entry = &GdiHandleTable->Entries[Index]; + if (Entry->UserData) FreeObjectAttr(Entry->UserData); + Entry->UserData = NULL; + KeLeaveCriticalRegion(); + // + if ((OwnerMask == GDI_OBJ_HMGR_PUBLIC) || OwnerMask == GDI_OBJ_HMGR_NONE) + { + return GDIOBJ_SetOwnership(hRgn, NULL); + } + if (OwnerMask == GDI_OBJ_HMGR_POWNED) + { + return GDIOBJ_SetOwnership((HGDIOBJ) hRgn, PsGetCurrentProcess() ); + } + return FALSE; +} + +BOOL +FASTCALL IntGdiSetBrushOwner(PBRUSH pbr, DWORD OwnerMask) { HBRUSH hBR; @@ -1608,7 +1638,6 @@ } return TRUE; } - BOOL FASTCALL @@ -1672,7 +1701,6 @@ } return Ret; } - W32KAPI HANDLE _______________________________________________ Ros-dev mailing list [email protected] http://www.reactos.org/mailman/listinfo/ros-dev
