https://git.reactos.org/?p=reactos.git;a=commitdiff;h=79d392c53cadf247d390a…
commit 79d392c53cadf247d390abc17146fc9db9cdf864
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Sun Jan 7 17:58:47 2018 +0100
[WIN32K] revert PR173 to fix regressions in Chrome/Chromium CORE-14170
This reverts ea4daf8b6873cd6256c45ac1c6b7cfea2e58b340 committed 2017-12-09 to master,
the commit was named
"[WIN32K] Fix NtGdiGetTextFaceW to report face name correctly (#173)",
reverting got ack of khmz,
reopening less severe CORE-14071 accordingly
---
win32ss/gdi/ntgdi/freetype.c | 12 ------------
win32ss/gdi/ntgdi/text.c | 26 ++++++--------------------
2 files changed, 6 insertions(+), 32 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index b8b3f74a03..5fb58cf3e4 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -4504,7 +4504,6 @@ TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
}
else
{
- UNICODE_STRING NameW;
PFONTGDI FontGdi = ObjToGDI(TextObj->Font, FONT);
// Need hdev, when freetype is loaded need to create DEVOBJ for
// Consumer and Producer.
@@ -4519,17 +4518,6 @@ TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
else
FontGdi->RequestWeight = FW_NORMAL;
- /* store the localized family name */
- RtlInitUnicodeString(&NameW, NULL);
- Status = IntGetFontLocalizedName(&NameW, FontGdi->SharedFace,
- TT_NAME_ID_FONT_FAMILY, gusLanguageID);
- if (NT_SUCCESS(Status))
- {
- RtlCopyMemory(TextObj->FaceName, NameW.Buffer, NameW.Length);
- TextObj->FaceName[NameW.Length / sizeof(WCHAR)] = UNICODE_NULL;
- RtlFreeUnicodeString(&NameW);
- }
-
Face = FontGdi->SharedFace->Face;
//FontGdi->OriginalWeight = WeightFromStyle(Face->style_name);
diff --git a/win32ss/gdi/ntgdi/text.c b/win32ss/gdi/ntgdi/text.c
index 4d8d8779df..b4130b6b2f 100644
--- a/win32ss/gdi/ntgdi/text.c
+++ b/win32ss/gdi/ntgdi/text.c
@@ -3,11 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory
* FILE: win32ss/gdi/ntgdi/text.c
* PURPOSE: Text/Font
- * PROGRAMMERS: Amine Khaldi <amine.khaldi(a)reactos.org>
- * Timo Kreuzer <timo.kreuzer(a)reactos.org>
- * James Tabor <james.tabor(a)reactos.org>
- * Hermes Belusca-Maito <hermes.belusca(a)sfr.fr>
- * Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
+ * PROGRAMMER:
*/
/** Includes ******************************************************************/
@@ -516,14 +512,12 @@ NtGdiGetTextFaceW(
TextObj = RealizeFontInit(hFont);
ASSERT(TextObj != NULL);
- fLen = wcslen(TextObj->FaceName) + 1;
- if (fLen > LF_FACESIZE)
- fLen = LF_FACESIZE;
+ fLen = wcslen(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName) + 1;
if (FaceName != NULL)
{
Count = min(Count, fLen);
- Status = MmCopyToCaller(FaceName, TextObj->FaceName, Count * sizeof(WCHAR));
+ Status = MmCopyToCaller(FaceName,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName, Count * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
TEXTOBJ_UnlockText(TextObj);
@@ -531,19 +525,11 @@ NtGdiGetTextFaceW(
return 0;
}
/* Terminate if we copied only part of the font name */
- ret = Count;
- if (Count > 0 && Count <= fLen)
+ if (Count > 0 && Count < fLen)
{
- _SEH2_TRY
- {
- FaceName[Count - 1] = '\0';
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- ret = 0;
- }
- _SEH2_END;
+ FaceName[Count - 1] = '\0';
}
+ ret = Count;
}
else
{