mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
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:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <ntos/minmax.h>
|
||||
#include <reactos/resource.h>
|
||||
#include <rosrtl/string.h>
|
||||
|
||||
#include "usetup.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
|
||||
NtProcessStartup(PPEB Peb)
|
||||
{
|
||||
@@ -3702,6 +3740,8 @@ NtProcessStartup(PPEB Peb)
|
||||
|
||||
ProcessHeap = Peb->ProcessHeap;
|
||||
|
||||
SignalInitEvent();
|
||||
|
||||
Status = AllocConsole();
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user