- Move Teb's StaticUnicodeString initialisation from ntdll to MmCreateTeb (it's bette...
authorAleksey Bragin <aleksey@reactos.org>
Sat, 13 Oct 2007 13:39:42 +0000 (13:39 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Sat, 13 Oct 2007 13:39:42 +0000 (13:39 +0000)
svn path=/trunk/; revision=29551

reactos/dll/ntdll/ldr/startup.c
reactos/ntoskrnl/mm/procsup.c

index 599ac44..0dc918d 100644 (file)
@@ -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");
index ab7ebbb..0076678 100644 (file)
@@ -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();