winapi_ui_automation/shared/
sddl.rs1use shared::basetsd::SIZE_T;
7use shared::minwindef::{BOOL, DWORD, PULONG, UCHAR};
8use um::winnt::{LPCSTR, LPCWSTR, LPSTR, LPWSTR, PSECURITY_DESCRIPTOR, PSID, SECURITY_INFORMATION};
9pub const SDDL_REVISION_1: UCHAR = 1;
10pub const SDDL_REVISION: UCHAR = SDDL_REVISION_1;
11pub const SDDL_OWNER: &'static str = "O";
12pub const SDDL_GROUP: &'static str = "G";
13pub const SDDL_DACL: &'static str = "D";
14pub const SDDL_SACL: &'static str = "S";
15pub const SDDL_PROTECTED: &'static str = "P";
16pub const SDDL_AUTO_INHERIT_REQ: &'static str = "AR";
17pub const SDDL_AUTO_INHERITED: &'static str = "AI";
18pub const SDDL_NULL_ACL: &'static str = "NO_ACCESS_CONTROL";
19pub const SDDL_ACCESS_ALLOWED: &'static str = "A";
20pub const SDDL_ACCESS_DENIED: &'static str = "D";
21pub const SDDL_OBJECT_ACCESS_ALLOWED: &'static str = "OA";
22pub const SDDL_OBJECT_ACCESS_DENIED: &'static str = "OD";
23pub const SDDL_AUDIT: &'static str = "AU";
24pub const SDDL_ALARM: &'static str = "AL";
25pub const SDDL_OBJECT_AUDIT: &'static str = "OU";
26pub const SDDL_OBJECT_ALARM: &'static str = "OL";
27pub const SDDL_MANDATORY_LABEL: &'static str = "ML";
28pub const SDDL_PROCESS_TRUST_LABEL: &'static str = "TL";
29pub const SDDL_CALLBACK_ACCESS_ALLOWED: &'static str = "XA";
30pub const SDDL_CALLBACK_ACCESS_DENIED: &'static str = "XD";
31pub const SDDL_RESOURCE_ATTRIBUTE: &'static str = "RA";
32pub const SDDL_SCOPED_POLICY_ID: &'static str = "SP";
33pub const SDDL_CALLBACK_AUDIT: &'static str = "XU";
34pub const SDDL_CALLBACK_OBJECT_ACCESS_ALLOWED: &'static str = "ZA";
35pub const SDDL_ACCESS_FILTER: &'static str = "FL";
36pub const SDDL_INT: &'static str = "TI";
37pub const SDDL_UINT: &'static str = "TU";
38pub const SDDL_WSTRING: &'static str = "TS";
39pub const SDDL_SID: &'static str = "TD";
40pub const SDDL_BLOB: &'static str = "TX";
41pub const SDDL_BOOLEAN: &'static str = "TB";
42pub const SDDL_CONTAINER_INHERIT: &'static str = "CI";
43pub const SDDL_OBJECT_INHERIT: &'static str = "OI";
44pub const SDDL_NO_PROPAGATE: &'static str = "NP";
45pub const SDDL_INHERIT_ONLY: &'static str = "IO";
46pub const SDDL_INHERITED: &'static str = "ID";
47pub const SDDL_TRUST_PROTECTED_FILTER: &'static str = "TP";
48pub const SDDL_AUDIT_SUCCESS: &'static str = "SA";
49pub const SDDL_AUDIT_FAILURE: &'static str = "FA";
50pub const SDDL_READ_PROPERTY: &'static str = "RP";
51pub const SDDL_WRITE_PROPERTY: &'static str = "WP";
52pub const SDDL_CREATE_CHILD: &'static str = "CC";
53pub const SDDL_DELETE_CHILD: &'static str = "DC";
54pub const SDDL_LIST_CHILDREN: &'static str = "LC";
55pub const SDDL_SELF_WRITE: &'static str = "SW";
56pub const SDDL_LIST_OBJECT: &'static str = "LO";
57pub const SDDL_DELETE_TREE: &'static str = "DT";
58pub const SDDL_CONTROL_ACCESS: &'static str = "CR";
59pub const SDDL_READ_CONTROL: &'static str = "RC";
60pub const SDDL_WRITE_DAC: &'static str = "WD";
61pub const SDDL_WRITE_OWNER: &'static str = "WO";
62pub const SDDL_STANDARD_DELETE: &'static str = "SD";
63pub const SDDL_GENERIC_ALL: &'static str = "GA";
64pub const SDDL_GENERIC_READ: &'static str = "GR";
65pub const SDDL_GENERIC_WRITE: &'static str = "GW";
66pub const SDDL_GENERIC_EXECUTE: &'static str = "GX";
67pub const SDDL_FILE_ALL: &'static str = "FA";
68pub const SDDL_FILE_READ: &'static str = "FR";
69pub const SDDL_FILE_WRITE: &'static str = "FW";
70pub const SDDL_FILE_EXECUTE: &'static str = "FX";
71pub const SDDL_KEY_ALL: &'static str = "KA";
72pub const SDDL_KEY_READ: &'static str = "KR";
73pub const SDDL_KEY_WRITE: &'static str = "KW";
74pub const SDDL_KEY_EXECUTE: &'static str = "KX";
75pub const SDDL_NO_WRITE_UP: &'static str = "NW";
76pub const SDDL_NO_READ_UP: &'static str = "NR";
77pub const SDDL_NO_EXECUTE_UP: &'static str = "NX";
78pub const SDDL_ALIAS_SIZE: SIZE_T = 2;
79pub const SDDL_DOMAIN_ADMINISTRATORS: &'static str = "DA";
80pub const SDDL_DOMAIN_GUESTS: &'static str = "DG";
81pub const SDDL_DOMAIN_USERS: &'static str = "DU";
82pub const SDDL_ENTERPRISE_DOMAIN_CONTROLLERS: &'static str = "ED";
83pub const SDDL_DOMAIN_DOMAIN_CONTROLLERS: &'static str = "DD";
84pub const SDDL_DOMAIN_COMPUTERS: &'static str = "DC";
85pub const SDDL_BUILTIN_ADMINISTRATORS: &'static str = "BA";
86pub const SDDL_BUILTIN_GUESTS: &'static str = "BG";
87pub const SDDL_BUILTIN_USERS: &'static str = "BU";
88pub const SDDL_LOCAL_ADMIN: &'static str = "LA";
89pub const SDDL_LOCAL_GUEST: &'static str = "LG";
90pub const SDDL_ACCOUNT_OPERATORS: &'static str = "AO";
91pub const SDDL_BACKUP_OPERATORS: &'static str = "BO";
92pub const SDDL_PRINTER_OPERATORS: &'static str = "PO";
93pub const SDDL_SERVER_OPERATORS: &'static str = "SO";
94pub const SDDL_AUTHENTICATED_USERS: &'static str = "AU";
95pub const SDDL_PERSONAL_SELF: &'static str = "PS";
96pub const SDDL_CREATOR_OWNER: &'static str = "CO";
97pub const SDDL_CREATOR_GROUP: &'static str = "CG";
98pub const SDDL_LOCAL_SYSTEM: &'static str = "SY";
99pub const SDDL_POWER_USERS: &'static str = "PU";
100pub const SDDL_EVERYONE: &'static str = "WD";
101pub const SDDL_REPLICATOR: &'static str = "RE";
102pub const SDDL_INTERACTIVE: &'static str = "IU";
103pub const SDDL_NETWORK: &'static str = "NU";
104pub const SDDL_SERVICE: &'static str = "SU";
105pub const SDDL_RESTRICTED_CODE: &'static str = "RC";
106pub const SDDL_WRITE_RESTRICTED_CODE: &'static str = "WR";
107pub const SDDL_ANONYMOUS: &'static str = "AN";
108pub const SDDL_SCHEMA_ADMINISTRATORS: &'static str = "SA";
109pub const SDDL_CERT_SERV_ADMINISTRATORS: &'static str = "CA";
110pub const SDDL_RAS_SERVERS: &'static str = "RS";
111pub const SDDL_ENTERPRISE_ADMINS: &'static str = "EA";
112pub const SDDL_GROUP_POLICY_ADMINS: &'static str = "PA";
113pub const SDDL_ALIAS_PREW2KCOMPACC: &'static str = "RU";
114pub const SDDL_LOCAL_SERVICE: &'static str = "LS";
115pub const SDDL_NETWORK_SERVICE: &'static str = "NS";
116pub const SDDL_REMOTE_DESKTOP: &'static str = "RD";
117pub const SDDL_NETWORK_CONFIGURATION_OPS: &'static str = "NO";
118pub const SDDL_PERFMON_USERS: &'static str = "MU";
119pub const SDDL_PERFLOG_USERS: &'static str = "LU";
120pub const SDDL_IIS_USERS: &'static str = "IS";
121pub const SDDL_CRYPTO_OPERATORS: &'static str = "CY";
122pub const SDDL_OWNER_RIGHTS: &'static str = "OW";
123pub const SDDL_EVENT_LOG_READERS: &'static str = "ER";
124pub const SDDL_ENTERPRISE_RO_DCs: &'static str = "RO";
125pub const SDDL_CERTSVC_DCOM_ACCESS: &'static str = "CD";
126pub const SDDL_ALL_APP_PACKAGES: &'static str = "AC";
127pub const SDDL_RDS_REMOTE_ACCESS_SERVERS: &'static str = "RA";
128pub const SDDL_RDS_ENDPOINT_SERVERS: &'static str = "ES";
129pub const SDDL_RDS_MANAGEMENT_SERVERS: &'static str = "MS";
130pub const SDDL_USER_MODE_DRIVERS: &'static str = "UD";
131pub const SDDL_HYPER_V_ADMINS: &'static str = "HA";
132pub const SDDL_CLONEABLE_CONTROLLERS: &'static str = "CN";
133pub const SDDL_ACCESS_CONTROL_ASSISTANCE_OPS: &'static str = "AA";
134pub const SDDL_REMOTE_MANAGEMENT_USERS: &'static str = "RM";
135pub const SDDL_AUTHORITY_ASSERTED: &'static str = "AS";
136pub const SDDL_SERVICE_ASSERTED: &'static str = "SS";
137pub const SDDL_PROTECTED_USERS: &'static str = "AP";
138pub const SDDL_KEY_ADMINS: &'static str = "KA";
139pub const SDDL_ENTERPRISE_KEY_ADMINS: &'static str = "EK";
140pub const SDDL_ML_LOW: &'static str = "LW";
141pub const SDDL_ML_MEDIUM: &'static str = "ME";
142pub const SDDL_ML_MEDIUM_PLUS: &'static str = "MP";
143pub const SDDL_ML_HIGH: &'static str = "HI";
144pub const SDDL_ML_SYSTEM: &'static str = "SI";
145pub const SDDL_SEPERATORC: char = ';';
146pub const SDDL_DELIMINATORC: char = ':';
147pub const SDDL_ACE_BEGINC: char = '(';
148pub const SDDL_ACE_ENDC: char = ')';
149pub const SDDL_SPACEC: char = ' ';
150pub const SDDL_ACE_COND_BEGINC: char = '(';
151pub const SDDL_ACE_COND_ENDC: char = ')';
152pub const SDDL_ACE_COND_STRING_BEGINC: char = '"';
153pub const SDDL_ACE_COND_STRING_ENDC: char = '"';
154pub const SDDL_ACE_COND_COMPOSITEVALUE_BEGINC: char = '{';
155pub const SDDL_ACE_COND_COMPOSITEVALUE_ENDC: char = '}';
156pub const SDDL_ACE_COND_COMPOSITEVALUE_SEPERATORC: char = ',';
157pub const SDDL_ACE_COND_BLOB_PREFIXC: char = '#';
158pub const SDDL_ACE_COND_SID_BEGINC: char = '(';
159pub const SDDL_ACE_COND_SID_ENDC: char = ')';
160pub const SDDL_SEPERATOR: &'static str = ";";
161pub const SDDL_DELIMINATOR: &'static str = ":";
162pub const SDDL_ACE_BEGIN: &'static str = "(";
163pub const SDDL_ACE_END: &'static str = ")";
164pub const SDDL_ACE_COND_BEGIN: &'static str = "(";
165pub const SDDL_ACE_COND_END: &'static str = ")";
166pub const SDDL_SPACE: &'static str = " ";
167pub const SDDL_ACE_COND_BLOB_PREFIX: &'static str = "#";
168pub const SDDL_ACE_COND_SID_PREFIX: &'static str = "SID";
169pub const SDDL_ACE_COND_ATTRIBUTE_PREFIX: &'static str = "@";
170pub const SDDL_ACE_COND_USER_ATTRIBUTE_PREFIX: &'static str = "@USER.";
171pub const SDDL_ACE_COND_RESOURCE_ATTRIBUTE_PREFIX: &'static str = "@RESOURCE.";
172pub const SDDL_ACE_COND_DEVICE_ATTRIBUTE_PREFIX: &'static str = "@DEVICE.";
173pub const SDDL_ACE_COND_TOKEN_ATTRIBUTE_PREFIX: &'static str = "@TOKEN.";
174extern "system" {
175 pub fn ConvertSidToStringSidA(
176 Sid: PSID,
177 StringSid: *mut LPSTR,
178 ) -> BOOL;
179 pub fn ConvertSidToStringSidW(
180 Sid: PSID,
181 StringSid: *mut LPWSTR,
182 ) -> BOOL;
183 pub fn ConvertStringSidToSidA(
184 StringSid: LPCSTR,
185 Sid: *mut PSID,
186 ) -> BOOL;
187 pub fn ConvertStringSidToSidW(
188 StringSid: LPCWSTR,
189 Sid: *mut PSID,
190 ) -> BOOL;
191 pub fn ConvertStringSecurityDescriptorToSecurityDescriptorA(
192 StringSecurityDescriptor: LPCSTR,
193 StringSDRevision: DWORD,
194 SecurityDescriptor: *mut PSECURITY_DESCRIPTOR,
195 SecurityDescriptorSize: PULONG,
196 ) -> BOOL;
197 pub fn ConvertStringSecurityDescriptorToSecurityDescriptorW(
198 StringSecurityDescriptor: LPCWSTR,
199 StringSDRevision: DWORD,
200 SecurityDescriptor: *mut PSECURITY_DESCRIPTOR,
201 SecurityDescriptorSize: PULONG,
202 ) -> BOOL;
203 pub fn ConvertSecurityDescriptorToStringSecurityDescriptorA(
204 SecurityDescriptor: PSECURITY_DESCRIPTOR,
205 RequestedStringSDRevision: DWORD,
206 SecurityInformation: SECURITY_INFORMATION,
207 StringSecurityDescriptor: *mut LPSTR,
208 StringSecurityDescriptorLen: PULONG,
209 ) -> BOOL;
210 pub fn ConvertSecurityDescriptorToStringSecurityDescriptorW(
211 SecurityDescriptor: PSECURITY_DESCRIPTOR,
212 RequestedStringSDRevision: DWORD,
213 SecurityInformation: SECURITY_INFORMATION,
214 StringSecurityDescriptor: *mut LPWSTR,
215 StringSecurityDescriptorLen: PULONG,
216 ) -> BOOL;
217}