2002-10-20 Casper S. Hornstrup <chorns@users.sourceforge.net>

* include/napi/teb.h (RTL_USER_PROCESS_PARAMETERS): Use field names
	as described in Windows NT/2000 Native API Reference.
	* lib/kernel32/file/file.c: Use new field names.
	* lib/kernel32/misc/console.c: Ditto.
	* lib/kernel32/process/create.c: Ditto.
	* lib/kernel32/process/proc.c: Ditto.
	* lib/ntdll/rtl/path.c: Ditto.
	* lib/ntdll/rtl/ppb.c: Ditto.
	* lib/ntdll/rtl/process.c: Ditto.

svn path=/trunk/; revision=3642
This commit is contained in:
Casper Hornstrup 2002-10-20 11:56:00 +00:00
parent bab254e373
commit aa9fe526e2
9 changed files with 344 additions and 333 deletions

View file

@ -1,3 +1,15 @@
2002-10-20 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/napi/teb.h (RTL_USER_PROCESS_PARAMETERS): Use field names
as described in Windows NT/2000 Native API Reference.
* lib/kernel32/file/file.c: Use new field names.
* lib/kernel32/misc/console.c: Ditto.
* lib/kernel32/process/create.c: Ditto.
* lib/kernel32/process/proc.c: Ditto.
* lib/ntdll/rtl/path.c: Ditto.
* lib/ntdll/rtl/ppb.c: Ditto.
* lib/ntdll/rtl/process.c: Ditto.
2002-10-19 Casper S. Hornstrup <chorns@users.sourceforge.net> 2002-10-19 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/ntos.h: Include relevant files. * include/ntos.h: Include relevant files.

View file

@ -33,36 +33,35 @@ typedef struct _PEB_FREE_BLOCK
/* RTL_USER_PROCESS_PARAMETERS.Flags */ /* RTL_USER_PROCESS_PARAMETERS.Flags */
#define PPF_NORMALIZED (1) #define PPF_NORMALIZED (1)
typedef struct _RTL_USER_PROCESS_PARAMETERS typedef struct _RTL_USER_PROCESS_PARAMETERS {
{ ULONG AllocationSize;
ULONG MaximumLength; // 00h ULONG Size;
ULONG Length; // 04h ULONG Flags;
ULONG Flags; // 08h ULONG DebugFlags;
ULONG DebugFlags; // 0Ch HANDLE hConsole;
PVOID ConsoleHandle; // 10h ULONG ProcessGroup;
ULONG ConsoleFlags; // 14h HANDLE hStdInput;
HANDLE InputHandle; // 18h HANDLE hStdOutput;
HANDLE OutputHandle; // 1Ch HANDLE hStdError;
HANDLE ErrorHandle; // 20h UNICODE_STRING CurrentDirectoryName;
CURDIR CurrentDirectory; // 24h HANDLE CurrentDirectoryHandle;
UNICODE_STRING DllPath; // 30h UNICODE_STRING DllPath;
UNICODE_STRING ImagePathName; // 38h UNICODE_STRING ImagePathName;
UNICODE_STRING CommandLine; // 40h UNICODE_STRING CommandLine;
PWSTR Environment; // 48h PWSTR Environment;
ULONG StartingX; // 4Ch ULONG dwX;
ULONG StartingY; // 50h ULONG dwY;
ULONG CountX; // 54h ULONG dwXSize;
ULONG CountY; // 58h ULONG dwYSize;
ULONG CountCharsX; // 5Ch ULONG dwXCountChars;
ULONG CountCharsY; // 60h ULONG dwYCountChars;
ULONG FillAttribute; // 64h ULONG dwFillAttribute;
ULONG WindowFlags; // 68h ULONG dwFlags;
ULONG ShowWindowFlags; // 6Ch ULONG wShowWindow;
UNICODE_STRING WindowTitle; // 70h UNICODE_STRING WindowTitle;
UNICODE_STRING DesktopInfo; // 78h UNICODE_STRING DesktopInfo;
UNICODE_STRING ShellInfo; // 80h UNICODE_STRING ShellInfo;
UNICODE_STRING RuntimeInfo; // 88h UNICODE_STRING RuntimeInfo;
RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20]; // 90h
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
#define PEB_BASE (0x7FFDF000) #define PEB_BASE (0x7FFDF000)

View file

@ -1,4 +1,4 @@
/* $Id: file.c,v 1.36 2002/09/08 10:22:42 chorns Exp $ /* $Id: file.c,v 1.37 2002/10/20 11:55:59 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -259,15 +259,15 @@ GetFileType(HANDLE hFile)
switch ((ULONG)hFile) switch ((ULONG)hFile)
{ {
case STD_INPUT_HANDLE: case STD_INPUT_HANDLE:
hFile = NtCurrentPeb()->ProcessParameters->InputHandle; hFile = NtCurrentPeb()->ProcessParameters->hStdInput;
break; break;
case STD_OUTPUT_HANDLE: case STD_OUTPUT_HANDLE:
hFile = NtCurrentPeb()->ProcessParameters->OutputHandle; hFile = NtCurrentPeb()->ProcessParameters->hStdOutput;
break; break;
case STD_ERROR_HANDLE: case STD_ERROR_HANDLE:
hFile = NtCurrentPeb()->ProcessParameters->ErrorHandle; hFile = NtCurrentPeb()->ProcessParameters->hStdError;
break; break;
} }

View file

@ -1,4 +1,4 @@
/* $Id: console.c,v 1.44 2002/10/20 00:34:39 mdill Exp $ /* $Id: console.c,v 1.45 2002/10/20 11:55:59 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -579,9 +579,9 @@ GetStdHandle(DWORD nStdHandle)
Ppb = NtCurrentPeb()->ProcessParameters; Ppb = NtCurrentPeb()->ProcessParameters;
switch (nStdHandle) switch (nStdHandle)
{ {
case STD_INPUT_HANDLE: return Ppb->InputHandle; case STD_INPUT_HANDLE: return Ppb->hStdInput;
case STD_OUTPUT_HANDLE: return Ppb->OutputHandle; case STD_OUTPUT_HANDLE: return Ppb->hStdOutput;
case STD_ERROR_HANDLE: return Ppb->ErrorHandle; case STD_ERROR_HANDLE: return Ppb->hStdError;
} }
SetLastError (ERROR_INVALID_PARAMETER); SetLastError (ERROR_INVALID_PARAMETER);
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
@ -614,13 +614,13 @@ SetStdHandle(DWORD nStdHandle,
switch (nStdHandle) switch (nStdHandle)
{ {
case STD_INPUT_HANDLE: case STD_INPUT_HANDLE:
Ppb->InputHandle = hHandle; Ppb->hStdInput = hHandle;
return TRUE; return TRUE;
case STD_OUTPUT_HANDLE: case STD_OUTPUT_HANDLE:
Ppb->OutputHandle = hHandle; Ppb->hStdOutput = hHandle;
return TRUE; return TRUE;
case STD_ERROR_HANDLE: case STD_ERROR_HANDLE:
Ppb->ErrorHandle = hHandle; Ppb->hStdError = hHandle;
return TRUE; return TRUE;
} }
SetLastError (ERROR_INVALID_PARAMETER); SetLastError (ERROR_INVALID_PARAMETER);

View file

@ -1,4 +1,4 @@
/* $Id: create.c,v 1.54 2002/10/01 19:27:19 chorns Exp $ /* $Id: create.c,v 1.55 2002/10/20 11:56:00 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -477,7 +477,7 @@ KlInitPeb (HANDLE ProcessHandle,
/* create the PPB */ /* create the PPB */
PpbBase = NULL; PpbBase = NULL;
PpbSize = Ppb->MaximumLength; PpbSize = Ppb->AllocationSize;
Status = NtAllocateVirtualMemory(ProcessHandle, Status = NtAllocateVirtualMemory(ProcessHandle,
&PpbBase, &PpbBase,
0, 0,
@ -493,7 +493,7 @@ KlInitPeb (HANDLE ProcessHandle,
NtWriteVirtualMemory(ProcessHandle, NtWriteVirtualMemory(ProcessHandle,
PpbBase, PpbBase,
Ppb, Ppb,
Ppb->MaximumLength, Ppb->AllocationSize,
&BytesWritten); &BytesWritten);
/* write pointer to environment */ /* write pointer to environment */
@ -755,23 +755,23 @@ CreateProcessW(LPCWSTR lpApplicationName,
/* /*
* Translate some handles for the new process * Translate some handles for the new process
*/ */
if (Ppb->CurrentDirectory.Handle) if (Ppb->CurrentDirectoryHandle)
{ {
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->CurrentDirectory.Handle, Ppb->CurrentDirectoryHandle,
hProcess, hProcess,
&Ppb->CurrentDirectory.Handle, &Ppb->CurrentDirectoryHandle,
0, 0,
TRUE, TRUE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
} }
if (Ppb->ConsoleHandle) if (Ppb->hConsole)
{ {
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->ConsoleHandle, Ppb->hConsole,
hProcess, hProcess,
&Ppb->ConsoleHandle, &Ppb->hConsole,
0, 0,
TRUE, TRUE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
@ -819,31 +819,31 @@ CreateProcessW(LPCWSTR lpApplicationName,
} }
// Set the child console handles // Set the child console handles
Ppb->InputHandle = NtCurrentPeb()->ProcessParameters->InputHandle; Ppb->hStdInput = NtCurrentPeb()->ProcessParameters->hStdInput;
Ppb->OutputHandle = NtCurrentPeb()->ProcessParameters->OutputHandle; Ppb->hStdOutput = NtCurrentPeb()->ProcessParameters->hStdOutput;
Ppb->ErrorHandle = NtCurrentPeb()->ProcessParameters->ErrorHandle; Ppb->hStdError = NtCurrentPeb()->ProcessParameters->hStdError;
if (lpStartupInfo && (lpStartupInfo->dwFlags & STARTF_USESTDHANDLES)) if (lpStartupInfo && (lpStartupInfo->dwFlags & STARTF_USESTDHANDLES))
{ {
if (lpStartupInfo->hStdInput) if (lpStartupInfo->hStdInput)
Ppb->InputHandle = lpStartupInfo->hStdInput; Ppb->hStdInput = lpStartupInfo->hStdInput;
if (lpStartupInfo->hStdOutput) if (lpStartupInfo->hStdOutput)
Ppb->OutputHandle = lpStartupInfo->hStdOutput; Ppb->hStdOutput = lpStartupInfo->hStdOutput;
if (lpStartupInfo->hStdError) if (lpStartupInfo->hStdError)
Ppb->ErrorHandle = lpStartupInfo->hStdError; Ppb->hStdError = lpStartupInfo->hStdError;
} }
if (IsConsoleHandle(Ppb->InputHandle)) if (IsConsoleHandle(Ppb->hStdInput))
{ {
Ppb->InputHandle = CsrReply.Data.CreateProcessReply.InputHandle; Ppb->hStdInput = CsrReply.Data.CreateProcessReply.InputHandle;
} }
else else
{ {
DPRINT("Duplicate input handle\n"); DPRINT("Duplicate input handle\n");
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->InputHandle, Ppb->hStdInput,
hProcess, hProcess,
&Ppb->InputHandle, &Ppb->hStdInput,
0, 0,
TRUE, TRUE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
@ -853,17 +853,17 @@ CreateProcessW(LPCWSTR lpApplicationName,
} }
} }
if (IsConsoleHandle(Ppb->OutputHandle)) if (IsConsoleHandle(Ppb->hStdOutput))
{ {
Ppb->OutputHandle = CsrReply.Data.CreateProcessReply.OutputHandle; Ppb->hStdOutput = CsrReply.Data.CreateProcessReply.OutputHandle;
} }
else else
{ {
DPRINT("Duplicate output handle\n"); DPRINT("Duplicate output handle\n");
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->OutputHandle, Ppb->hStdOutput,
hProcess, hProcess,
&Ppb->OutputHandle, &Ppb->hStdOutput,
0, 0,
TRUE, TRUE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
@ -872,17 +872,17 @@ CreateProcessW(LPCWSTR lpApplicationName,
DPRINT("NtDuplicateObject failed, status %x\n", Status); DPRINT("NtDuplicateObject failed, status %x\n", Status);
} }
} }
if (IsConsoleHandle(Ppb->ErrorHandle)) if (IsConsoleHandle(Ppb->hStdError))
{ {
Ppb->ErrorHandle = CsrReply.Data.CreateProcessReply.OutputHandle; Ppb->hStdError = CsrReply.Data.CreateProcessReply.OutputHandle;
} }
else else
{ {
DPRINT("Duplicate error handle\n"); DPRINT("Duplicate error handle\n");
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->ErrorHandle, Ppb->hStdError,
hProcess, hProcess,
&Ppb->ErrorHandle, &Ppb->hStdError,
0, 0,
TRUE, TRUE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
@ -897,20 +897,20 @@ CreateProcessW(LPCWSTR lpApplicationName,
*/ */
if (lpStartupInfo) if (lpStartupInfo)
{ {
Ppb->WindowFlags = lpStartupInfo->dwFlags; Ppb->dwFlags = lpStartupInfo->dwFlags;
if (Ppb->WindowFlags & STARTF_USESHOWWINDOW) if (Ppb->dwFlags & STARTF_USESHOWWINDOW)
{ {
Ppb->ShowWindowFlags = lpStartupInfo->wShowWindow; Ppb->wShowWindow = lpStartupInfo->wShowWindow;
} }
else else
{ {
Ppb->ShowWindowFlags = SW_SHOWDEFAULT; Ppb->wShowWindow = SW_SHOWDEFAULT;
} }
Ppb->StartingX = lpStartupInfo->dwX; Ppb->dwX = lpStartupInfo->dwX;
Ppb->StartingY = lpStartupInfo->dwY; Ppb->dwY = lpStartupInfo->dwY;
Ppb->CountX = lpStartupInfo->dwXSize; Ppb->dwXSize = lpStartupInfo->dwXSize;
Ppb->CountY = lpStartupInfo->dwYSize; Ppb->dwYSize = lpStartupInfo->dwYSize;
Ppb->FillAttribute = lpStartupInfo->dwFillAttribute; Ppb->dwFillAttribute = lpStartupInfo->dwFillAttribute;
} }
else else
{ {

View file

@ -1,4 +1,4 @@
/* $Id: proc.c,v 1.46 2002/09/08 10:22:45 chorns Exp $ /* $Id: proc.c,v 1.47 2002/10/20 11:56:00 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -389,22 +389,22 @@ GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
lpStartupInfo->cb = sizeof(STARTUPINFOW); lpStartupInfo->cb = sizeof(STARTUPINFOW);
lpStartupInfo->lpDesktop = Params->DesktopInfo.Buffer; lpStartupInfo->lpDesktop = Params->DesktopInfo.Buffer;
lpStartupInfo->lpTitle = Params->WindowTitle.Buffer; lpStartupInfo->lpTitle = Params->WindowTitle.Buffer;
lpStartupInfo->dwX = Params->StartingX; lpStartupInfo->dwX = Params->dwX;
lpStartupInfo->dwY = Params->StartingY; lpStartupInfo->dwY = Params->dwY;
lpStartupInfo->dwXSize = Params->CountX; lpStartupInfo->dwXSize = Params->dwXSize;
lpStartupInfo->dwYSize = Params->CountY; lpStartupInfo->dwYSize = Params->dwYSize;
lpStartupInfo->dwXCountChars = Params->CountCharsX; lpStartupInfo->dwXCountChars = Params->dwXCountChars;
lpStartupInfo->dwYCountChars = Params->CountCharsY; lpStartupInfo->dwYCountChars = Params->dwYCountChars;
lpStartupInfo->dwFillAttribute = Params->FillAttribute; lpStartupInfo->dwFillAttribute = Params->dwFillAttribute;
lpStartupInfo->dwFlags = Params->Flags; lpStartupInfo->dwFlags = Params->dwFlags;
lpStartupInfo->wShowWindow = Params->ShowWindowFlags; lpStartupInfo->wShowWindow = Params->wShowWindow;
lpStartupInfo->lpReserved = Params->ShellInfo.Buffer; lpStartupInfo->lpReserved = Params->ShellInfo.Buffer;
lpStartupInfo->cbReserved2 = Params->RuntimeInfo.Length; lpStartupInfo->cbReserved2 = Params->RuntimeInfo.Length;
lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeInfo.Buffer; lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeInfo.Buffer;
lpStartupInfo->hStdInput = Params->InputHandle; lpStartupInfo->hStdInput = Params->hStdInput;
lpStartupInfo->hStdOutput = Params->OutputHandle; lpStartupInfo->hStdOutput = Params->hStdOutput;
lpStartupInfo->hStdError = Params->ErrorHandle; lpStartupInfo->hStdError = Params->hStdError;
} }
@ -451,21 +451,21 @@ GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
TRUE); TRUE);
lpLocalStartupInfo->lpReserved = AnsiString.Buffer; lpLocalStartupInfo->lpReserved = AnsiString.Buffer;
lpLocalStartupInfo->dwX = Params->StartingX; lpLocalStartupInfo->dwX = Params->dwX;
lpLocalStartupInfo->dwY = Params->StartingY; lpLocalStartupInfo->dwY = Params->dwY;
lpLocalStartupInfo->dwXSize = Params->CountX; lpLocalStartupInfo->dwXSize = Params->dwXSize;
lpLocalStartupInfo->dwYSize = Params->CountY; lpLocalStartupInfo->dwYSize = Params->dwYSize;
lpLocalStartupInfo->dwXCountChars = Params->CountCharsX; lpLocalStartupInfo->dwXCountChars = Params->dwXCountChars;
lpLocalStartupInfo->dwYCountChars = Params->CountCharsY; lpLocalStartupInfo->dwYCountChars = Params->dwYCountChars;
lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute; lpLocalStartupInfo->dwFillAttribute = Params->dwFillAttribute;
lpLocalStartupInfo->dwFlags = Params->Flags; lpLocalStartupInfo->dwFlags = Params->dwFlags;
lpLocalStartupInfo->wShowWindow = Params->ShowWindowFlags; lpLocalStartupInfo->wShowWindow = Params->wShowWindow;
lpLocalStartupInfo->cbReserved2 = Params->RuntimeInfo.Length; lpLocalStartupInfo->cbReserved2 = Params->RuntimeInfo.Length;
lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeInfo.Buffer; lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeInfo.Buffer;
lpLocalStartupInfo->hStdInput = Params->InputHandle; lpLocalStartupInfo->hStdInput = Params->hStdInput;
lpLocalStartupInfo->hStdOutput = Params->OutputHandle; lpLocalStartupInfo->hStdOutput = Params->hStdOutput;
lpLocalStartupInfo->hStdError = Params->ErrorHandle; lpLocalStartupInfo->hStdError = Params->hStdError;
} }
RtlReleasePebLock (); RtlReleasePebLock ();

View file

@ -1,4 +1,4 @@
/* $Id: path.c,v 1.14 2002/09/08 10:23:06 chorns Exp $ /* $Id: path.c,v 1.15 2002/10/20 11:56:00 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -252,7 +252,7 @@ RtlGetCurrentDirectory_U(ULONG MaximumLength,
DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer); DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer);
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory); cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName);
RtlAcquirePebLock(); RtlAcquirePebLock();
Length = cd->DosPath.Length / sizeof(WCHAR); Length = cd->DosPath.Length / sizeof(WCHAR);
@ -304,7 +304,7 @@ RtlSetCurrentDirectory_U(PUNICODE_STRING name)
DPRINT ("RtlSetCurrentDirectory %wZ\n", name); DPRINT ("RtlSetCurrentDirectory %wZ\n", name);
RtlAcquirePebLock (); RtlAcquirePebLock ();
cd = &NtCurrentPeb ()->ProcessParameters->CurrentDirectory; cd = (PCURDIR)&NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName;
size = cd->DosPath.MaximumLength; size = cd->DosPath.MaximumLength;
buf = RtlAllocateHeap (RtlGetProcessHeap(), buf = RtlAllocateHeap (RtlGetProcessHeap(),
@ -516,7 +516,7 @@ CHECKPOINT;
RtlAcquirePebLock(); RtlAcquirePebLock();
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory); cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName);
DPRINT("type %ld\n", type); DPRINT("type %ld\n", type);
switch (type) switch (type)
{ {
@ -707,7 +707,7 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname,
if (nah) if (nah)
{ {
memset (nah, 0, sizeof(CURDIR)); memset (nah, 0, sizeof(CURDIR));
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory); cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName);
if (Type == 5 && cd->Handle && if (Type == 5 && cd->Handle &&
!_wcsnicmp (cd->DosPath.Buffer, fullname, cd->DosPath.Length / 2)) !_wcsnicmp (cd->DosPath.Buffer, fullname, cd->DosPath.Length / 2))
{ {

View file

@ -1,4 +1,4 @@
/* $Id: ppb.c,v 1.15 2002/10/01 19:27:20 chorns Exp $ /* $Id: ppb.c,v 1.16 2002/10/20 11:56:00 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -97,10 +97,10 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
if (Environment == NULL) if (Environment == NULL)
Environment = NtCurrentPeb()->ProcessParameters->Environment; Environment = NtCurrentPeb()->ProcessParameters->Environment;
if (CurrentDirectory == NULL) if (CurrentDirectory == NULL)
CurrentDirectory = &NtCurrentPeb()->ProcessParameters->CurrentDirectory.DosPath; CurrentDirectory = &NtCurrentPeb()->ProcessParameters->CurrentDirectoryName;
CurrentDirectoryHandle = NtCurrentPeb()->ProcessParameters->CurrentDirectory.Handle; CurrentDirectoryHandle = NtCurrentPeb()->ProcessParameters->CurrentDirectoryHandle;
ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; ConsoleHandle = NtCurrentPeb()->ProcessParameters->hConsole;
ConsoleFlags = NtCurrentPeb()->ProcessParameters->ConsoleFlags; ConsoleFlags = NtCurrentPeb()->ProcessParameters->ProcessGroup;
} }
else else
{ {
@ -156,33 +156,33 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
DPRINT ("Process parameters allocated\n"); DPRINT ("Process parameters allocated\n");
Param->MaximumLength = RegionSize; Param->AllocationSize = RegionSize;
Param->Length = Length; Param->Size = Length;
Param->Flags = PPF_NORMALIZED; Param->Flags = PPF_NORMALIZED;
Param->Environment = Environment; Param->Environment = Environment;
Param->CurrentDirectory.Handle = CurrentDirectoryHandle; Param->CurrentDirectoryHandle = CurrentDirectoryHandle;
Param->ConsoleHandle = ConsoleHandle; Param->hConsole = ConsoleHandle;
Param->ConsoleFlags = ConsoleFlags; Param->ProcessGroup = ConsoleFlags;
Dest = (PWCHAR)(((PBYTE)Param) + sizeof(RTL_USER_PROCESS_PARAMETERS)); Dest = (PWCHAR)(((PBYTE)Param) + sizeof(RTL_USER_PROCESS_PARAMETERS));
/* copy current directory */ /* copy current directory */
RtlpCopyParameterString(&Dest, RtlpCopyParameterString(&Dest,
&Param->CurrentDirectory.DosPath, &Param->CurrentDirectoryName,
CurrentDirectory, CurrentDirectory,
MAX_PATH * sizeof(WCHAR)); MAX_PATH * sizeof(WCHAR));
/* make sure the current directory has a trailing backslash */ /* make sure the current directory has a trailing backslash */
if (Param->CurrentDirectory.DosPath.Length > 0) if (Param->CurrentDirectoryName.Length > 0)
{ {
ULONG Length; ULONG Length;
Length = Param->CurrentDirectory.DosPath.Length / sizeof(WCHAR); Length = Param->CurrentDirectoryName.Length / sizeof(WCHAR);
if (Param->CurrentDirectory.DosPath.Buffer[Length-1] != L'\\') if (Param->CurrentDirectoryName.Buffer[Length-1] != L'\\')
{ {
Param->CurrentDirectory.DosPath.Buffer[Length] = L'\\'; Param->CurrentDirectoryName.Buffer[Length] = L'\\';
Param->CurrentDirectory.DosPath.Buffer[Length + 1] = 0; Param->CurrentDirectoryName.Buffer[Length + 1] = 0;
Param->CurrentDirectory.DosPath.Length += sizeof(WCHAR); Param->CurrentDirectoryName.Length += sizeof(WCHAR);
} }
} }
@ -254,7 +254,7 @@ RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
{ {
if (Params && (Params->Flags & PPF_NORMALIZED)) if (Params && (Params->Flags & PPF_NORMALIZED))
{ {
DENORMALIZE(Params->CurrentDirectory.DosPath.Buffer, Params); DENORMALIZE(Params->CurrentDirectoryName.Buffer, Params);
DENORMALIZE(Params->DllPath.Buffer, Params); DENORMALIZE(Params->DllPath.Buffer, Params);
DENORMALIZE(Params->ImagePathName.Buffer, Params); DENORMALIZE(Params->ImagePathName.Buffer, Params);
DENORMALIZE(Params->CommandLine.Buffer, Params); DENORMALIZE(Params->CommandLine.Buffer, Params);
@ -277,7 +277,7 @@ RtlNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
{ {
if (Params && !(Params->Flags & PPF_NORMALIZED)) if (Params && !(Params->Flags & PPF_NORMALIZED))
{ {
NORMALIZE(Params->CurrentDirectory.DosPath.Buffer, Params); NORMALIZE(Params->CurrentDirectoryName.Buffer, Params);
NORMALIZE(Params->DllPath.Buffer, Params); NORMALIZE(Params->DllPath.Buffer, Params);
NORMALIZE(Params->ImagePathName.Buffer, Params); NORMALIZE(Params->ImagePathName.Buffer, Params);
NORMALIZE(Params->CommandLine.Buffer, Params); NORMALIZE(Params->CommandLine.Buffer, Params);

View file

@ -1,4 +1,4 @@
/* $Id: process.c,v 1.31 2002/10/01 19:27:20 chorns Exp $ /* $Id: process.c,v 1.32 2002/10/20 11:56:00 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -323,7 +323,7 @@ static NTSTATUS KlInitPeb (HANDLE ProcessHandle,
/* create the PPB */ /* create the PPB */
PpbBase = NULL; PpbBase = NULL;
PpbSize = Ppb->MaximumLength; PpbSize = Ppb->AllocationSize;
Status = NtAllocateVirtualMemory(ProcessHandle, Status = NtAllocateVirtualMemory(ProcessHandle,
&PpbBase, &PpbBase,
0, 0,
@ -342,7 +342,7 @@ static NTSTATUS KlInitPeb (HANDLE ProcessHandle,
NtWriteVirtualMemory(ProcessHandle, NtWriteVirtualMemory(ProcessHandle,
PpbBase, PpbBase,
Ppb, Ppb,
Ppb->MaximumLength, Ppb->AllocationSize,
&BytesWritten); &BytesWritten);
RtlNormalizeProcessParams (Ppb); RtlNormalizeProcessParams (Ppb);