Signal the ReactOSInitDone event like smss.exe does,

prevents bugcheck when usetup is done in less than 120 sec

svn path=/trunk/; revision=12904
This commit is contained in:
Gé van Geldorp 2005-01-09 08:20:28 +00:00
parent 5e6907f665
commit 2929a492fd

View file

@ -31,6 +31,7 @@
#include <ntos/minmax.h> #include <ntos/minmax.h>
#include <reactos/resource.h> #include <reactos/resource.h>
#include <rosrtl/string.h>
#include "usetup.h" #include "usetup.h"
#include "console.h" #include "console.h"
@ -3691,6 +3692,43 @@ FlushPage(PINPUT_RECORD Ir)
} }
static VOID
SignalInitEvent()
{
NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING UnicodeString;
HANDLE ReactOSInitEvent;
RtlRosInitUnicodeStringFromLiteral(&UnicodeString, L"\\ReactOSInitDone");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
EVENT_ALL_ACCESS,
0,
NULL);
Status = NtOpenEvent(&ReactOSInitEvent,
EVENT_ALL_ACCESS,
&ObjectAttributes);
if (NT_SUCCESS(Status))
{
LARGE_INTEGER Timeout;
/* This will cause the boot screen image to go away (if displayed) */
NtPulseEvent(ReactOSInitEvent, NULL);
/* Wait for the display mode to be changed (if in graphics mode) */
Timeout.QuadPart = -50000000LL; /* 5 second timeout */
NtWaitForSingleObject(ReactOSInitEvent, FALSE, &Timeout);
NtClose(ReactOSInitEvent);
}
else
{
/* We don't really care if this fails */
DPRINT1("USETUP: Failed to open ReactOS init notification event\n");
}
}
VOID STDCALL VOID STDCALL
NtProcessStartup(PPEB Peb) NtProcessStartup(PPEB Peb)
{ {
@ -3702,6 +3740,8 @@ NtProcessStartup(PPEB Peb)
ProcessHeap = Peb->ProcessHeap; ProcessHeap = Peb->ProcessHeap;
SignalInitEvent();
Status = AllocConsole(); Status = AllocConsole();
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {