- 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:
Jeffrey Morlan 2008-06-30 23:58:48 +00:00
parent 75e6f09822
commit 388fc6e94e
4 changed files with 15 additions and 7 deletions

View file

@ -14,8 +14,7 @@
<define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
</if>
<library>ntoskrnl</library>
<library>ntdll</library>
<library>hal</library>
<library>libcntpr</library>
<directory name="i386">
<file>setjmplongjmp.s</file>
</directory>

View file

@ -70,7 +70,7 @@ typedef struct _FLOATGDI {
typedef struct _FONTGDI {
FONTOBJ FontObj;
LPCWSTR Filename;
LPWSTR Filename;
FT_Face face;
TEXTMETRICW TextMetric;
} FONTGDI, *PFONTGDI;

View file

@ -279,7 +279,6 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
PSECTION_OBJECT SectionObject;
ULONG ViewSize = 0;
FT_Fixed XScale, YScale;
UNICODE_STRING FileNameCopy;
/* Open the font file */
@ -355,8 +354,18 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
return 0;
}
RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, FileName, &FileNameCopy);
FontGDI->Filename = FileNameCopy.Buffer;
FontGDI->Filename = ExAllocatePool(PagedPool, FileName->Length + sizeof(WCHAR));
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;
/* FIXME: Complete text metrics */

View file

@ -182,7 +182,7 @@
<library>win32k_base</library>
<library>pseh</library>
<library>ntoskrnl</library>
<library>ntdll</library>
<library>libcntpr</library>
<library>hal</library>
<library>freetype</library>
<library>dxguid</library>