mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Replaced hard-coded paths
svn path=/trunk/; revision=1456
This commit is contained in:
parent
07127c18af
commit
2af149a27c
1 changed files with 55 additions and 23 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: winlogon.c,v 1.2 2000/12/05 18:11:51 ekohl Exp $
|
/* $Id: winlogon.c,v 1.3 2000/12/08 00:45:04 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -29,20 +29,19 @@ BOOLEAN StartServices(VOID)
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
STARTUPINFO StartupInfo;
|
STARTUPINFO StartupInfo;
|
||||||
PROCESS_INFORMATION ProcessInformation;
|
PROCESS_INFORMATION ProcessInformation;
|
||||||
|
CHAR CommandLine[MAX_PATH];
|
||||||
ServicesInitEvent = CreateEvent(NULL,
|
DWORD Count;
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
"\\ServicesInitDone");
|
|
||||||
|
|
||||||
if (ServicesInitEvent == NULL)
|
|
||||||
{
|
|
||||||
DbgPrint("Failed to create services notification event\n");
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Start the service control manager (services.exe) */
|
/* Start the service control manager (services.exe) */
|
||||||
DbgPrint("WL: Running services.exe\n");
|
OutputDebugString("WL: Running services.exe\n");
|
||||||
|
// DbgPrint("WL: Running services.exe\n");
|
||||||
|
|
||||||
|
GetSystemDirectory(CommandLine, MAX_PATH);
|
||||||
|
strcat(CommandLine, "\\services.exe");
|
||||||
|
|
||||||
|
DbgPrint("WL: ");
|
||||||
|
DbgPrint(CommandLine);
|
||||||
|
DbgPrint("\n");
|
||||||
|
|
||||||
StartupInfo.cb = sizeof(StartupInfo);
|
StartupInfo.cb = sizeof(StartupInfo);
|
||||||
StartupInfo.lpReserved = NULL;
|
StartupInfo.lpReserved = NULL;
|
||||||
|
@ -52,12 +51,12 @@ BOOLEAN StartServices(VOID)
|
||||||
StartupInfo.cbReserved2 = 0;
|
StartupInfo.cbReserved2 = 0;
|
||||||
StartupInfo.lpReserved2 = 0;
|
StartupInfo.lpReserved2 = 0;
|
||||||
|
|
||||||
Result = CreateProcess("C:\\reactos\\system32\\services.exe",
|
Result = CreateProcess(CommandLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
DETACHED_PROCESS,
|
0, //DETACHED_PROCESS,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&StartupInfo,
|
&StartupInfo,
|
||||||
|
@ -68,8 +67,23 @@ BOOLEAN StartServices(VOID)
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wait for event creation (by SCM) for max. 20 seconds */
|
||||||
DbgPrint("WL: Waiting for services\n");
|
DbgPrint("WL: Waiting for services\n");
|
||||||
|
for (Count = 0; Count < 20; Count++)
|
||||||
|
{
|
||||||
|
Sleep(1000);
|
||||||
|
|
||||||
|
ServicesInitEvent = OpenEvent(EVENT_ALL_ACCESS, //SYNCHRONIZE,
|
||||||
|
FALSE,
|
||||||
|
"\\SvcctrlStartEvent_A3725DX");
|
||||||
|
if (ServicesInitEvent)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wait for event signalization */
|
||||||
|
DbgPrint("WL: Waiting for services initialization\n");
|
||||||
WaitForSingleObject(ServicesInitEvent, INFINITE);
|
WaitForSingleObject(ServicesInitEvent, INFINITE);
|
||||||
|
CloseHandle(ServicesInitEvent);
|
||||||
|
|
||||||
DbgPrint("WL: Finished waiting for services\n");
|
DbgPrint("WL: Finished waiting for services\n");
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
@ -81,6 +95,7 @@ BOOLEAN StartLsass(VOID)
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
STARTUPINFO StartupInfo;
|
STARTUPINFO StartupInfo;
|
||||||
PROCESS_INFORMATION ProcessInformation;
|
PROCESS_INFORMATION ProcessInformation;
|
||||||
|
CHAR CommandLine[MAX_PATH];
|
||||||
|
|
||||||
LsassInitEvent = CreateEvent(NULL,
|
LsassInitEvent = CreateEvent(NULL,
|
||||||
TRUE,
|
TRUE,
|
||||||
|
@ -96,6 +111,9 @@ BOOLEAN StartLsass(VOID)
|
||||||
/* Start the local security authority subsystem (lsass.exe) */
|
/* Start the local security authority subsystem (lsass.exe) */
|
||||||
DbgPrint("WL: Running lsass.exe\n");
|
DbgPrint("WL: Running lsass.exe\n");
|
||||||
|
|
||||||
|
GetSystemDirectory(CommandLine, MAX_PATH);
|
||||||
|
strcat(CommandLine, "\\lsass.exe");
|
||||||
|
|
||||||
StartupInfo.cb = sizeof(StartupInfo);
|
StartupInfo.cb = sizeof(StartupInfo);
|
||||||
StartupInfo.lpReserved = NULL;
|
StartupInfo.lpReserved = NULL;
|
||||||
StartupInfo.lpDesktop = NULL;
|
StartupInfo.lpDesktop = NULL;
|
||||||
|
@ -104,7 +122,7 @@ BOOLEAN StartLsass(VOID)
|
||||||
StartupInfo.cbReserved2 = 0;
|
StartupInfo.cbReserved2 = 0;
|
||||||
StartupInfo.lpReserved2 = 0;
|
StartupInfo.lpReserved2 = 0;
|
||||||
|
|
||||||
Result = CreateProcess("C:\\reactos\\system32\\lsass.exe",
|
Result = CreateProcess(CommandLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -122,6 +140,7 @@ BOOLEAN StartLsass(VOID)
|
||||||
|
|
||||||
DbgPrint("WL: Waiting for lsass\n");
|
DbgPrint("WL: Waiting for lsass\n");
|
||||||
WaitForSingleObject(LsassInitEvent, INFINITE);
|
WaitForSingleObject(LsassInitEvent, INFINITE);
|
||||||
|
CloseHandle(LsassInitEvent);
|
||||||
|
|
||||||
DbgPrint("WL: Finished waiting for lsass\n");
|
DbgPrint("WL: Finished waiting for lsass\n");
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
@ -132,7 +151,16 @@ VOID DoLoginUser(PCHAR Name, PCHAR Password)
|
||||||
PROCESS_INFORMATION ProcessInformation;
|
PROCESS_INFORMATION ProcessInformation;
|
||||||
STARTUPINFO StartupInfo;
|
STARTUPINFO StartupInfo;
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
|
CHAR CommandLine[MAX_PATH];
|
||||||
|
CHAR CurrentDirectory[MAX_PATH];
|
||||||
|
|
||||||
|
DbgPrint("WL: Running shell.exe\n");
|
||||||
|
|
||||||
|
GetSystemDirectory(CommandLine, MAX_PATH);
|
||||||
|
strcat(CommandLine, "\\shell.exe");
|
||||||
|
|
||||||
|
GetWindowsDirectory(CurrentDirectory, MAX_PATH);
|
||||||
|
|
||||||
StartupInfo.cb = sizeof(StartupInfo);
|
StartupInfo.cb = sizeof(StartupInfo);
|
||||||
StartupInfo.lpReserved = NULL;
|
StartupInfo.lpReserved = NULL;
|
||||||
StartupInfo.lpDesktop = NULL;
|
StartupInfo.lpDesktop = NULL;
|
||||||
|
@ -141,14 +169,14 @@ VOID DoLoginUser(PCHAR Name, PCHAR Password)
|
||||||
StartupInfo.cbReserved2 = 0;
|
StartupInfo.cbReserved2 = 0;
|
||||||
StartupInfo.lpReserved2 = 0;
|
StartupInfo.lpReserved2 = 0;
|
||||||
|
|
||||||
Result = CreateProcess("C:\\reactos\\system32\\shell.exe",
|
Result = CreateProcess(CommandLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
DETACHED_PROCESS,
|
DETACHED_PROCESS,
|
||||||
NULL,
|
NULL,
|
||||||
"C:\\reactos",
|
CurrentDirectory,
|
||||||
&StartupInfo,
|
&StartupInfo,
|
||||||
&ProcessInformation);
|
&ProcessInformation);
|
||||||
if (!Result)
|
if (!Result)
|
||||||
|
@ -180,11 +208,14 @@ WinMain(HINSTANCE hInstance,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: Create WindowStations here. At the moment lsass and services
|
* FIXME: Create WindowStations here. At the moment lsass and services
|
||||||
* share ours
|
* share ours. Create a new console intead.
|
||||||
*/
|
*/
|
||||||
|
AllocConsole();
|
||||||
|
|
||||||
|
/* start system processes (services.exe & lsass.exe) */
|
||||||
#if 0
|
#if 0
|
||||||
StartLsass();
|
|
||||||
StartServices();
|
StartServices();
|
||||||
|
StartLsass();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: What name does the real WinLogon use? */
|
/* FIXME: What name does the real WinLogon use? */
|
||||||
|
@ -198,9 +229,6 @@ WinMain(HINSTANCE hInstance,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* smss wouldn't have created a console for us */
|
|
||||||
AllocConsole();
|
|
||||||
|
|
||||||
/* Main loop */
|
/* Main loop */
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -242,4 +270,8 @@ WinMain(HINSTANCE hInstance,
|
||||||
|
|
||||||
DoLoginUser(LoginName, Password);
|
DoLoginUser(LoginName, Password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExitProcess(0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue