From 72595c93156ed819fa26e7172821607c27ecd99a Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sat, 13 Oct 2007 13:39:42 +0000 Subject: [PATCH] - Move Teb's StaticUnicodeString initialisation from ntdll to MmCreateTeb (it's better to initialize it early, and all at once, instead of something here now and something there later). svn path=/trunk/; revision=29551 --- reactos/dll/ntdll/ldr/startup.c | 5 ----- reactos/ntoskrnl/mm/procsup.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/ntdll/ldr/startup.c b/reactos/dll/ntdll/ldr/startup.c index 599ac44d42b..0dc918d0f51 100644 --- a/reactos/dll/ntdll/ldr/startup.c +++ b/reactos/dll/ntdll/ldr/startup.c @@ -377,11 +377,6 @@ LdrpInit(PCONTEXT Context, /* Load execution options */ LoadImageFileExecutionOptions(Peb); - /* Initialize the static teb string */ - NtCurrentTeb()->StaticUnicodeString.Length = 0; - NtCurrentTeb()->StaticUnicodeString.MaximumLength = sizeof(NtCurrentTeb()->StaticUnicodeBuffer); - NtCurrentTeb()->StaticUnicodeString.Buffer = NtCurrentTeb()->StaticUnicodeBuffer; - /* build full ntdll path */ wcscpy (FullNtDllPath, SharedUserData->NtSystemRoot); wcscat (FullNtDllPath, L"\\system32\\ntdll.dll"); diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index ab7ebbb535f..00766789fa1 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -465,6 +465,11 @@ MmCreateTeb(PEPROCESS Process, Teb->DeallocationStack = InitialTeb->AllocatedStackBase; } + /* Initialize the static unicode string */ + Teb->StaticUnicodeString.Length = 0; + Teb->StaticUnicodeString.MaximumLength = sizeof(Teb->StaticUnicodeBuffer); + Teb->StaticUnicodeString.Buffer = Teb->StaticUnicodeBuffer; + /* Return TEB Address */ DPRINT("Allocated: %x\n", Teb); if (Attached) KeDetachProcess();