00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#include "exp.h"
00027
00028
00029
00030
00031
00032 POBJECT_TYPE ExWindowStationObjectType;
00033 POBJECT_TYPE ExDesktopObjectType;
00034
00035
00036
00037
00038 GENERIC_MAPPING
ExpWindowStationMapping = {
00039 STANDARD_RIGHTS_READ,
00040 STANDARD_RIGHTS_WRITE,
00041 STANDARD_RIGHTS_EXECUTE,
00042 STANDARD_RIGHTS_REQUIRED
00043 };
00044
00045
00046
00047
00048 GENERIC_MAPPING
ExpDesktopMapping = {
00049 STANDARD_RIGHTS_READ,
00050 STANDARD_RIGHTS_WRITE,
00051 STANDARD_RIGHTS_EXECUTE,
00052 STANDARD_RIGHTS_REQUIRED
00053 };
00054
00055
#ifdef ALLOC_PRAGMA
00056
#pragma alloc_text(INIT, ExpWin32Initialization)
00057
#endif
00058
00059 BOOLEAN
00060 ExpWin32Initialization (
00061 )
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 {
00083
00084
OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
00085
NTSTATUS Status;
00086 UNICODE_STRING TypeName;
00087
00088
00089
00090
00091
00092
RtlInitUnicodeString(&TypeName,
L"WindowStation");
00093
00094
00095
00096
00097
00098 RtlZeroMemory(&ObjectTypeInitializer,
sizeof(ObjectTypeInitializer));
00099 ObjectTypeInitializer.Length =
sizeof(ObjectTypeInitializer);
00100 ObjectTypeInitializer.GenericMapping =
ExpWindowStationMapping;
00101 ObjectTypeInitializer.SecurityRequired =
TRUE;
00102 ObjectTypeInitializer.PoolType =
NonPagedPool;
00103 ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK |
00104 OBJ_PERMANENT |
00105 OBJ_EXCLUSIVE;
00106 ObjectTypeInitializer.ValidAccessMask = STANDARD_RIGHTS_REQUIRED;
00107
Status =
ObCreateObjectType(&TypeName,
00108 &ObjectTypeInitializer,
00109 (PSECURITY_DESCRIPTOR)
NULL,
00110 &
ExWindowStationObjectType);
00111
00112
00113
00114
00115
00116
00117
if (!
NT_SUCCESS(
Status))
00118
return FALSE;
00119
00120
00121
00122
00123
00124
RtlInitUnicodeString(&TypeName,
L"Desktop");
00125
00126
00127
00128
00129
00130 ObjectTypeInitializer.GenericMapping =
ExpDesktopMapping;
00131
Status =
ObCreateObjectType(&TypeName,
00132 &ObjectTypeInitializer,
00133 (PSECURITY_DESCRIPTOR)
NULL,
00134 &
ExDesktopObjectType);
00135
00136
00137
00138
00139
00140
00141
return (BOOLEAN)(
NT_SUCCESS(
Status));
00142 }