3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/ex/win32k.c
6 * PURPOSE: Executive Win32 subsystem support
8 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) - Moved callbacks to win32k and cleanup.
9 * Casper S. Hornstrup (chorns@users.sourceforge.net)
14 #include <internal/debug.h>
16 /* DATA **********************************************************************/
18 POBJECT_TYPE EXPORTED ExWindowStationObjectType
= NULL
;
19 POBJECT_TYPE EXPORTED ExDesktopObjectType
= NULL
;
21 static GENERIC_MAPPING ExpWindowStationMapping
= {
23 STANDARD_RIGHTS_READ
| WINSTA_ENUMDESKTOPS
| WINSTA_ENUMERATE
| WINSTA_READATTRIBUTES
| WINSTA_READSCREEN
,
24 STANDARD_RIGHTS_WRITE
| WINSTA_ACCESSCLIPBOARD
| WINSTA_CREATEDESKTOP
| WINSTA_WRITEATTRIBUTES
,
25 STANDARD_RIGHTS_EXECUTE
| WINSTA_ACCESSGLOBALATOMS
| WINSTA_EXITWINDOWS
,
26 STANDARD_RIGHTS_REQUIRED
| WINSTA_ACCESSCLIPBOARD
| WINSTA_ACCESSGLOBALATOMS
| WINSTA_CREATEDESKTOP
|
27 WINSTA_ENUMDESKTOPS
| WINSTA_ENUMERATE
| WINSTA_EXITWINDOWS
|
28 WINSTA_READATTRIBUTES
| WINSTA_READSCREEN
| WINSTA_WRITEATTRIBUTES
31 static GENERIC_MAPPING ExpDesktopMapping
= {
33 STANDARD_RIGHTS_READ
| DESKTOP_ENUMERATE
| DESKTOP_READOBJECTS
,
34 STANDARD_RIGHTS_WRITE
| DESKTOP_CREATEMENU
| DESKTOP_CREATEWINDOW
| DESKTOP_HOOKCONTROL
|
35 DESKTOP_JOURNALPLAYBACK
| DESKTOP_JOURNALRECORD
| DESKTOP_WRITEOBJECTS
,
36 STANDARD_RIGHTS_EXECUTE
| DESKTOP_SWITCHDESKTOP
,
37 STANDARD_RIGHTS_REQUIRED
| DESKTOP_CREATEMENU
| DESKTOP_CREATEWINDOW
| DESKTOP_ENUMERATE
|
38 DESKTOP_HOOKCONTROL
| DESKTOP_JOURNALPLAYBACK
| DESKTOP_JOURNALRECORD
|
39 DESKTOP_READOBJECTS
| DESKTOP_SWITCHDESKTOP
| DESKTOP_WRITEOBJECTS
42 OBJECT_CREATE_ROUTINE ExpWindowStationObjectCreate
= NULL
;
43 OBJECT_PARSE_ROUTINE ExpWindowStationObjectParse
= NULL
;
44 OBJECT_DELETE_ROUTINE ExpWindowStationObjectDelete
= NULL
;
45 OBJECT_FIND_ROUTINE ExpWindowStationObjectFind
= NULL
;
46 OBJECT_CREATE_ROUTINE ExpDesktopObjectCreate
= NULL
;
47 OBJECT_DELETE_ROUTINE ExpDesktopObjectDelete
= NULL
;
49 /* FUNCTIONS ****************************************************************/
53 ExpWinStaObjectCreate(PVOID ObjectBody
,
56 struct _OBJECT_ATTRIBUTES
* ObjectAttributes
)
58 /* Call the Registered Callback */
59 return ExpWindowStationObjectCreate(ObjectBody
,
67 ExpWinStaObjectDelete(PVOID DeletedObject
)
69 /* Call the Registered Callback */
70 ExpWindowStationObjectDelete(DeletedObject
);
75 ExpWinStaObjectFind(PWINSTATION_OBJECT WinStaObject
,
79 /* Call the Registered Callback */
80 return ExpWindowStationObjectFind(WinStaObject
,
87 ExpWinStaObjectParse(PVOID Object
,
89 PUNICODE_STRING FullPath
,
93 /* Call the Registered Callback */
94 return ExpWindowStationObjectParse(Object
,
103 ExpDesktopCreate(PVOID ObjectBody
,
106 struct _OBJECT_ATTRIBUTES
* ObjectAttributes
)
108 /* Call the Registered Callback */
109 return ExpDesktopObjectCreate(ObjectBody
,
117 ExpDesktopDelete(PVOID DeletedObject
)
119 /* Call the Registered Callback */
120 ExpDesktopObjectDelete(DeletedObject
);
127 /* Create window station object type */
128 ExWindowStationObjectType
= ExAllocatePool(NonPagedPool
, sizeof(OBJECT_TYPE
));
129 ExWindowStationObjectType
->Tag
= TAG('W', 'I', 'N', 'S');
130 ExWindowStationObjectType
->TotalObjects
= 0;
131 ExWindowStationObjectType
->TotalHandles
= 0;
132 ExWindowStationObjectType
->PeakObjects
= 0;
133 ExWindowStationObjectType
->PeakHandles
= 0;
134 ExWindowStationObjectType
->PagedPoolCharge
= 0;
135 ExWindowStationObjectType
->NonpagedPoolCharge
= sizeof(WINSTATION_OBJECT
);
136 ExWindowStationObjectType
->Mapping
= &ExpWindowStationMapping
;
137 ExWindowStationObjectType
->Dump
= NULL
;
138 ExWindowStationObjectType
->Open
= NULL
;
139 ExWindowStationObjectType
->Close
= NULL
;
140 ExWindowStationObjectType
->Delete
= ExpWinStaObjectDelete
;
141 ExWindowStationObjectType
->Parse
= ExpWinStaObjectParse
;
142 ExWindowStationObjectType
->Security
= NULL
;
143 ExWindowStationObjectType
->QueryName
= NULL
;
144 ExWindowStationObjectType
->OkayToClose
= NULL
;
145 ExWindowStationObjectType
->Create
= ExpWinStaObjectCreate
;
146 ExWindowStationObjectType
->DuplicationNotify
= NULL
;
147 RtlInitUnicodeString(&ExWindowStationObjectType
->TypeName
, L
"WindowStation");
148 ObpCreateTypeObject(ExWindowStationObjectType
);
150 /* Create desktop object type */
151 ExDesktopObjectType
= ExAllocatePool(NonPagedPool
, sizeof(OBJECT_TYPE
));
152 ExDesktopObjectType
->Tag
= TAG('D', 'E', 'S', 'K');
153 ExDesktopObjectType
->TotalObjects
= 0;
154 ExDesktopObjectType
->TotalHandles
= 0;
155 ExDesktopObjectType
->PeakObjects
= 0;
156 ExDesktopObjectType
->PeakHandles
= 0;
157 ExDesktopObjectType
->PagedPoolCharge
= 0;
158 ExDesktopObjectType
->NonpagedPoolCharge
= sizeof(DESKTOP_OBJECT
);
159 ExDesktopObjectType
->Mapping
= &ExpDesktopMapping
;
160 ExDesktopObjectType
->Dump
= NULL
;
161 ExDesktopObjectType
->Open
= NULL
;
162 ExDesktopObjectType
->Close
= NULL
;
163 ExDesktopObjectType
->Delete
= ExpDesktopDelete
;
164 ExDesktopObjectType
->Parse
= NULL
;
165 ExDesktopObjectType
->Security
= NULL
;
166 ExDesktopObjectType
->QueryName
= NULL
;
167 ExDesktopObjectType
->OkayToClose
= NULL
;
168 ExDesktopObjectType
->Create
= ExpDesktopCreate
;
169 ExDesktopObjectType
->DuplicationNotify
= NULL
;
170 RtlInitUnicodeString(&ExDesktopObjectType
->TypeName
, L
"Desktop");
171 ObpCreateTypeObject(ExDesktopObjectType
);