Author: tkreuzer
Date: Thu Sep 6 05:04:18 2007
New Revision: 28891
URL:
http://svn.reactos.org/svn/reactos?rev=28891&view=rev
Log:
- cleanup EXTPENS and PENS in BRUSH_Cleanup, remove EXTPEN_Cleanup
- add new new ObjectTypeInfo structure. It's unused atm, but it will be soon.
Modified:
trunk/reactos/subsystems/win32/win32k/include/pen.h
trunk/reactos/subsystems/win32/win32k/objects/brush.c
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
trunk/reactos/subsystems/win32/win32k/objects/pen.c
Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/pen.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/pen.h Thu Sep 6 05:04:18 2007
@@ -15,6 +15,5 @@
#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPenObj)
INT STDCALL PEN_GetObject(PGDIBRUSHOBJ hPen, INT Count, PLOGPEN Buffer);
-BOOL INTERNAL_CALL EXTPEN_Cleanup(PVOID ObjectBody);
#endif
Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Thu Sep 6 05:04:18 2007
@@ -44,6 +44,12 @@
ASSERT(pBrush->hbmPattern);
GDIOBJ_SetOwnership(GdiHandleTable, pBrush->hbmPattern, PsGetCurrentProcess());
NtGdiDeleteObject(pBrush->hbmPattern);
+ }
+
+ /* Free the kmode styles array of EXTPENS */
+ if (pBrush->pStyle)
+ {
+ ExFreePool(pBrush->pStyle);
}
return TRUE;
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Thu Sep 6 05:04:18 2007
@@ -75,11 +75,11 @@
{GDI_OBJECT_TYPE_DC, sizeof(DC), DC_Cleanup},
{GDI_OBJECT_TYPE_PALETTE, sizeof(PALGDI), PALETTE_Cleanup},
{GDI_OBJECT_TYPE_BRUSH, sizeof(GDIBRUSHOBJ), BRUSH_Cleanup},
- {GDI_OBJECT_TYPE_PEN, sizeof(GDIBRUSHOBJ), GDI_CleanupDummy},
+ {GDI_OBJECT_TYPE_PEN, sizeof(GDIBRUSHOBJ), BRUSH_Cleanup},
{GDI_OBJECT_TYPE_FONT, sizeof(TEXTOBJ), GDI_CleanupDummy},
{GDI_OBJECT_TYPE_DIRECTDRAW, sizeof(DD_DIRECTDRAW), DD_Cleanup},
{GDI_OBJECT_TYPE_DD_SURFACE, sizeof(DD_SURFACE), DDSURF_Cleanup},
- {GDI_OBJECT_TYPE_EXTPEN, sizeof(GDIBRUSHOBJ), EXTPEN_Cleanup},
+ {GDI_OBJECT_TYPE_EXTPEN, sizeof(GDIBRUSHOBJ), BRUSH_Cleanup},
/* FIXME do not use normal DC struct for this */
{GDI_OBJECT_TYPE_METADC, sizeof(DC), GDI_CleanupDummy},
{GDI_OBJECT_TYPE_METAFILE, sizeof(DC), GDI_CleanupDummy},
@@ -88,6 +88,51 @@
};
#define OBJTYPE_COUNT (sizeof(ObjInfo) / sizeof(ObjInfo[0]))
+
+typedef struct
+{
+ BOOL bUseLookaside;
+ ULONG_PTR ulBodySize;
+ ULONG Tag;
+ GDICLEANUPPROC CleanupProc;
+} OBJ_TYPE_INFO, *POBJ_TYPE_INFO;
+
+static const
+OBJ_TYPE_INFO ObjTypeInfo[] =
+{
+ {0, 0, 0, NULL}, /* 00 reserved
entry */
+ {1, sizeof(DC), GDI_OBJECT_TAG_DC, DC_Cleanup}, /* 01 DC */
+ {1, sizeof(DD_DIRECTDRAW), GDI_OBJECT_TAG_DDRAW, DD_Cleanup}, /* 02 DD_DDRAW,
should be moved away from gdi objects */
+ {1, sizeof(DD_SURFACE), GDI_OBJECT_TAG_DDSURF, DDSURF_Cleanup}, /* 03
DD_SURFACE, should be moved away from gdi objects */
+ {1, sizeof(ROSRGNDATA), GDI_OBJECT_TAG_REGION, RGNDATA_Cleanup}, /* 04 REGION */
+ {1, sizeof(BITMAPOBJ), GDI_OBJECT_TAG_BITMAP, BITMAP_Cleanup}, /* 05 BITMAP */
+ {0, sizeof(DC), GDI_OBJECT_TAG_CLIOBJ, GDI_CleanupDummy}, /* 06 CLIOBJ:
METADC,... FIXME: don't use DC struct */
+ {0, 0, GDI_OBJECT_TAG_PATH, NULL}, /* 07 PATH,
unused */
+ {1, sizeof(PALGDI), GDI_OBJECT_TAG_PALETTE, PALETTE_Cleanup}, /* 08 PALETTE
*/
+ {0, 0, GDI_OBJECT_TAG_COLSPC, NULL}, /* 09
COLORSPACE, unused */
+ {1, sizeof(TEXTOBJ), GDI_OBJECT_TAG_FONT, GDI_CleanupDummy}, /* 0a FONT */
+ {0, 0, 0, NULL}, /* 0b RFONT,
unused */
+ {0, 0, 0, NULL}, /* 0c PFE,
unused */
+ {0, 0, 0, NULL}, /* 0d PFT,
unused */
+ {0, 0, 0, NULL}, /* 0e ICMCXF,
unused */
+ {0, 0, 0, NULL}, /* 0f ICMDLL,
unused */
+ {1, sizeof(GDIBRUSHOBJ), GDI_OBJECT_TAG_BRUSH, BRUSH_Cleanup}, /* 10 BRUSH,
PEN, EXTPEN */
+ {0, 0, 0, NULL}, /* 11
D3D_HANDLE, unused */
+ {0, 0, 0, NULL}, /* 12 DD_VPORT,
unused */
+ {0, 0, 0, NULL}, /* 13 SPACE,
unused */
+ {0, 0, 0, NULL}, /* 14 DD_MOTION,
unused */
+ {0, 0, 0, NULL}, /* 15 META,
unused */
+ {0, 0, 0, NULL}, /* 16 ENUMFONT,
unused */
+ {0, 0, 0, NULL}, /* 18 VTFD,
unused */
+ {0, 0, 0, NULL}, /* 19 TTFD,
unused */
+ {0, 0, 0, NULL}, /* 1a RC, unused
*/
+ {0, 0, 0, NULL}, /* 1b TEMP,
unused */
+ {0, 0, 0, NULL}, /* 1c DRVOBJ,
unused */
+ {0, 0, 0, NULL}, /* 1d DCIOBJ,
unused */
+ {0, 0, 0, NULL}, /* 1e SPOOL,
unused */
+};
+
+#define BASE_OBJTYPE_COUNT (sizeof(ObjTypeInfo) / sizeof(ObjTypeInfo[0]))
static LARGE_INTEGER ShortDelay;
Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/pen.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/pen.c Thu Sep 6 05:04:18 2007
@@ -201,19 +201,6 @@
return cbRetCount;
}
-BOOL INTERNAL_CALL
-EXTPEN_Cleanup(PVOID ObjectBody)
-{
- PGDIBRUSHOBJ pPenObject = (PGDIBRUSHOBJ)ObjectBody;
-
- /* Free the kmode Styles array */
- if (pPenObject->pStyle)
- {
- ExFreePool(pPenObject->pStyle);
- }
- return TRUE;
-}
-
/* PUBLIC FUNCTIONS ***********************************************************/
HPEN STDCALL