mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[WIN32K] Init User part after GDI one.
But Initialize user lock first thing to avoid hitting newly introduced ASSERTS
This partly reverts commit 515d83a883
.
This commit is contained in:
parent
c0c9b1445d
commit
0bc00267df
3 changed files with 35 additions and 19 deletions
|
@ -896,6 +896,21 @@ DriverUnload(IN PDRIVER_OBJECT DriverObject)
|
|||
} \
|
||||
}
|
||||
|
||||
// Lock & return on failure
|
||||
#define USERLOCK_AND_ROF(x) \
|
||||
{ \
|
||||
UserEnterExclusive(); \
|
||||
Status = (x); \
|
||||
UserLeave(); \
|
||||
if (!NT_SUCCESS(Status)) \
|
||||
{ \
|
||||
DPRINT1("Failed '%s' (0x%lx)\n", #x, Status); \
|
||||
return Status; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This definition doesn't work
|
||||
*/
|
||||
|
@ -968,7 +983,24 @@ DriverEntry(
|
|||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
NT_ROF(InitUserImpl());
|
||||
/* Init the global user lock */
|
||||
ExInitializeResourceLite(&UserLock);
|
||||
|
||||
/* Lock while we use the heap (UserHeapAlloc asserts on this) */
|
||||
UserEnterExclusive();
|
||||
|
||||
/* Allocate global server info structure */
|
||||
gpsi = UserHeapAlloc(sizeof(*gpsi));
|
||||
UserLeave();
|
||||
if (!gpsi)
|
||||
{
|
||||
DPRINT1("Failed allocate server info structure!\n");
|
||||
UserLeave();
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
RtlZeroMemory(gpsi, sizeof(*gpsi));
|
||||
DPRINT("Global Server Data -> %p\n", gpsi);
|
||||
|
||||
NT_ROF(InitGdiHandleTable());
|
||||
NT_ROF(InitPaletteImpl());
|
||||
|
@ -983,6 +1015,7 @@ DriverEntry(
|
|||
NT_ROF(InitLDEVImpl());
|
||||
NT_ROF(InitDeviceImpl());
|
||||
NT_ROF(InitDcImpl());
|
||||
USERLOCK_AND_ROF(InitUserImpl());
|
||||
NT_ROF(InitWindowStationImpl());
|
||||
NT_ROF(InitDesktopImpl());
|
||||
NT_ROF(InitInputImpl());
|
||||
|
|
|
@ -79,22 +79,6 @@ InitUserImpl(VOID)
|
|||
NTSTATUS Status;
|
||||
HKEY hKey;
|
||||
|
||||
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");
|
||||
|
@ -122,8 +106,6 @@ InitUserImpl(VOID)
|
|||
|
||||
InitSysParams();
|
||||
|
||||
UserLeave();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ extern BOOL g_AlwaysDisplayVersion;
|
|||
extern ATOM gaGuiConsoleWndClass;
|
||||
extern ATOM AtomDDETrack;
|
||||
extern ATOM AtomQOS;
|
||||
extern ERESOURCE UserLock;
|
||||
|
||||
CODE_SEG("INIT") NTSTATUS NTAPI InitUserImpl(VOID);
|
||||
VOID FASTCALL CleanupUserImpl(VOID);
|
||||
|
|
Loading…
Reference in a new issue