mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
[win32k]
- Use the parse context to store whether or not the desktop object was created. If the object was not created, NtUserCreateDesktop should return immediately (this can happen if it didn't exist) - Before this , if the desktop already exited, we opened the existing desktop and initialized it again. We also created another desktop heap, desktop window, etc.. This fact confused threads using this desktop and caused problems like the assertion we see in the test suite svn path=/trunk/; revision=55517
This commit is contained in:
parent
672c617e8c
commit
9cde5acdc8
|
@ -67,6 +67,10 @@ IntDesktopObjectParse(IN PVOID ParseObject,
|
|||
PLIST_ENTRY NextEntry, ListHead;
|
||||
PWINSTATION_OBJECT WinStaObject = (PWINSTATION_OBJECT)ParseObject;
|
||||
PUNICODE_STRING DesktopName;
|
||||
PBOOLEAN pContext = (PBOOLEAN) Context;
|
||||
|
||||
if(pContext)
|
||||
*pContext = FALSE;
|
||||
|
||||
/* Set the list pointers and loop the window station */
|
||||
ListHead = &WinStaObject->DesktopListHead;
|
||||
|
@ -144,6 +148,7 @@ IntDesktopObjectParse(IN PVOID ParseObject,
|
|||
|
||||
/* Set the desktop object and return success */
|
||||
*Object = Desktop;
|
||||
*pContext = TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -844,7 +849,7 @@ NtUserCreateDesktop(
|
|||
CSR_API_MESSAGE Request;
|
||||
PVOID DesktopHeapSystemBase = NULL;
|
||||
SIZE_T DesktopInfoSize;
|
||||
ULONG DummyContext;
|
||||
BOOLEAN Context;
|
||||
ULONG_PTR HeapSize = 4 * 1024 * 1024; /* FIXME */
|
||||
UNICODE_STRING ClassName;
|
||||
LARGE_STRING WindowName;
|
||||
|
@ -880,10 +885,12 @@ NtUserCreateDesktop(
|
|||
UserMode,
|
||||
NULL,
|
||||
dwDesiredAccess,
|
||||
(PVOID)&DummyContext,
|
||||
(PVOID)&Context,
|
||||
(HANDLE*)&Desktop);
|
||||
if (!NT_SUCCESS(Status)) RETURN(NULL);
|
||||
if (Status == STATUS_OBJECT_NAME_EXISTS)
|
||||
|
||||
/* In case the object was not created (eg if it existed), return now */
|
||||
if (Context == FALSE)
|
||||
{
|
||||
RETURN( Desktop);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue