Author: gadamopoulos
Date: Wed Oct 31 16:19:48 2012
New Revision: 57659
URL:
http://svn.reactos.org/svn/reactos?rev=57659&view=rev
Log:
[win32k]
- Remove InputDesktopHandle variable because it is a handle and that means that it can
only be used in the context of winlogon
- Fixes NtUserOpenInputDesktop which never really worked
Modified:
trunk/reactos/win32ss/user/ntuser/desktop.c
trunk/reactos/win32ss/user/ntuser/desktop.h
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Wed Oct 31 16:19:48 2012
@@ -27,7 +27,6 @@
/* Currently active desktop */
PDESKTOP gpdeskInputDesktop = NULL;
-HDESK InputDesktopHandle = NULL;
HDC ScreenDeviceContext = NULL;
PTHREADINFO gptiDesktopThread;
HCURSOR gDesktopCursor = NULL;
@@ -1464,40 +1463,31 @@
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
{
- PDESKTOP pdesk;
NTSTATUS Status;
HDESK hdesk = NULL;
+ ULONG HandleAttributes = 0;
UserEnterExclusive();
- TRACE("Enter NtUserOpenInputDesktop InputDesktopHandle
0x%p\n",InputDesktopHandle);
-
- /* Get a pointer to the desktop object */
- Status = IntValidateDesktopHandle(InputDesktopHandle, UserMode, 0, &pdesk);
- if (!NT_SUCCESS(Status))
- {
- ERR("Validation of input desktop handle (0x%p) failed\n",
InputDesktopHandle);
- goto Exit;
- }
+ TRACE("Enter NtUserOpenInputDesktop gpdeskInputDesktop
0x%p\n",gpdeskInputDesktop);
+
+ if(fInherit) HandleAttributes = OBJ_INHERIT;
/* Create a new handle to the object */
Status = ObOpenObjectByPointer(
- pdesk,
- 0,
+ gpdeskInputDesktop,
+ HandleAttributes,
NULL,
dwDesiredAccess,
ExDesktopObjectType,
UserMode,
(PHANDLE)&hdesk);
- ObDereferenceObject(pdesk);
-
if (!NT_SUCCESS(Status))
{
ERR("Failed to open input desktop object\n");
SetLastNtError(Status);
- goto Exit;
- }
-Exit:
+ }
+
TRACE("NtUserOpenInputDesktop returning 0x%p\n",hdesk);
UserLeave();
return hdesk;
@@ -1655,8 +1645,7 @@
/* Set the global state. */
gpdeskInputDesktop = pdesk;
- InputDesktopHandle = hdesk;
- TRACE("SwitchDesktop InputDesktopHandle 0x%p\n",InputDesktopHandle);
+ TRACE("SwitchDesktop gpdeskInputDesktop 0x%p\n",gpdeskInputDesktop);
ObDereferenceObject(pdesk);
RETURN(TRUE);
Modified: trunk/reactos/win32ss/user/ntuser/desktop.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/desktop.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/desktop.h [iso-8859-1] Wed Oct 31 16:19:48 2012
@@ -70,7 +70,6 @@
DESKTOP_WRITEOBJECTS
extern PDESKTOP InputDesktop;
-extern HDESK InputDesktopHandle;
extern PCLS DesktopWindowClass;
extern HDC ScreenDeviceContext;
extern PTHREADINFO gptiDesktopThread;