Author: gadamopoulos
Date: Sun Feb 12 10:13:16 2012
New Revision: 55556
URL:
http://svn.reactos.org/svn/reactos?rev=55556&view=rev
Log:
[win32k]
- Initilize ExDesktopObjectType->TypeInfo.ValidAccessMask and
ExWindowStationObjectType->TypeInfo.ValidAccessMask to let win32k use access checks to
desktop and window station objects
- When opening a desktop and window station during THREADINFO initialization, give full
access to the objects
Modified:
trunk/reactos/subsystems/win32/win32k/include/desktop.h
trunk/reactos/subsystems/win32/win32k/include/winsta.h
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
Modified: trunk/reactos/subsystems/win32/win32k/include/desktop.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] Sun Feb 12
10:13:16 2012
@@ -39,6 +39,32 @@
#define DF_DESKWNDDESTROYED 0x00010000
#define DF_DYING 0x00020000
+#define DESKTOP_READ STANDARD_RIGHTS_READ | \
+ DESKTOP_ENUMERATE | \
+ DESKTOP_READOBJECTS
+
+#define DESKTOP_WRITE STANDARD_RIGHTS_WRITE | \
+ DESKTOP_CREATEMENU | \
+ DESKTOP_CREATEWINDOW | \
+ DESKTOP_HOOKCONTROL | \
+ DESKTOP_JOURNALPLAYBACK | \
+ DESKTOP_JOURNALRECORD | \
+ DESKTOP_WRITEOBJECTS
+
+#define DESKTOP_EXECUTE STANDARD_RIGHTS_EXECUTE | \
+ DESKTOP_SWITCHDESKTOP
+
+#define DESKTOP_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | \
+ DESKTOP_CREATEMENU | \
+ DESKTOP_CREATEWINDOW | \
+ DESKTOP_ENUMERATE | \
+ DESKTOP_HOOKCONTROL | \
+ DESKTOP_JOURNALPLAYBACK | \
+ DESKTOP_JOURNALRECORD | \
+ DESKTOP_READOBJECTS | \
+ DESKTOP_SWITCHDESKTOP | \
+ DESKTOP_WRITEOBJECTS
+
extern PDESKTOP InputDesktop;
extern HDESK InputDesktopHandle;
extern PCLS DesktopWindowClass;
Modified: trunk/reactos/subsystems/win32/win32k/include/winsta.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] Sun Feb 12
10:13:16 2012
@@ -69,6 +69,32 @@
extern PPROCESSINFO LogonProcess;
extern HWND hwndSAS;
+#define WINSTA_READ STANDARD_RIGHTS_READ | \
+ WINSTA_ENUMDESKTOPS | \
+ WINSTA_ENUMERATE | \
+ WINSTA_READATTRIBUTES | \
+ WINSTA_READSCREEN
+
+#define WINSTA_WRITE STANDARD_RIGHTS_WRITE | \
+ WINSTA_ACCESSCLIPBOARD | \
+ WINSTA_CREATEDESKTOP | \
+ WINSTA_WRITEATTRIBUTES
+
+#define WINSTA_EXECUTE STANDARD_RIGHTS_EXECUTE | \
+ WINSTA_ACCESSGLOBALATOMS | \
+ WINSTA_EXITWINDOWS
+
+#define WINSTA_ACCESS_ALL STANDARD_RIGHTS_REQUIRED | \
+ WINSTA_ACCESSCLIPBOARD | \
+ WINSTA_ACCESSGLOBALATOMS | \
+ WINSTA_CREATEDESKTOP | \
+ WINSTA_ENUMDESKTOPS | \
+ WINSTA_ENUMERATE | \
+ WINSTA_EXITWINDOWS | \
+ WINSTA_READATTRIBUTES | \
+ WINSTA_READSCREEN | \
+ WINSTA_WRITEATTRIBUTES
+
INIT_FUNCTION
NTSTATUS
NTAPI
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sun Feb 12
10:13:16 2012
@@ -23,28 +23,6 @@
PDESKTOP InputDesktop = NULL;
HDESK InputDesktopHandle = NULL;
HDC ScreenDeviceContext = NULL;
-
-GENERIC_MAPPING IntDesktopMapping =
-{
- STANDARD_RIGHTS_READ | DESKTOP_ENUMERATE |
- DESKTOP_READOBJECTS,
- STANDARD_RIGHTS_WRITE | DESKTOP_CREATEMENU |
- DESKTOP_CREATEWINDOW |
- DESKTOP_HOOKCONTROL |
- DESKTOP_JOURNALPLAYBACK |
- DESKTOP_JOURNALRECORD |
- DESKTOP_WRITEOBJECTS,
- STANDARD_RIGHTS_EXECUTE | DESKTOP_SWITCHDESKTOP,
- STANDARD_RIGHTS_REQUIRED | DESKTOP_CREATEMENU |
- DESKTOP_CREATEWINDOW |
- DESKTOP_ENUMERATE |
- DESKTOP_HOOKCONTROL |
- DESKTOP_JOURNALPLAYBACK |
- DESKTOP_JOURNALRECORD |
- DESKTOP_READOBJECTS |
- DESKTOP_SWITCHDESKTOP |
- DESKTOP_WRITEOBJECTS
-};
/* OBJECT CALLBACKS **********************************************************/
@@ -195,9 +173,15 @@
NTAPI
InitDesktopImpl(VOID)
{
+ GENERIC_MAPPING IntDesktopMapping = { DESKTOP_READ,
+ DESKTOP_WRITE,
+ DESKTOP_EXECUTE,
+ DESKTOP_ALL_ACCESS};
+
/* Set Desktop Object Attributes */
ExDesktopObjectType->TypeInfo.DefaultNonPagedPoolCharge = sizeof(DESKTOP);
ExDesktopObjectType->TypeInfo.GenericMapping = IntDesktopMapping;
+ ExDesktopObjectType->TypeInfo.ValidAccessMask = DESKTOP_ALL_ACCESS;
return STATUS_SUCCESS;
}
@@ -346,7 +330,7 @@
ExWindowStationObjectType,
KernelMode,
NULL,
- 0,
+ WINSTA_ACCESS_ALL,
NULL,
(HANDLE*)hWinSta);
@@ -380,7 +364,7 @@
ExDesktopObjectType,
KernelMode,
NULL,
- 0,
+ DESKTOP_ALL_ACCESS,
NULL,
(HANDLE*)hDesktop);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] Sun Feb 12 10:13:16
2012
@@ -22,17 +22,6 @@
/* INITALIZATION FUNCTIONS ****************************************************/
-static GENERIC_MAPPING IntWindowStationMapping =
- {
- STANDARD_RIGHTS_READ | WINSTA_ENUMDESKTOPS | WINSTA_ENUMERATE |
WINSTA_READATTRIBUTES | WINSTA_READSCREEN,
- STANDARD_RIGHTS_WRITE | WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP |
WINSTA_WRITEATTRIBUTES,
- STANDARD_RIGHTS_EXECUTE | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS,
- STANDARD_RIGHTS_REQUIRED | WINSTA_ACCESSCLIPBOARD | WINSTA_ACCESSGLOBALATOMS |
WINSTA_CREATEDESKTOP |
- WINSTA_ENUMDESKTOPS | WINSTA_ENUMERATE | WINSTA_EXITWINDOWS |
- WINSTA_READATTRIBUTES | WINSTA_READSCREEN | WINSTA_WRITEATTRIBUTES
- };
-
-
INIT_FUNCTION
NTSTATUS
NTAPI
@@ -42,14 +31,17 @@
HANDLE WindowStationsDirectory;
UNICODE_STRING UnicodeString;
NTSTATUS Status;
+ GENERIC_MAPPING IntWindowStationMapping = { WINSTA_READ,
+ WINSTA_WRITE,
+ WINSTA_EXECUTE,
+ WINSTA_ACCESS_ALL};
/*
* Create the '\Windows\WindowStations' directory
*/
RtlInitUnicodeString(&UnicodeString, WINSTA_ROOT_NAME);
- InitializeObjectAttributes(&ObjectAttributes, &UnicodeString,
- 0, NULL, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &UnicodeString, 0, NULL, NULL);
Status = ZwCreateDirectoryObject(&WindowStationsDirectory, 0,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
@@ -62,6 +54,7 @@
/* Set Winsta Object Attributes */
ExWindowStationObjectType->TypeInfo.DefaultNonPagedPoolCharge =
sizeof(WINSTATION_OBJECT);
ExWindowStationObjectType->TypeInfo.GenericMapping = IntWindowStationMapping;
+ ExWindowStationObjectType->TypeInfo.ValidAccessMask = WINSTA_ACCESS_ALL;
return STATUS_SUCCESS;
}