- 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
This commit is contained in:
Aleksey Bragin 2007-10-13 13:39:42 +00:00
parent eb279e4344
commit 72595c9315
2 changed files with 5 additions and 5 deletions

View 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");

View 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();