[URTL]: Fix whitespace plus misspelling.

svn path=/trunk/; revision=65439
This commit is contained in:
Hermès Bélusca-Maïto 2014-11-21 02:35:38 +00:00
parent d8808ad153
commit 8e44d4d4af

View file

@ -33,27 +33,27 @@ _main(
static static
VOID FASTCALL EnvironmentStringToUnicodeString (PWCHAR wsIn, PUNICODE_STRING usOut) VOID FASTCALL EnvironmentStringToUnicodeString (PWCHAR wsIn, PUNICODE_STRING usOut)
{ {
if (wsIn) if (wsIn)
{ {
PWCHAR CurrentChar = wsIn; PWCHAR CurrentChar = wsIn;
while (*CurrentChar)
{
while(*CurrentChar++);
}
/* double nullterm at end */
CurrentChar++;
usOut->Buffer = wsIn; while (*CurrentChar)
/* FIXME: the last (double) nullterm should perhaps not be included in Length {
* but only in MaximumLength. -Gunnar */ while(*CurrentChar++);
usOut->MaximumLength = usOut->Length = (CurrentChar-wsIn) * sizeof(WCHAR); }
} /* double nullterm at end */
else CurrentChar++;
{
usOut->Buffer = NULL; usOut->Buffer = wsIn;
usOut->Length = usOut->MaximumLength = 0; /* FIXME: the last (double) nullterm should perhaps not be included in Length
} * but only in MaximumLength. -Gunnar */
usOut->MaximumLength = usOut->Length = (CurrentChar-wsIn) * sizeof(WCHAR);
}
else
{
usOut->Buffer = NULL;
usOut->Length = usOut->MaximumLength = 0;
}
} }
@ -91,9 +91,9 @@ NtProcessStartup(PPEB Peb)
ArgumentList = RtlAllocateHeap(RtlGetProcessHeap(), 0, 512 * sizeof(PCHAR)); ArgumentList = RtlAllocateHeap(RtlGetProcessHeap(), 0, 512 * sizeof(PCHAR));
if (!ArgumentList) if (!ArgumentList)
{ {
DPRINT1("ERR: no mem!"); DPRINT1("ERR: no mem!");
Status = STATUS_NO_MEMORY; Status = STATUS_NO_MEMORY;
goto fail; goto fail;
} }
/* Use a null pointer as default */ /* Use a null pointer as default */
@ -117,8 +117,8 @@ NtProcessStartup(PPEB Peb)
Status = RtlUnicodeStringToAnsiString(&AnsiCmdLine, CmdLineString, TRUE); Status = RtlUnicodeStringToAnsiString(&AnsiCmdLine, CmdLineString, TRUE);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("ERR: no mem(guess)\n"); DPRINT1("ERR: no mem(guess)\n");
goto fail; goto fail;
} }
/* Save parameters for parsing */ /* Save parameters for parsing */
@ -130,12 +130,12 @@ NtProcessStartup(PPEB Peb)
{ {
/* Allocate a buffer for the destination */ /* Allocate a buffer for the destination */
Destination = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length + sizeof(WCHAR)); Destination = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length + sizeof(WCHAR));
if (!Destination) if (!Destination)
{ {
DPRINT1("ERR: no mem!"); DPRINT1("ERR: no mem!");
Status = STATUS_NO_MEMORY; Status = STATUS_NO_MEMORY;
goto fail; goto fail;
} }
/* Start parsing */ /* Start parsing */
while (*Source) while (*Source)
@ -164,33 +164,33 @@ NtProcessStartup(PPEB Peb)
/* Null terminate the token pointer list */ /* Null terminate the token pointer list */
*ArgumentList++ = NULL; *ArgumentList++ = NULL;
/* Now handle the enviornment, point the envp at our current list location. */ /* Now handle the environment, point the envp at our current list location. */
envp = ArgumentList; envp = ArgumentList;
if (ProcessParameters->Environment) if (ProcessParameters->Environment)
{ {
EnvironmentStringToUnicodeString(ProcessParameters->Environment, &UnicodeEnvironment); EnvironmentStringToUnicodeString(ProcessParameters->Environment, &UnicodeEnvironment);
Status = RtlUnicodeStringToAnsiString (& AnsiEnvironment, & UnicodeEnvironment, TRUE); Status = RtlUnicodeStringToAnsiString (& AnsiEnvironment, & UnicodeEnvironment, TRUE);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("ERR: no mem(guess)\n"); DPRINT1("ERR: no mem(guess)\n");
goto fail; goto fail;
} }
ASSERT(AnsiEnvironment.Buffer); ASSERT(AnsiEnvironment.Buffer);
Source = AnsiEnvironment.Buffer; Source = AnsiEnvironment.Buffer;
while (*Source) while (*Source)
{ {
/* Save a pointer to this token */ /* Save a pointer to this token */
*ArgumentList++ = Source; *ArgumentList++ = Source;
/* Keep looking for another variable */ /* Keep looking for another variable */
while (*Source++); while (*Source++);
} }
/* Null terminate the list again */ /* Null terminate the list again */
*ArgumentList++ = NULL; *ArgumentList++ = NULL;
} }
/* Breakpoint if we were requested to do so */ /* Breakpoint if we were requested to do so */
if (ProcessParameters->DebugFlags) DbgBreakPoint(); if (ProcessParameters->DebugFlags) DbgBreakPoint();