mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[WIN32SS:NTGDI] freetype.c: Fix the ordering of, and add some missing set-last-error calls.
This commit is contained in:
@@ -1752,7 +1752,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||
{
|
||||
SharedFace_Release(SharedFace);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0; /* failure */
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
/* allocate a FONTGDI */
|
||||
@@ -1762,7 +1762,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||
SharedFace_Release(SharedFace);
|
||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0; /* failure */
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
/* set file name */
|
||||
@@ -1777,7 +1777,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||
SharedFace_Release(SharedFace);
|
||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0; /* failure */
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
RtlCopyMemory(FontGDI->Filename, pFileName->Buffer, pFileName->Length);
|
||||
@@ -1795,7 +1795,8 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||
EngFreeMem(FontGDI);
|
||||
SharedFace_Release(SharedFace);
|
||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||
return 0;
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
PrivateEntry->Entry = Entry;
|
||||
@@ -4495,20 +4496,26 @@ ftGdiGetGlyphOutline(
|
||||
|
||||
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
||||
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
|
||||
if (!Size)
|
||||
{
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
EngSetLastError(ERROR_GEN_FAILURE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
potm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT);
|
||||
if (!potm)
|
||||
{
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
||||
Size = IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
|
||||
if (!Size)
|
||||
{
|
||||
/* FIXME: last error? */
|
||||
ExFreePoolWithTag(potm, GDITAG_TEXT);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
EngSetLastError(ERROR_GEN_FAILURE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user