mirror of
https://github.com/reactos/reactos.git
synced 2025-03-01 03:45:16 +00:00
[WIN32SS:NTGDI] freetype.c: Fix the ordering of, and add some missing set-last-error calls.
This commit is contained in:
parent
f22efba486
commit
2e1a4e74a4
1 changed files with 13 additions and 6 deletions
|
@ -1752,7 +1752,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||||
{
|
{
|
||||||
SharedFace_Release(SharedFace);
|
SharedFace_Release(SharedFace);
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return 0; /* failure */
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate a FONTGDI */
|
/* allocate a FONTGDI */
|
||||||
|
@ -1762,7 +1762,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||||
SharedFace_Release(SharedFace);
|
SharedFace_Release(SharedFace);
|
||||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return 0; /* failure */
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set file name */
|
/* set file name */
|
||||||
|
@ -1777,7 +1777,7 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||||
SharedFace_Release(SharedFace);
|
SharedFace_Release(SharedFace);
|
||||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return 0; /* failure */
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCopyMemory(FontGDI->Filename, pFileName->Buffer, pFileName->Length);
|
RtlCopyMemory(FontGDI->Filename, pFileName->Buffer, pFileName->Length);
|
||||||
|
@ -1795,7 +1795,8 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
|
||||||
EngFreeMem(FontGDI);
|
EngFreeMem(FontGDI);
|
||||||
SharedFace_Release(SharedFace);
|
SharedFace_Release(SharedFace);
|
||||||
ExFreePoolWithTag(Entry, TAG_FONT);
|
ExFreePoolWithTag(Entry, TAG_FONT);
|
||||||
return 0;
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivateEntry->Entry = Entry;
|
PrivateEntry->Entry = Entry;
|
||||||
|
@ -4495,20 +4496,26 @@ ftGdiGetGlyphOutline(
|
||||||
|
|
||||||
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
||||||
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
|
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
|
||||||
|
if (!Size)
|
||||||
|
{
|
||||||
|
TEXTOBJ_UnlockText(TextObj);
|
||||||
|
EngSetLastError(ERROR_GEN_FAILURE);
|
||||||
|
return GDI_ERROR;
|
||||||
|
}
|
||||||
potm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT);
|
potm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT);
|
||||||
if (!potm)
|
if (!potm)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
||||||
TEXTOBJ_UnlockText(TextObj);
|
TEXTOBJ_UnlockText(TextObj);
|
||||||
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
ASSERT_FREETYPE_LOCK_NOT_HELD();
|
||||||
Size = IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
|
Size = IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
|
||||||
if (!Size)
|
if (!Size)
|
||||||
{
|
{
|
||||||
/* FIXME: last error? */
|
|
||||||
ExFreePoolWithTag(potm, GDITAG_TEXT);
|
ExFreePoolWithTag(potm, GDITAG_TEXT);
|
||||||
TEXTOBJ_UnlockText(TextObj);
|
TEXTOBJ_UnlockText(TextObj);
|
||||||
|
EngSetLastError(ERROR_GEN_FAILURE);
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue