2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel
4 * FILE: ntoskrnl/ex/win32k.c
5 * PURPOSE: Executive Win32 Object Support (Desktop/WinStation)
6 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
11 #include <internal/debug.h>
13 #if defined (ALLOC_PRAGMA)
14 #pragma alloc_text(INIT, ExpWin32kInit)
17 /* DATA **********************************************************************/
19 POBJECT_TYPE ExWindowStationObjectType
= NULL
;
20 POBJECT_TYPE ExDesktopObjectType
= NULL
;
22 static GENERIC_MAPPING ExpWindowStationMapping
=
25 STANDARD_RIGHTS_WRITE
,
26 STANDARD_RIGHTS_EXECUTE
,
27 STANDARD_RIGHTS_REQUIRED
30 static GENERIC_MAPPING ExpDesktopMapping
=
33 STANDARD_RIGHTS_WRITE
,
34 STANDARD_RIGHTS_EXECUTE
,
35 STANDARD_RIGHTS_REQUIRED
38 OB_OPEN_METHOD ExpWindowStationObjectOpen
= NULL
;
39 OB_PARSE_METHOD ExpWindowStationObjectParse
= NULL
;
40 OB_DELETE_METHOD ExpWindowStationObjectDelete
= NULL
;
41 OB_FIND_METHOD ExpWindowStationObjectFind
= NULL
;
42 OB_CREATE_METHOD ExpDesktopObjectCreate
= NULL
;
43 OB_DELETE_METHOD ExpDesktopObjectDelete
= NULL
;
45 /* FUNCTIONS ****************************************************************/
49 ExpWinStaObjectOpen(OB_OPEN_REASON Reason
,
53 ACCESS_MASK GrantedAccess
)
55 /* Call the Registered Callback */
56 return ExpWindowStationObjectOpen(Reason
,
65 ExpWinStaObjectDelete(PVOID DeletedObject
)
67 /* Call the Registered Callback */
68 ExpWindowStationObjectDelete(DeletedObject
);
73 ExpWinStaObjectFind(PVOID WinStaObject
,
77 /* Call the Registered Callback */
78 return ExpWindowStationObjectFind(WinStaObject
,
85 ExpWinStaObjectParse(PVOID Object
,
87 PUNICODE_STRING FullPath
,
91 /* Call the Registered Callback */
92 return ExpWindowStationObjectParse(Object
,
101 ExpDesktopCreate(PVOID ObjectBody
,
104 POBJECT_ATTRIBUTES ObjectAttributes
)
106 /* Call the Registered Callback */
107 return ExpDesktopObjectCreate(ObjectBody
,
115 ExpDesktopDelete(PVOID DeletedObject
)
117 /* Call the Registered Callback */
118 ExpDesktopObjectDelete(DeletedObject
);
126 OBJECT_TYPE_INITIALIZER ObjectTypeInitializer
;
128 DPRINT("Creating Win32 Object Types\n");
130 /* Create the window station Object Type */
131 RtlZeroMemory(&ObjectTypeInitializer
, sizeof(ObjectTypeInitializer
));
132 RtlInitUnicodeString(&Name
, L
"WindowStation");
133 ObjectTypeInitializer
.Length
= sizeof(ObjectTypeInitializer
);
134 ObjectTypeInitializer
.GenericMapping
= ExpWindowStationMapping
;
135 ObjectTypeInitializer
.PoolType
= NonPagedPool
;
136 ObjectTypeInitializer
.OpenProcedure
= ExpWinStaObjectOpen
;
137 ObjectTypeInitializer
.DeleteProcedure
= ExpWinStaObjectDelete
;
138 ObjectTypeInitializer
.ParseProcedure
= ExpWinStaObjectParse
;
139 ObpCreateTypeObject(&ObjectTypeInitializer
,
141 &ExWindowStationObjectType
);
143 /* Create desktop object type */
144 RtlInitUnicodeString(&Name
, L
"Desktop");
145 ObjectTypeInitializer
.GenericMapping
= ExpDesktopMapping
;
146 ObjectTypeInitializer
.OpenProcedure
= NULL
;
147 ObjectTypeInitializer
.DeleteProcedure
= ExpDesktopDelete
;
148 ObjectTypeInitializer
.ParseProcedure
= NULL
;
149 ObpCreateTypeObject(&ObjectTypeInitializer
, &Name
, &ExDesktopObjectType
);