-/* $Id: rtl.h,v 1.10 2000/02/19 19:33:28 ekohl Exp $
+/* $Id: rtl.h,v 1.11 2000/02/25 23:57:21 ekohl Exp $
*
*/
-VOID WINAPI __RtlInitHeap(PVOID base,
- ULONG minsize,
- ULONG maxsize);
+
+/*
+ * Preliminary data type!!
+ *
+ * This definition is not finished yet. It will change in the future.
+ */
+typedef struct _RTL_USER_PROCESS_INFO
+{
+ ULONG Unknown1; // 0x00
+ HANDLE ProcessHandle; // 0x04
+ HANDLE ThreadHandle; // 0x08
+ CLIENT_ID ClientId; // 0x0C
+ ULONG Unknown5; // 0x14
+ LONG StackZeroBits; // 0x18
+ LONG StackReserved; // 0x1C
+ LONG StackCommit; // 0x20
+ ULONG Unknown9; // 0x24
+// more data ... ???
+} RTL_USER_PROCESS_INFO, *PRTL_USER_PROCESS_INFO;
+
+
+//VOID WINAPI __RtlInitHeap(PVOID base,
+// ULONG minsize,
+// ULONG maxsize);
#define HEAP_BASE (0xa0000000)
STDCALL
RtlCreateUserProcess (
PUNICODE_STRING CommandLine,
- ULONG Unknown1,
- PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
+ ULONG Unknown2,
+ PRTL_USER_PROCESS_PARAMETERS ProcessParameters, // verified
PSECURITY_DESCRIPTOR ProcessSd,
PSECURITY_DESCRIPTOR ThreadSd,
WINBOOL bInheritHandles,
DWORD dwCreationFlags,
- PCLIENT_ID ClientId,
- PHANDLE ProcessHandle,
- PHANDLE ThreadHandle
+ ULONG Unknown8,
+ ULONG Unknown9,
+ PRTL_USER_PROCESS_INFO ProcessInfo // verified
);
NTSTATUS
-/* $Id: process.c,v 1.15 2000/02/19 19:34:49 ekohl Exp $
+/* $Id: process.c,v 1.16 2000/02/25 23:58:03 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
return(ThreadHandle);
}
-static NTSTATUS RtlpMapFile(PUNICODE_STRING ApplicationName,
+static NTSTATUS RtlpMapFile(
+PRTL_USER_PROCESS_PARAMETERS Ppb,
+//PUNICODE_STRING ApplicationName,
PHANDLE Section)
{
HANDLE hFile;
hFile = NULL;
+ RtlDeNormalizeProcessParams (Ppb);
+
InitializeObjectAttributes(&ObjectAttributes,
- ApplicationName,
+// ApplicationName,
+ &(Ppb->ImagePathName),
OBJ_CASE_INSENSITIVE,
NULL,
SecurityDescriptor);
+ RtlNormalizeProcessParams (Ppb);
+
/*
* Try to open the executable
*/
return(STATUS_SUCCESS);
}
-NTSTATUS STDCALL RtlCreateUserProcess(PUNICODE_STRING CommandLine,
- ULONG Unknown1,
- PRTL_USER_PROCESS_PARAMETERS Ppb,
- PSECURITY_DESCRIPTOR ProcessSd,
- PSECURITY_DESCRIPTOR ThreadSd,
- WINBOOL bInheritHandles,
- DWORD dwCreationFlags,
- PCLIENT_ID ClientId,
- PHANDLE ProcessHandle,
- PHANDLE ThreadHandle)
+NTSTATUS
+STDCALL
+RtlCreateUserProcess (
+ PUNICODE_STRING CommandLine, // verified
+ ULONG Unknown2,
+ PRTL_USER_PROCESS_PARAMETERS Ppb, // verified
+ PSECURITY_DESCRIPTOR ProcessSd,
+ PSECURITY_DESCRIPTOR ThreadSd,
+ WINBOOL bInheritHandles,
+ DWORD dwCreationFlags,
+ ULONG Unknown8,
+ ULONG Unknown9,
+ PRTL_USER_PROCESS_INFO ProcessInfo // verified
+ )
{
HANDLE hSection;
HANDLE hThread;
PROCESS_BASIC_INFORMATION ProcessBasicInfo;
ULONG retlen;
- DPRINT("CreateProcessW(CommandLine '%w')\n", CommandLine->Buffer);
+ DPRINT("RtlCreateUserProcess\n");
- Status = RtlpMapFile(CommandLine,
+// Status = RtlpMapFile(CommandLine,
+ Status = RtlpMapFile(Ppb,
&hSection);
/*
* Create a new process
*/
- Status = NtCreateProcess(ProcessHandle,
+ Status = NtCreateProcess(&(ProcessInfo->ProcessHandle),
PROCESS_ALL_ACCESS,
NULL,
NtCurrentProcess(),
* Get some information about the process
*/
- ZwQueryInformationProcess(*ProcessHandle,
+ ZwQueryInformationProcess(ProcessInfo->ProcessHandle,
ProcessBasicInformation,
&ProcessBasicInfo,
sizeof(ProcessBasicInfo),
&retlen);
DPRINT("ProcessBasicInfo.UniqueProcessId %d\n",
ProcessBasicInfo.UniqueProcessId);
- if (ClientId != NULL)
- {
- ClientId->UniqueProcess = (HANDLE)ProcessBasicInfo.UniqueProcessId;
- }
+ ProcessInfo->ClientId.UniqueProcess = (HANDLE)ProcessBasicInfo.UniqueProcessId;
/*
* Create Process Environment Block
*/
DPRINT("Creating peb\n");
- KlInitPeb(*ProcessHandle, Ppb);
+ KlInitPeb(ProcessInfo->ProcessHandle, Ppb);
DPRINT("Creating thread for process\n");
lpStartAddress = (LPTHREAD_START_ROUTINE)
AddressOfEntryPoint +
((PIMAGE_OPTIONAL_HEADER)OPTHDROFFSET(NTDLL_BASE))->ImageBase;
- hThread = KlCreateFirstThread(*ProcessHandle,
+ hThread = KlCreateFirstThread(ProcessInfo->ProcessHandle,
// Headers.OptionalHeader.SizeOfStackReserve,
0x200000,
lpStartAddress,
dwCreationFlags,
- ClientId);
+ &(ProcessInfo->ClientId));
if (hThread == NULL)
{
DPRINT("Failed to create thread\n");
-/* $Id: init.c,v 1.13 2000/02/21 22:43:15 ekohl Exp $
+/* $Id: init.c,v 1.14 2000/02/25 23:58:57 ekohl Exp $
*
* init.c - Session Manager initialization
*
#define NDEBUG
+/* uncomment to run csrss.exe */
+//#define RUN_CSRSS
/* GLOBAL VARIABLES *********************************************************/
UNICODE_STRING CmdLineW;
UNICODE_STRING CurrentDirectoryW;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
+ RTL_USER_PROCESS_INFO ProcessInfo;
/* Create the "\SmApiPort" object (LPC) */
RtlInitUnicodeString (&UnicodeString,
/* FIXME: Load the well known DLLs */
- /* Create paging files */
#if 0
+ /* Create paging files */
SmCreatePagingFiles ();
#endif
+#if 0
/* Load missing registry hives */
-// NtInitializeRegistry (FALSE);
+ NtInitializeRegistry (FALSE);
+#endif
/* Set environment variables from registry */
SmSetEnvironmentVariables ();
-//#if 0
/* Load the kernel mode driver win32k.sys */
RtlInitUnicodeString (&CmdLineW,
L"\\??\\C:\\reactos\\system32\\drivers\\win32k.sys");
{
return FALSE;
}
-//#endif
-#if 0
+#ifdef RUN_CSRSS
/* Start the Win32 subsystem (csrss.exe) */
DisplayString (L"SM: Executing csrss.exe\n");
NULL,
FALSE,
0,
- NULL,
- &Children[CHILD_CSRSS],
- NULL);
+ 0,
+ 0,
+ &ProcessInfo);
+
+ RtlDestroyProcessParameters (ProcessParameters);
+
if (!NT_SUCCESS(Status))
{
DisplayString (L"SM: Loading csrss.exe failed!\n");
return FALSE;
}
-
- RtlDestroyProcessParameters (ProcessParameters);
-#endif
+ Children[CHILD_CSRSS] = ProcessInfo.ProcessHandle;
+#endif /* RUN_CSRSS */
/* Start the simple shell (shell.exe) */
L"\\??\\C:\\reactos\\system32\\shell.exe");
#if 0
/* Start the logon process (winlogon.exe) */
- RtlInitUnicodeString (&CmdLineW,
+ DisplayString (L"SM: Running winlogon\n");
+ RtlInitUnicodeString (&UnicodeString,
L"\\??\\C:\\reactos\\system32\\winlogon.exe");
#endif
NULL,
FALSE,
0,
- NULL,
- &Children[CHILD_WINLOGON],
- NULL);
+ 0,
+ 0,
+ &ProcessInfo);
RtlDestroyProcessParameters (ProcessParameters);
#endif
return FALSE;
}
+ Children[CHILD_WINLOGON] = ProcessInfo.ProcessHandle;
/* Create the \DbgSsApiPort object (LPC) */
RtlInitUnicodeString (&UnicodeString,