Run winlogon.exe instead of shell.exe

Replaced hard-coded paths

svn path=/trunk/; revision=1452
This commit is contained in:
Eric Kohl 2000-12-05 18:14:07 +00:00
parent 3ab0b1f9a2
commit d8748695f2

View file

@ -1,4 +1,4 @@
/* $Id: init.c,v 1.19 2000/10/09 00:18:00 ekohl Exp $ /* $Id: init.c,v 1.20 2000/12/05 18:14:07 ekohl Exp $
* *
* init.c - Session Manager initialization * init.c - Session Manager initialization
* *
@ -167,10 +167,13 @@ BOOL InitSessionManager (HANDLE Children[])
UNICODE_STRING UnicodeString; UNICODE_STRING UnicodeString;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING CmdLineW; UNICODE_STRING CmdLineW;
UNICODE_STRING CurrentDirectoryW;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters; PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
RTL_USER_PROCESS_INFO ProcessInfo; RTL_USER_PROCESS_INFO ProcessInfo;
HANDLE CsrssInitEvent; HANDLE CsrssInitEvent;
WCHAR UnicodeBuffer[MAX_PATH];
PKUSER_SHARED_DATA SharedUserData =
(PKUSER_SHARED_DATA)USER_SHARED_DATA_BASE;
/* Create the "\SmApiPort" object (LPC) */ /* Create the "\SmApiPort" object (LPC) */
RtlInitUnicodeString (&UnicodeString, RtlInitUnicodeString (&UnicodeString,
@ -275,20 +278,22 @@ BOOL InitSessionManager (HANDLE Children[])
DbgPrint("Failed to create csrss notification event\n"); DbgPrint("Failed to create csrss notification event\n");
} }
/* Start the Win32 subsystem (csrss.exe) */ /*
DisplayString (L"SM: Executing csrss.exe\n"); * Start the Win32 subsystem (csrss.exe)
*/
DisplayString (L"SM: Running csrss.exe\n");
/* initialize executable path */
wcscpy(UnicodeBuffer, L"\\??\\");
wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot);
wcscat(UnicodeBuffer, L"\\system32\\csrss.exe");
RtlInitUnicodeString (&UnicodeString, RtlInitUnicodeString (&UnicodeString,
L"\\??\\C:\\reactos\\system32\\csrss.exe"); UnicodeBuffer);
/* initialize current directory */
RtlInitUnicodeString (&CurrentDirectoryW,
L"C:\\reactos\\system32\\");
RtlCreateProcessParameters (&ProcessParameters, RtlCreateProcessParameters (&ProcessParameters,
&UnicodeString, &UnicodeString,
NULL, NULL,
&CurrentDirectoryW, NULL,
NULL, NULL,
SmSystemEnvironment, SmSystemEnvironment,
NULL, NULL,
@ -322,59 +327,52 @@ BOOL InitSessionManager (HANDLE Children[])
DbgPrint("SM: Finished waiting for csrss\n"); DbgPrint("SM: Finished waiting for csrss\n");
Children[CHILD_CSRSS] = ProcessInfo.ProcessHandle; Children[CHILD_CSRSS] = ProcessInfo.ProcessHandle;
/*
/* Start the simple shell (shell.exe) */ * Start the logon process (winlogon.exe)
DisplayString (L"SM: Executing shell\n"); */
RtlInitUnicodeString (&UnicodeString, DisplayString(L"SM: Running winlogon.exe\n");
L"\\??\\C:\\reactos\\system32\\shell.exe");
#if 0 /* initialize executable path */
/* Start the logon process (winlogon.exe) */ wcscpy(UnicodeBuffer, L"\\??\\");
DisplayString (L"SM: Running winlogon\n"); wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot);
RtlInitUnicodeString (&UnicodeString, wcscat(UnicodeBuffer, L"\\system32\\winlogon.exe");
L"\\??\\C:\\reactos\\system32\\winlogon.exe"); RtlInitUnicodeString (&UnicodeString,
#endif UnicodeBuffer);
/* initialize current directory (trailing backslash!!)*/ RtlCreateProcessParameters(&ProcessParameters,
RtlInitUnicodeString (&CurrentDirectoryW, &UnicodeString,
L"C:\\reactos\\"); NULL,
NULL,
RtlCreateProcessParameters (&ProcessParameters, NULL,
&UnicodeString, SmSystemEnvironment,
NULL, NULL,
&CurrentDirectoryW, NULL,
NULL, NULL,
SmSystemEnvironment, NULL);
NULL,
NULL, Status = RtlCreateUserProcess(&UnicodeString,
NULL, 0,
NULL); ProcessParameters,
NULL,
NULL,
Status = RtlCreateUserProcess (&UnicodeString, FALSE,
0, 0,
ProcessParameters, 0,
NULL, 0,
NULL, &ProcessInfo);
FALSE,
0, RtlDestroyProcessParameters(ProcessParameters);
0,
0, if (!NT_SUCCESS(Status))
&ProcessInfo); {
DisplayString(L"SM: Loading winlogon.exe failed!\n");
RtlDestroyProcessParameters (ProcessParameters); NtTerminateProcess(Children[CHILD_CSRSS],
0);
if (!NT_SUCCESS(Status)) return FALSE;
{ }
DisplayString (L"SM: Loading shell.exe failed!\n"); Children[CHILD_WINLOGON] = ProcessInfo.ProcessHandle;
#if 0
NtTerminateProcess (Children[CHILD_CSRSS],
0);
#endif
return FALSE;
}
Children[CHILD_WINLOGON] = ProcessInfo.ProcessHandle;
/* Create the \DbgSsApiPort object (LPC) */ /* Create the \DbgSsApiPort object (LPC) */
RtlInitUnicodeString (&UnicodeString, RtlInitUnicodeString (&UnicodeString,
L"\\DbgSsApiPort"); L"\\DbgSsApiPort");