From d8582b6bd23cfdfc340fdd1a4c497271b8ce59f8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Feb 2008 01:00:34 +0000 Subject: [PATCH] - add BASEOBJECT to brush, palette, font and region structures- fix debug output svn path=/trunk/; revision=32485 --- .../subsystems/win32/win32k/include/brush.h | 7 +++--- reactos/subsystems/win32/win32k/include/dc.h | 2 ++ .../subsystems/win32/win32k/include/palette.h | 15 +++++++------ .../subsystems/win32/win32k/include/region.h | 22 +++++++++++-------- .../subsystems/win32/win32k/include/text.h | 8 +++++-- .../subsystems/win32/win32k/objects/gdiobj.c | 2 +- 6 files changed, 33 insertions(+), 23 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/brush.h b/reactos/subsystems/win32/win32k/include/brush.h index 96748e8f718..3b7d75e56b2 100644 --- a/reactos/subsystems/win32/win32k/include/brush.h +++ b/reactos/subsystems/win32/win32k/include/brush.h @@ -23,10 +23,9 @@ typedef struct typedef struct { -// HGDIOBJ hHmgr; -// PVOID pvEntry; -// ULONG lucExcLock; -// ULONG Tid; + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ + BASEOBJECT BaseObject; ULONG ulStyle; HBITMAP hbmPattern; diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index f03db763afb..95a4352c43b 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -35,6 +35,8 @@ /* The DC object structure */ typedef struct _DC { + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ BASEOBJECT BaseObject; DHPDEV PDev; // <- GDIDEVICE.hPDev DHPDEV for device. diff --git a/reactos/subsystems/win32/win32k/include/palette.h b/reactos/subsystems/win32/win32k/include/palette.h index 3bbfeb2a727..42ab5e1bf18 100644 --- a/reactos/subsystems/win32/win32k/include/palette.h +++ b/reactos/subsystems/win32/win32k/include/palette.h @@ -31,17 +31,18 @@ #define PAL_RGB16_565 0x00400000 // 16-bit RGB in 565 format #define PAL_GAMMACORRECTION 0x00800000 // Correct colors -typedef struct { +typedef struct +{ int shift; int scale; int max; } ColorShifts; -typedef struct _PALGDI { -// HGDIOBJ hHmgr; -// PVOID pvEntry; -// ULONG lucExcLock; -// ULONG Tid; +typedef struct _PALGDI +{ + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ + BASEOBJECT BaseObject; PALOBJ PalObj; XLATEOBJ *logicalToSystem; @@ -79,4 +80,4 @@ INT FASTCALL PALETTE_GetObject(PPALGDI pGdiObject, INT cbCount, LPLOGBRUSH lpBuf PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID); -#endif /* _WIN32K_PALETTE_H */ +#endif /* not _WIN32K_PALETTE_H */ diff --git a/reactos/subsystems/win32/win32k/include/region.h b/reactos/subsystems/win32/win32k/include/region.h index 7439720993a..6e6b322440b 100644 --- a/reactos/subsystems/win32/win32k/include/region.h +++ b/reactos/subsystems/win32/win32k/include/region.h @@ -4,26 +4,30 @@ #include "gdiobj.h" -/* Internal region data. Can't use RGNDATA structure because buffer is allocated statically */ -typedef struct _ROSRGNDATA { -// HGDIOBJ hHmgr; -// PVOID pvEntry; -// ULONG lucExcLock; -// ULONG Tid; +/* Type definitions ***********************************************************/ + +/* Internal region data. + Can't use RGNDATA structure because buffer is allocated statically */ +typedef struct _ROSRGNDATA +{ + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ + BASEOBJECT BaseObject; RGNDATAHEADER rdh; PRECT Buffer; } ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA; +/* Functions ******************************************************************/ + #define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) #define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) #define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pRgn) + HRGN FASTCALL RGNDATA_AllocRgn(INT n); BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody); - BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN ); HRGN FASTCALL GdiCreatePolyPolygonRgn(CONST PPOINT, CONST PINT, INT, INT ); -#endif - +#endif /* not __WIN32K_REGION_H */ diff --git a/reactos/subsystems/win32/win32k/include/text.h b/reactos/subsystems/win32/win32k/include/text.h index 31b7c4f77cb..acd7e77d599 100644 --- a/reactos/subsystems/win32/win32k/include/text.h +++ b/reactos/subsystems/win32/win32k/include/text.h @@ -20,7 +20,7 @@ #define TO_SYS_PARTITION 0x1000 // // Extended STROBJ -// +// typedef struct _STRGDI { STROBJ StrObj; // Text string object header. @@ -51,12 +51,16 @@ typedef struct _STRGDI INT cDefGlyphs; INT cNumFaceNameGlyphs; PVOID pacFaceNameGlyphs; - ULONG acFaceNameGlyphs[8]; + ULONG acFaceNameGlyphs[8]; } STRGDI, *PSTRGDI; /* GDI logical font object */ typedef struct { + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ + BASEOBJECT BaseObject; + ENUMLOGFONTEXDVW logfont; //LOGFONTW logfont; FONTOBJ *Font; BOOLEAN Initialized; /* Don't reinitialize for each DC */ diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 070b2f9e3e0..ebe50d81080 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -311,7 +311,7 @@ CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture) static void FASTCALL LockErrorDebugOutput(HGDIOBJ hObj, PGDI_TABLE_ENTRY Entry, LPSTR Function) { - if (Entry->KernelData == NULL) + if ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == 0) { DPRINT1("%s: Attempted to lock object 0x%x that is deleted!\n", Function, hObj); }