Author: tkreuzer Date: Sun Apr 6 18:20:31 2008 New Revision: 32886
URL: http://svn.reactos.org/svn/reactos?rev=32886&view=rev Log: PatchPatch by Stefan Ginsberg (stefan__100__ AT hotmail DOT com): - remove last traces of my dyslexia also known as GDIOBJ_AllocObjDepricated - fix a typo
Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c trunk/reactos/subsystems/win32/win32k/include/bitmaps.h trunk/reactos/subsystems/win32/win32k/include/brush.h trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/include/pen.h trunk/reactos/subsystems/win32/win32k/include/text.h trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/palobj.c trunk/reactos/subsystems/win32/win32k/objects/region.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -16,8 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: GDI Driver Surace Functions @@ -432,14 +431,16 @@ SURFOBJ *SurfObj; BITMAPOBJ *BitmapObj;
- NewSurface = (HSURF)BITMAPOBJ_AllocBitmapDepricated(); - if (NewSurface == NULL) + BitmapObj = BITMAPOBJ_AllocBitmapWithHandle(); + if (!BitmapObj) + { return 0; - + } + + NewSurface = BitmapObj->BaseObject.hHmgr; GDIOBJ_SetOwnership(NewSurface, NULL);
- BitmapObj = BITMAPOBJ_LockBitmap(NewSurface); - if (! BITMAPOBJ_InitBitsLock(BitmapObj)) + if (!BITMAPOBJ_InitBitsLock(BitmapObj)) { BITMAPOBJ_UnlockBitmap(BitmapObj); BITMAPOBJ_FreeBitmapByHandle(NewSurface);
Modified: trunk/reactos/subsystems/win32/win32k/include/bitmaps.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/bitmaps.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/bitmaps.h [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -28,7 +28,6 @@
#define BITMAPOBJ_AllocBitmap() ((PBITMAPOBJ) GDIOBJ_AllocObj(GDIObjType_SURF_TYPE)) #define BITMAPOBJ_AllocBitmapWithHandle() ((PBITMAPOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP)) -#define BITMAPOBJ_AllocBitmapDepricated() ((HBITMAP) GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_BITMAP)) #define BITMAPOBJ_FreeBitmap(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_SURF_TYPE) #define BITMAPOBJ_FreeBitmapByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
@@ -60,3 +59,4 @@
#endif
+
Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -74,7 +74,6 @@
#define BRUSHOBJ_AllocBrush() ((PGDIBRUSHOBJ) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) #define BRUSHOBJ_AllocBrushWithHandle() ((PGDIBRUSHOBJ) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_BRUSH)) -#define BRUSHOBJ_AllocBrushDepricated() ((HBRUSH) GDIOBJ_AllocObjDepricated (GDI_OBJECT_TYPE_BRUSH)) #define BRUSHOBJ_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE) #define BRUSHOBJ_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) #define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -16,9 +16,9 @@ */ ////////////////////////////////////////////////////////////////////////////// GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT]; - DEVCAPS DevCaps; // Device Capabilities + DEVCAPS DevCaps; // Device Capabilities. FLONG flDeviceUniq; // Device settings uniqueness. - PVOID pvLangPack; // Lanuage Pack. + PVOID pvLangPack; // Language Pack. CFONT cfPublic[GDI_CFONT_MAX]; // Public Fonts. DWORD dwCsbSupported1; // OEM code-page bitfield. ////////////////////////////////////////////////////////////////////////////// @@ -60,7 +60,6 @@ BOOL INTERNAL_CALL GDIOBJ_ValidateHandle(HGDIOBJ hObj, ULONG ObjectType); POBJ INTERNAL_CALL GDIOBJ_AllocObj(UCHAR ObjectType); POBJ INTERNAL_CALL GDIOBJ_AllocObjWithHandle(ULONG ObjectType); -HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDepricated(ULONG ObjectType); VOID INTERNAL_CALL GDIOBJ_FreeObj (POBJ pObj, UCHAR ObjectType); BOOL INTERNAL_CALL GDIOBJ_FreeObjByHandle (HGDIOBJ hObj, DWORD ObjectType); PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType);
Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/pen.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/pen.h [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -8,13 +8,11 @@
#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) #define PENOBJ_AllocPenWithHandle() ((PGDIBRUSHOBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN)) -#define PENOBJ_AllocPenDepricated() ((HPEN)GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_PEN)) #define PENOBJ_FreePen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDI_OBJECT_TYPE_PEN) #define PENOBJ_FreePenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) #define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) #define PENOBJ_AllocExtPen() ((PGDIBRUSHOBJ)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) #define PENOBJ_AllocExtPenWithHandle() ((PGDIBRUSHOBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN)) -#define PENOBJ_AllocExtPenDepricated() ((HPEN)GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_EXTPEN)) #define PENOBJ_FreeExtPen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDI_OBJECT_TYPE_EXTPEN) #define PENOBJ_FreeExtPenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN) #define PENOBJ_LockExtPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN))
Modified: trunk/reactos/subsystems/win32/win32k/include/text.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -70,7 +70,6 @@
#define TEXTOBJ_AllocText() ((PTEXTOBJ) GDIOBJ_AllocObj(GDIObjType_LFONT_TYPE)) #define TEXTOBJ_AllocTextWithHandle() ((PTEXTOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_AllocTextDepricated() ((HFONT) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_FONT)) #define TEXTOBJ_FreeText(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDILoObjType_LO_FONT_TYPE) #define TEXTOBJ_FreeTextByHandle(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) #define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT))
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 [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -2270,20 +2270,20 @@ RtlCopyMemory(Buf, Driver->Buffer, Driver->MaximumLength); }
- hDC = (HDC) GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_DC); - if (hDC == NULL) + NewDC = (PDC)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DC); + if(!NewDC) { if(Buf) { ExFreePool(Buf); } - return NULL; - } + return NULL; + } + + hDC = NewDC->BaseObject.hHmgr;
DC_AllocateDcAttr(hDC);
- NewDC = DC_LockDc(hDC); - /* FIXME - Handle NewDC == NULL! */ if (Driver != NULL) { RtlCopyMemory(&NewDC->DriverName, Driver, sizeof(UNICODE_STRING));
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -569,20 +569,6 @@ return NULL; }
-/* Wrapper for compatibility with old calls, will be removed later */ -HGDIOBJ INTERNAL_CALL -GDIOBJ_AllocObjDepricated(ULONG ObjectType) -{ - POBJ pObject; - HGDIOBJ hObject; - - pObject = GDIOBJ_AllocObjWithHandle(ObjectType); - hObject = pObject->hHmgr; - GDIOBJ_UnlockObjByPtr(pObject); - - return hObject; -} -
VOID INTERNAL_CALL GDIOBJ_FreeObj(POBJ pObject, UCHAR BaseType)
Modified: trunk/reactos/subsystems/win32/win32k/objects/palobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/palobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/palobj.c [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -16,7 +16,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ */
#include <w32k.h>
@@ -52,7 +51,8 @@ return TRUE; }
-HPALETTE FASTCALL +HPALETTE +FASTCALL PALETTE_AllocPalette(ULONG Mode, ULONG NumColors, ULONG *Colors, @@ -63,15 +63,13 @@ HPALETTE NewPalette; PPALGDI PalGDI;
- NewPalette = (HPALETTE) GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_PALETTE); - if (NULL == NewPalette) - { + PalGDI = (PPALGDI)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE); + if (!PalGDI) + { return NULL; - } - - PalGDI = PALETTE_LockPalette(NewPalette); - /* FIXME - PalGDI can be NULL!!! Don't assert here! */ - ASSERT( PalGDI ); + } + + NewPalette = PalGDI->BaseObject.hHmgr;
PalGDI->Self = NewPalette; PalGDI->Mode = Mode; @@ -104,23 +102,22 @@ return NewPalette; }
-HPALETTE FASTCALL +HPALETTE +FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, CONST RGBQUAD *Colors) { HPALETTE NewPalette; PPALGDI PalGDI; - unsigned i; - - NewPalette = (HPALETTE) GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_PALETTE); - if (NULL == NewPalette) - { + UINT i; + + PalGDI = (PPALGDI)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE); + if (!PalGDI) + { return NULL; - } - - PalGDI = PALETTE_LockPalette(NewPalette); - /* FIXME - PalGDI can be NULL!!! Don't assert here! */ - ASSERT( PalGDI ); + } + + NewPalette = PalGDI->BaseObject.hHmgr;
PalGDI->Self = NewPalette; PalGDI->Mode = PAL_INDEXED;
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Sun Apr 6 18:20:31 2008 @@ -113,7 +113,6 @@ * the y-x-banding that's so nice to have... */
-/* $Id$ */ #include <w32k.h>
#define NDEBUG @@ -2018,44 +2017,43 @@ return ret; }
-PROSRGNDATA FASTCALL -REGION_AllocRgnWithHandle(INT n) +PROSRGNDATA +FASTCALL +REGION_AllocRgnWithHandle(INT nReg) { HRGN hReg; PROSRGNDATA pReg; - - if ((hReg = (HRGN) GDIOBJ_AllocObjDepricated(GDI_OBJECT_TYPE_REGION))) - { - if (NULL != (pReg = REGION_LockRgn(hReg))) - { - if (1 == n) - { - /* Testing shows that > 95% of all regions have only 1 rect. - Including that here saves us from having to do another - allocation */ - pReg->Buffer = &pReg->rdh.rcBound; - } - else - { - pReg->Buffer = ExAllocatePoolWithTag(PagedPool, n * sizeof(RECT), TAG_REGION); - } - if (NULL != pReg->Buffer) - { - EMPTY_REGION(pReg); - pReg->rdh.dwSize = sizeof(RGNDATAHEADER); - pReg->rdh.nCount = n; - pReg->rdh.nRgnSize = n*sizeof(RECT); - - return pReg; - } - } - else - { - REGION_FreeRgn(hReg); - } - } - - return NULL; + + pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION); + if(!pReg) + { + return NULL; + } + + hReg = pReg->BaseObject.hHmgr; + + if (nReg == 1) + { + /* Testing shows that > 95% of all regions have only 1 rect. + Including that here saves us from having to do another allocation */ + pReg->Buffer = &pReg->rdh.rcBound; + } + else + { + pReg->Buffer = ExAllocatePoolWithTag(PagedPool, nReg * sizeof(RECT), TAG_REGION); + if (!pReg->Buffer) + { + GDIOBJ_FreeObjByHandle(hReg, GDI_OBJECT_TYPE_REGION); + return NULL; + } + } + + EMPTY_REGION(pReg); + pReg->rdh.dwSize = sizeof(RGNDATAHEADER); + pReg->rdh.nCount = nReg; + pReg->rdh.nRgnSize = nReg * sizeof(RECT); + + return pReg; }
BOOL INTERNAL_CALL