From 4c42f7b9f7abfd9cfc30320bb79f54a985dfb359 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Wed, 3 Jan 2018 23:00:12 +0900 Subject: [PATCH] debug helper --- win32ss/gdi/ntgdi/text.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/win32ss/gdi/ntgdi/text.c b/win32ss/gdi/ntgdi/text.c index 4d8d8779df..6ded8bb633 100644 --- a/win32ss/gdi/ntgdi/text.c +++ b/win32ss/gdi/ntgdi/text.c @@ -14,7 +14,7 @@ #include -#define NDEBUG +//#define NDEBUG #include /** Functions *****************************************************************/ @@ -503,6 +503,7 @@ NtGdiGetTextFaceW( INT fLen, ret; /* FIXME: Handle bAliasName */ + DPRINT("NtGdiGetTextFaceW: 0\n"); Dc = DC_LockDc(hDC); if (Dc == NULL) @@ -514,24 +515,47 @@ NtGdiGetTextFaceW( hFont = pdcattr->hlfntNew; DC_UnlockDc(Dc); + DPRINT("NtGdiGetTextFaceW: 1\n"); + DPRINT("NtGdiGetTextFaceW: hFont: %p\n", hFont); + TextObj = RealizeFontInit(hFont); + DPRINT("NtGdiGetTextFaceW: TextObj: %p\n", TextObj); ASSERT(TextObj != NULL); + DPRINT("NtGdiGetTextFaceW: TextObj->FaceName: %p\n", TextObj->FaceName); + + DPRINT("NtGdiGetTextFaceW: 2\n"); + + { + int i; + for (i = 0; TextObj->FaceName[i]; ++i) + { + DPRINT("U+%04X", TextObj->FaceName[i]); + } + DPRINT("\n"); + } + fLen = wcslen(TextObj->FaceName) + 1; if (fLen > LF_FACESIZE) fLen = LF_FACESIZE; + DPRINT("NtGdiGetTextFaceW: 3\n"); + + DPRINT("NtGdiGetTextFaceW: FaceName: %p\n", FaceName); if (FaceName != NULL) { Count = min(Count, fLen); Status = MmCopyToCaller(FaceName, TextObj->FaceName, Count * sizeof(WCHAR)); + DPRINT("NtGdiGetTextFaceW: 4\n"); if (!NT_SUCCESS(Status)) { + DPRINT("NtGdiGetTextFaceW: 5\n"); TEXTOBJ_UnlockText(TextObj); SetLastNtError(Status); return 0; } /* Terminate if we copied only part of the font name */ ret = Count; + DPRINT("NtGdiGetTextFaceW: 6\n"); if (Count > 0 && Count <= fLen) { _SEH2_TRY @@ -541,16 +565,20 @@ NtGdiGetTextFaceW( _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ret = 0; + DPRINT("NtGdiGetTextFaceW: 8\n"); } _SEH2_END; } + DPRINT("NtGdiGetTextFaceW: 9\n"); } else { ret = fLen; + DPRINT("NtGdiGetTextFaceW: 10\n"); } TEXTOBJ_UnlockText(TextObj); + DPRINT("NtGdiGetTextFaceW: 11\n"); return ret; } -- 2.15.0