mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Don't use ntdll's RtlDuplicateUnicodeString in kmode; it allocates from the process heap. Instead, allocate from pool and copy the string manually.
- Get rid of other ntdll imports (memcmp in freetype, tan in win32k) and instead link the functions statically, so ntdll is no longer loaded at all in kmode. Saves about 550kB of memory. - Also remove unused <library>hal</library> in freetype. svn path=/trunk/; revision=34227
This commit is contained in:
parent
75e6f09822
commit
388fc6e94e
4 changed files with 15 additions and 7 deletions
|
@ -14,8 +14,7 @@
|
||||||
<define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
|
<define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
|
||||||
</if>
|
</if>
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
<library>ntdll</library>
|
<library>libcntpr</library>
|
||||||
<library>hal</library>
|
|
||||||
<directory name="i386">
|
<directory name="i386">
|
||||||
<file>setjmplongjmp.s</file>
|
<file>setjmplongjmp.s</file>
|
||||||
</directory>
|
</directory>
|
||||||
|
|
|
@ -70,7 +70,7 @@ typedef struct _FLOATGDI {
|
||||||
typedef struct _FONTGDI {
|
typedef struct _FONTGDI {
|
||||||
FONTOBJ FontObj;
|
FONTOBJ FontObj;
|
||||||
|
|
||||||
LPCWSTR Filename;
|
LPWSTR Filename;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
TEXTMETRICW TextMetric;
|
TEXTMETRICW TextMetric;
|
||||||
} FONTGDI, *PFONTGDI;
|
} FONTGDI, *PFONTGDI;
|
||||||
|
|
|
@ -279,7 +279,6 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
PSECTION_OBJECT SectionObject;
|
PSECTION_OBJECT SectionObject;
|
||||||
ULONG ViewSize = 0;
|
ULONG ViewSize = 0;
|
||||||
FT_Fixed XScale, YScale;
|
FT_Fixed XScale, YScale;
|
||||||
UNICODE_STRING FileNameCopy;
|
|
||||||
|
|
||||||
/* Open the font file */
|
/* Open the font file */
|
||||||
|
|
||||||
|
@ -355,8 +354,18 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, FileName, &FileNameCopy);
|
FontGDI->Filename = ExAllocatePool(PagedPool, FileName->Length + sizeof(WCHAR));
|
||||||
FontGDI->Filename = FileNameCopy.Buffer;
|
if (FontGDI->Filename == NULL)
|
||||||
|
{
|
||||||
|
EngFreeMem(FontGDI);
|
||||||
|
FT_Done_Face(Face);
|
||||||
|
ObDereferenceObject(SectionObject);
|
||||||
|
ExFreePool(Entry);
|
||||||
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
memcpy(FontGDI->Filename, FileName->Buffer, FileName->Length);
|
||||||
|
FontGDI->Filename[FileName->Length / sizeof(WCHAR)] = L'\0';
|
||||||
FontGDI->face = Face;
|
FontGDI->face = Face;
|
||||||
|
|
||||||
/* FIXME: Complete text metrics */
|
/* FIXME: Complete text metrics */
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
<library>win32k_base</library>
|
<library>win32k_base</library>
|
||||||
<library>pseh</library>
|
<library>pseh</library>
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
<library>ntdll</library>
|
<library>libcntpr</library>
|
||||||
<library>hal</library>
|
<library>hal</library>
|
||||||
<library>freetype</library>
|
<library>freetype</library>
|
||||||
<library>dxguid</library>
|
<library>dxguid</library>
|
||||||
|
|
Loading…
Reference in a new issue