From 94e74e9b8bb52e01529b34a216ec0b98aec722ef Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 23 Aug 2007 09:52:31 +0000 Subject: [PATCH] Bugfix : AddFontResourceExW, SetLastError to invaild param when the fl are not set. Redirect : AnyLinkedFonts@0 to NtGdiAnyLinkedFonts@0 (stubed in win32k) Redirect : BRUSHOBJ_hGetColorTransform@4 to NtGdiBRUSHOBJ_hGetColorTransform@4 (stubed in win32k) Redirect : BRUSHOBJ_pvAllocRbrush@8 to NtGdiBRUSHOBJ_pvAllocRbrush@8 (stubed in win32k) partly working : GdiAddFontResourceW is parttly working but it does not works as windows version, instead for being stub, it is not finish implementions of it. This is nassry to clean up some mess. svn path=/trunk/; revision=28465 --- reactos/dll/win32/gdi32/gdi32.def | 17 ++++++------ reactos/dll/win32/gdi32/include/gdi32p.h | 4 +++ reactos/dll/win32/gdi32/misc/stubs.c | 35 ++---------------------- reactos/dll/win32/gdi32/misc/stubsw.c | 13 ++++++--- reactos/dll/win32/gdi32/objects/font.c | 14 +++++++--- 5 files changed, 35 insertions(+), 48 deletions(-) diff --git a/reactos/dll/win32/gdi32/gdi32.def b/reactos/dll/win32/gdi32/gdi32.def index 9dc667a093c..51a037250b1 100644 --- a/reactos/dll/win32/gdi32/gdi32.def +++ b/reactos/dll/win32/gdi32/gdi32.def @@ -14,28 +14,29 @@ AddFontMemResourceEx@16 AddFontResourceA@4 AddFontResourceExA@12 AddFontResourceExW@12 -AddFontResourceW@4 AddFontResourceTracking@8 +AddFontResourceW@4 AngleArc@24 AnimatePalette@16 -AnyLinkedFonts@0 +AnyLinkedFonts@0=NtGdiAnyLinkedFonts@0 Arc@36 ArcTo@36 -BeginPath@4 -BRUSHOBJ_hGetColorTransform@4 -BRUSHOBJ_pvAllocRbrush@8 +BRUSHOBJ_hGetColorTransform@4=NtGdiBRUSHOBJ_hGetColorTransform@4 +BRUSHOBJ_pvAllocRbrush@8=NtGdiBRUSHOBJ_pvAllocRbrush@8 + BRUSHOBJ_pvGetRbrush@4 BRUSHOBJ_ulGetBrushColor@4 +BeginPath@4 BitBlt@36 +CLIPOBJ_bEnum@12 +CLIPOBJ_cEnumStart@20 +CLIPOBJ_ppoGetPath@4 CancelDC@4 CheckColorsInGamut@16 ChoosePixelFormat@8 Chord@36 ClearBitmapAttributes@8 ClearBrushAttributes@8 -CLIPOBJ_bEnum@12 -CLIPOBJ_cEnumStart@20 -CLIPOBJ_ppoGetPath@4 CloseEnhMetaFile@4 CloseFigure@4 CloseMetaFile@4 diff --git a/reactos/dll/win32/gdi32/include/gdi32p.h b/reactos/dll/win32/gdi32/include/gdi32p.h index a0fc0e5ba44..efb86720c80 100644 --- a/reactos/dll/win32/gdi32/include/gdi32p.h +++ b/reactos/dll/win32/gdi32/include/gdi32p.h @@ -184,5 +184,9 @@ UINT WINAPI UserRealizePalette(HDC hDC); +int +STDCALL +GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv); + /* EOF */ diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 29fd082b7a4..d90604d48c6 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -1314,17 +1314,7 @@ AddFontResourceTracking( return 0; } -/* - * @unimplemented - */ -BOOL -STDCALL -AnyLinkedFonts(VOID) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} + /* * @unimplemented @@ -2442,28 +2432,9 @@ GdiResetDCEMF( return 0; } -/* - * @unimplemented - */ -HANDLE STDCALL -BRUSHOBJ_hGetColorTransform(BRUSHOBJ *pbo) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} -/* - * @unimplemented - */ -PVOID STDCALL -BRUSHOBJ_pvAllocRbrush(IN BRUSHOBJ *BrushObj, - IN ULONG ObjSize) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} + + /* * @unimplemented diff --git a/reactos/dll/win32/gdi32/misc/stubsw.c b/reactos/dll/win32/gdi32/misc/stubsw.c index 38010fcbef7..55a313dccc6 100644 --- a/reactos/dll/win32/gdi32/misc/stubsw.c +++ b/reactos/dll/win32/gdi32/misc/stubsw.c @@ -258,11 +258,16 @@ EudcUnloadLinkW(LPCWSTR pBaseFaceName,LPCWSTR pEudcFontPath) */ int STDCALL -GdiAddFontResourceW(LPCWSTR filename,FLONG f,DESIGNVECTOR *pdv) +GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + UNICODE_STRING Filename; + //UNIMPLEMENTED; + //SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + //return 0; + + /* FIXME handle fl parameter */ + RtlInitUnicodeString(&Filename, lpszFilename); + return NtGdiAddFontResource ( &Filename, fl ); } /* diff --git a/reactos/dll/win32/gdi32/objects/font.c b/reactos/dll/win32/gdi32/objects/font.c index 3d836f3bfa4..873a60b16f3 100644 --- a/reactos/dll/win32/gdi32/objects/font.c +++ b/reactos/dll/win32/gdi32/objects/font.c @@ -1091,11 +1091,17 @@ int STDCALL AddFontResourceExW ( LPCWSTR lpszFilename, DWORD fl, PVOID pvReserved ) { - UNICODE_STRING Filename; + int retVal = 0; - /* FIXME handle fl parameter */ - RtlInitUnicodeString(&Filename, lpszFilename); - return NtGdiAddFontResource ( &Filename, fl ); + if (fl & (FR_PRIVATE | FR_NOT_ENUM)) + { + retVal = GdiAddFontResourceW(lpszFilename, fl,0); + } + else + { + SetLastError( ERROR_INVALID_PARAMETER ); + } + return retVal; }