Author: jimtabor Date: Mon Nov 3 02:39:08 2008 New Revision: 37163
URL: http://svn.reactos.org/svn/reactos?rev=37163&view=rev Log: - Cleanup UnrealizeObject and set dvNumAxes in CreateFontIndirect.
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/font.c trunk/reactos/subsystems/win32/win32k/objects/color.c
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs.... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -546,7 +546,19 @@ UnrealizeObject(HGDIOBJ hgdiobj) { BOOL retValue = TRUE; - +/* + Win 2k Graphics API, Black Book. by coriolis.com + Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm) + and Windows 2000(tm). + + Step 5. UnrealizeObject(hTrackBrush); + */ +/* + msdn.microsoft.com, + "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing, + and the function returns TRUE. Use SetBrushOrgEx to set the origin of + a brush." + */ if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH) { retValue = NtGdiUnrealizeObject(hgdiobj);
Modified: trunk/reactos/dll/win32/gdi32/objects/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fon... ============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -1355,6 +1355,8 @@ RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfScript, sizeof(Logfont.elfEnumLogfontEx.elfScript));
+ Logfont.elfDesignVector.dvNumAxes = 0; // No more than MM_MAX_NUMAXES + RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
return CreateFontIndirectExW(&Logfont);
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 [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -685,52 +685,27 @@ return old; }
-/* - Win 2k Graphics API, Black Book. by coriolis.com - Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm) - and Windows 2000(tm). - - Step 5. UnrealizeObject(hTrackBrush); - */ -BOOL STDCALL +BOOL +STDCALL NtGdiUnrealizeObject(HGDIOBJ hgdiobj) { - - POBJ pObject; - DWORD objectType; BOOL Ret = FALSE; - - /* From Wine: UnrealizeObject does not SetLastError() on a null object */ - if(!hgdiobj) - return Ret; - - pObject = GDIOBJ_LockObj(hgdiobj, GDI_OBJECT_TYPE_DONTCARE); - if (pObject == NULL) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); + PPALGDI palGDI; + + if ( !hgdiobj || + ((UINT)hgdiobj & GDI_HANDLE_STOCK_MASK) || + !GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) ) return Ret; - } - objectType = GDIOBJ_GetObjectType(hgdiobj); - switch(objectType) - { -/* - msdn.microsoft.com, - "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing, - and the function returns TRUE. Use SetBrushOrgEx to set the origin of - a brush." - */ - case GDI_OBJECT_TYPE_BRUSH: - { - DPRINT("GDI_OBJECT_TYPE_BRUSH\n"); - Ret = TRUE; - break; - } - default: - DPRINT1("Magic 0x%08x not implemented\n", objectType); - break; - } - - GDIOBJ_UnlockObjByPtr(pObject); + + palGDI = PALETTE_LockPalette(hgdiobj); + if (!palGDI) return FALSE; + + // FIXME!! + // Need to do something!!! + // Zero out Current and Old Translated pointers? + // + Ret = TRUE; + PALETTE_UnlockPalette(palGDI); return Ret; }