[0.4.11][NTGDI] 'otm' is always non-NULL in epilogue, and Mute a DPRINT CORE-16993

The DPRINT1 spams and hits performance, e.g. in the application 'SuperFinder XT'.
The logging was introduced by 0.4.11-dev-143-g 6b67ef6e10
fix picked from commit 0.4.15-dev-67-g a98bebb0b0

and the second part '[WIN32SS][NTGDI] 'otm' is always non-NULL in epilogue'
is a small optimization picked from 0.4.14-dev-108-g 1bf982ff88
otm is checked for NULL already a few lines before in that function, and is not touched
anymore in between the two locations. Tiny bit shorter+smaller now,
and might satisfy also some static code-analysis.
The origin of checking it twice for NULL dates back into much older times of ros.
This commit is contained in:
Joachim Henze 2022-10-10 02:30:58 +02:00
parent 693762eb55
commit 238c4f45af

View file

@ -301,7 +301,7 @@ FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
if (!(plfont->fl & TEXTOBJECT_INIT))
{
NTSTATUS Status;
DPRINT1("FontGetObject font not initialized!\n");
DPRINT("FontGetObject font not initialized!\n");
Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
if (!NT_SUCCESS(Status))
@ -923,25 +923,24 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC,
return 0;
}
IntGetOutlineTextMetrics(FontGDI, Size, potm);
if (otm)
{
_SEH2_TRY
{
ProbeForWrite(otm, Size, 1);
RtlCopyMemory(otm, potm, Size);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
Status = _SEH2_GetExceptionCode();
}
_SEH2_END
if (!NT_SUCCESS(Status))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
Size = 0;
}
_SEH2_TRY
{
ProbeForWrite(otm, Size, 1);
RtlCopyMemory(otm, potm, Size);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
Status = _SEH2_GetExceptionCode();
}
_SEH2_END
if (!NT_SUCCESS(Status))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
Size = 0;
}
ExFreePoolWithTag(potm,GDITAG_TEXT);
return Size;
}