mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 16:12:02 +00:00
[0.4.9][NTGDI] 'otm' is always non-NULL in epilogue CORE-16993
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 the pre-0.4.7-era of ros.
This commit is contained in:
parent
4c35cd179c
commit
cc27dfd4bc
1 changed files with 16 additions and 17 deletions
|
@ -908,25 +908,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue