Author: jmorlan
Date: Mon Jun 30 18:58:48 2008
New Revision: 34227
URL:
http://svn.reactos.org/svn/reactos?rev=34227&view=rev
Log:
- 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.
Modified:
trunk/reactos/dll/3rdparty/freetype/freetype.rbuild
trunk/reactos/subsystems/win32/win32k/eng/objects.h
trunk/reactos/subsystems/win32/win32k/objects/text.c
trunk/reactos/subsystems/win32/win32k/win32k.rbuild
Modified: trunk/reactos/dll/3rdparty/freetype/freetype.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/freetype/free…
==============================================================================
--- trunk/reactos/dll/3rdparty/freetype/freetype.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/3rdparty/freetype/freetype.rbuild [iso-8859-1] Mon Jun 30 18:58:48
2008
@@ -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>
Modified: trunk/reactos/subsystems/win32/win32k/eng/objects.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/objects.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/objects.h [iso-8859-1] Mon Jun 30 18:58:48
2008
@@ -70,7 +70,7 @@
typedef struct _FONTGDI {
FONTOBJ FontObj;
- LPCWSTR Filename;
+ LPWSTR Filename;
FT_Face face;
TEXTMETRICW TextMetric;
} FONTGDI, *PFONTGDI;
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Mon Jun 30 18:58:48
2008
@@ -279,7 +279,6 @@
PSECTION_OBJECT SectionObject;
ULONG ViewSize = 0;
FT_Fixed XScale, YScale;
- UNICODE_STRING FileNameCopy;
/* Open the font file */
@@ -355,8 +354,18 @@
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 */
Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/wi…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Mon Jun 30 18:58:48
2008
@@ -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>