[WIN32K] On init, start by initializing NtUser stuff

Allocate gpsi (Global Server Info) after initializing & grabbing Userlock
This commit is contained in:
Jérôme Gardou 2021-07-30 15:38:10 +02:00 committed by Jérôme Gardou
parent be6a6b806a
commit 515d83a883
2 changed files with 17 additions and 11 deletions

View File

@ -968,16 +968,7 @@ DriverEntry(
return STATUS_UNSUCCESSFUL;
}
/* Allocate global server info structure */
gpsi = UserHeapAlloc(sizeof(*gpsi));
if (!gpsi)
{
DPRINT1("Failed allocate server info structure!\n");
return STATUS_UNSUCCESSFUL;
}
RtlZeroMemory(gpsi, sizeof(*gpsi));
DPRINT("Global Server Data -> %p\n", gpsi);
NT_ROF(InitUserImpl());
NT_ROF(InitGdiHandleTable());
NT_ROF(InitPaletteImpl());
@ -992,7 +983,6 @@ DriverEntry(
NT_ROF(InitLDEVImpl());
NT_ROF(InitDeviceImpl());
NT_ROF(InitDcImpl());
NT_ROF(InitUserImpl());
NT_ROF(InitWindowStationImpl());
NT_ROF(InitDesktopImpl());
NT_ROF(InitInputImpl());

View File

@ -81,6 +81,20 @@ InitUserImpl(VOID)
ExInitializeResourceLite(&UserLock);
/* Hold global resource to make sanity checks happy. */
UserEnterExclusive();
/* Allocate global server info structure */
gpsi = UserHeapAlloc(sizeof(*gpsi));
if (!gpsi)
{
ERR("Failed allocate server info structure!\n");
return STATUS_UNSUCCESSFUL;
}
RtlZeroMemory(gpsi, sizeof(*gpsi));
TRACE("Global Server Data -> %p\n", gpsi);
if (!UserCreateHandleTable())
{
ERR("Failed creating handle table\n");
@ -108,6 +122,8 @@ InitUserImpl(VOID)
InitSysParams();
UserLeave();
return STATUS_SUCCESS;
}