96f1640ec947ed886440a256423a3e6ad558a799
[reactos.git] / reactos / include / reactos / idl / sam.idl
1 /*
2 * Security Account Manager interface definition
3 */
4
5 #include <ms-dtyp.idl>
6
7 cpp_quote("#ifndef _NTDEF_")
8 typedef long NTSTATUS;
9 cpp_quote("#endif")
10
11 typedef struct _RPC_STRING
12 {
13 unsigned short Length;
14 unsigned short MaximumLength;
15 [size_is(MaximumLength), length_is(Length)] char *Buffer;
16 } RPC_STRING, *PRPC_STRING;
17
18 typedef struct _OLD_LARGE_INTEGER
19 {
20 unsigned long LowPart;
21 long HighPart;
22 } OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER;
23
24 typedef [handle] wchar_t *PSAMPR_SERVER_NAME;
25
26 typedef [context_handle] void *SAMPR_HANDLE;
27
28 typedef struct _ENCRYPTED_LM_OWF_PASSWORD
29 {
30 char data[16];
31 } ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD, ENCRYPTED_NT_OWF_PASSWORD, *PENCRYPTED_NT_OWF_PASSWORD;
32
33 typedef struct _SAMPR_ULONG_ARRAY
34 {
35 unsigned long Count;
36 [size_is(Count)] unsigned long *Element;
37 } SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY;
38
39 typedef struct _SAMPR_SID_INFORMATION
40 {
41 PRPC_SID SidPointer;
42 } SAMPR_SID_INFORMATION, *PSAMPR_SID_INFORMATION;
43
44 typedef struct _SAMPR_PSID_ARRAY
45 {
46 [range(0, 1024)] unsigned long Count;
47 [size_is(Count)] PSAMPR_SID_INFORMATION Sids;
48 } SAMPR_PSID_ARRAY, *PSAMPR_PSID_ARRAY;
49
50 typedef struct _SAMPR_PSID_ARRAY_OUT
51 {
52 unsigned long Count;
53 [size_is(Count)] PSAMPR_SID_INFORMATION Sids;
54 } SAMPR_PSID_ARRAY_OUT, *PSAMPR_PSID_ARRAY_OUT;
55
56 typedef struct _SAMPR_RETURNED_USTRING_ARRAY
57 {
58 unsigned long Count;
59 [size_is(Count)] PRPC_UNICODE_STRING Element;
60 } SAMPR_RETURNED_USTRING_ARRAY, *PSAMPR_RETURNED_USTRING_ARRAY;
61
62 cpp_quote("#ifndef _WINNT_")
63 typedef enum _SID_NAME_USE
64 {
65 SidTypeUser = 1,
66 SidTypeGroup,
67 SidTypeDomain,
68 SidTypeAlias,
69 SidTypeWellKnownGroup,
70 SidTypeDeletedAccount,
71 SidTypeInvalid,
72 SidTypeUnknown,
73 } SID_NAME_USE, *PSID_NAME_USE;
74 cpp_quote("#endif")
75
76 typedef struct RPC_SHORT_BLOB
77 {
78 unsigned short Length;
79 unsigned short MaximumLength;
80 [size_is(MaximumLength/2), length_is(Length/2)]
81 unsigned short* Buffer;
82 } RPC_SHORT_BLOB, *PRPC_SHORT_BLOB;
83
84 typedef struct _SAMPR_RID_ENUMERATION
85 {
86 unsigned long RelativeId;
87 RPC_UNICODE_STRING Name;
88 } SAMPR_RID_ENUMERATION, *PSAMPR_RID_ENUMERATION;
89
90 typedef struct _SAMPR_ENUMERATION_BUFFER
91 {
92 unsigned long EntriesRead;
93 [size_is(EntriesRead)] PSAMPR_RID_ENUMERATION Buffer;
94 } SAMPR_ENUMERATION_BUFFER, *PSAMPR_ENUMERATION_BUFFER;
95
96 typedef struct _SAMPR_SR_SECURITY_DESCRIPTOR
97 {
98 [range(0, 256 * 1024)] unsigned long Length;
99 [size_is(Length)] unsigned char* SecurityDescriptor;
100 } SAMPR_SR_SECURITY_DESCRIPTOR, *PSAMPR_SR_SECURITY_DESCRIPTOR;
101
102 cpp_quote("#ifndef _NTSAM_")
103 typedef struct _GROUP_MEMBERSHIP
104 {
105 unsigned long RelativeId;
106 unsigned long Attributes;
107 } GROUP_MEMBERSHIP, *PGROUP_MEMBERSHIP;
108 cpp_quote("#endif")
109
110 typedef struct _SAMPR_GET_GROUPS_BUFFER
111 {
112 unsigned long MembershipCount;
113 [size_is(MembershipCount)] PGROUP_MEMBERSHIP Groups;
114 } SAMPR_GET_GROUPS_BUFFER, *PSAMPR_GET_GROUPS_BUFFER;
115
116 typedef struct _SAMPR_GET_MEMBERS_BUFFER
117 {
118 unsigned long MemberCount;
119 [size_is(MemberCount)] unsigned long* Members;
120 [size_is(MemberCount)] unsigned long* Attributes;
121 } SAMPR_GET_MEMBERS_BUFFER, *PSAMPR_GET_MEMBERS_BUFFER;
122
123 typedef struct _SAMPR_REVISION_INFO_V1
124 {
125 unsigned long Revision;
126 unsigned long SupportedFeatures;
127 } SAMPR_REVISION_INFO_V1, *PSAMPR_REVISION_INFO_V1;
128
129 typedef [switch_type(unsigned long)] union
130 {
131 [case(1)] SAMPR_REVISION_INFO_V1 V1;
132 }SAMPR_REVISION_INFO, *PSAMPR_REVISION_INFO;
133
134 typedef struct _USER_DOMAIN_PASSWORD_INFORMATION
135 {
136 unsigned short MinPasswordLength;
137 unsigned long PasswordProperties;
138 } USER_DOMAIN_PASSWORD_INFORMATION, *PUSER_DOMAIN_PASSWORD_INFORMATION;
139
140 cpp_quote("#ifndef _NTSAM_")
141 typedef enum _DOMAIN_SERVER_ENABLE_STATE
142 {
143 DomainServerEnabled = 1,
144 DomainServerDisabled
145 } DOMAIN_SERVER_ENABLE_STATE, *PDOMAIN_SERVER_ENABLE_STATE;
146 cpp_quote("#endif")
147
148 typedef struct _DOMAIN_STATE_INFORMATION
149 {
150 DOMAIN_SERVER_ENABLE_STATE DomainServerState;
151 } DOMAIN_STATE_INFORMATION, *PDOMAIN_STATE_INFORMATION;
152
153 cpp_quote("#ifndef _NTSAM_")
154 typedef enum _DOMAIN_SERVER_ROLE
155 {
156 DomainServerRoleBackup = 2,
157 DomainServerRolePrimary = 3
158 } DOMAIN_SERVER_ROLE, *PDOMAIN_SERVER_ROLE;
159 cpp_quote("#endif")
160
161 cpp_quote("#ifndef _NTSECAPI_H")
162 typedef struct _DOMAIN_PASSWORD_INFORMATION
163 {
164 unsigned short MinPasswordLength;
165 unsigned short PasswordHistoryLength;
166 unsigned long PasswordProperties;
167 OLD_LARGE_INTEGER MaxPasswordAge;
168 OLD_LARGE_INTEGER MinPasswordAge;
169 } DOMAIN_PASSWORD_INFORMATION, *PDOMAIN_PASSWORD_INFORMATION;
170 cpp_quote("#endif")
171
172 typedef struct _DOMAIN_LOGOFF_INFORMATION
173 {
174 OLD_LARGE_INTEGER ForceLogoff;
175 } DOMAIN_LOGOFF_INFORMATION, *PDOMAIN_LOGOFF_INFORMATION;
176
177 typedef struct _DOMAIN_SERVER_ROLE_INFORMATION
178 {
179 DOMAIN_SERVER_ROLE DomainServerRole;
180 } DOMAIN_SERVER_ROLE_INFORMATION, *PDOMAIN_SERVER_ROLE_INFORMATION;
181
182 typedef struct _DOMAIN_MODIFIED_INFORMATION
183 {
184 OLD_LARGE_INTEGER DomainModifiedCount;
185 OLD_LARGE_INTEGER CreationTime;
186 } DOMAIN_MODIFIED_INFORMATION, *PDOMAIN_MODIFIED_INFORMATION;
187
188 typedef struct _DOMAIN_MODIFIED_INFORMATION2
189 {
190 OLD_LARGE_INTEGER DomainModifiedCount;
191 OLD_LARGE_INTEGER CreationTime;
192 OLD_LARGE_INTEGER ModifiedCountAtLastPromotion;
193 } DOMAIN_MODIFIED_INFORMATION2, *PDOMAIN_MODIFIED_INFORMATION2;
194
195 cpp_quote("#include <pshpack4.h>")
196 typedef struct _SAMPR_DOMAIN_GENERAL_INFORMATION
197 {
198 OLD_LARGE_INTEGER ForceLogoff;
199 RPC_UNICODE_STRING OemInformation;
200 RPC_UNICODE_STRING DomainName;
201 RPC_UNICODE_STRING ReplicaSourceNodeName;
202 OLD_LARGE_INTEGER DomainModifiedCount;
203 unsigned long DomainServerState;
204 unsigned long DomainServerRole;
205 unsigned char UasCompatibilityRequired;
206 unsigned long UserCount;
207 unsigned long GroupCount;
208 unsigned long AliasCount;
209 } SAMPR_DOMAIN_GENERAL_INFORMATION, *PSAMPR_DOMAIN_GENERAL_INFORMATION;
210
211 typedef struct _SAMPR_DOMAIN_GENERAL_INFORMATION2
212 {
213 SAMPR_DOMAIN_GENERAL_INFORMATION I1;
214 LARGE_INTEGER LockoutDuration;
215 LARGE_INTEGER LockoutObservationWindow;
216 unsigned short LockoutThreshold;
217 } SAMPR_DOMAIN_GENERAL_INFORMATION2, *PSAMPR_DOMAIN_GENERAL_INFORMATION2;
218 cpp_quote("#include <poppack.h>")
219
220 typedef struct _SAMPR_DOMAIN_OEM_INFORMATION
221 {
222 RPC_UNICODE_STRING OemInformation;
223 } SAMPR_DOMAIN_OEM_INFORMATION, *PSAMPR_DOMAIN_OEM_INFORMATION;
224
225 typedef struct _SAMPR_DOMAIN_NAME_INFORMATION
226 {
227 RPC_UNICODE_STRING DomainName;
228 } SAMPR_DOMAIN_NAME_INFORMATION, *PSAMPR_DOMAIN_NAME_INFORMATION;
229
230 typedef struct SAMPR_DOMAIN_REPLICATION_INFORMATION
231 {
232 RPC_UNICODE_STRING ReplicaSourceNodeName;
233 } SAMPR_DOMAIN_REPLICATION_INFORMATION, *PSAMPR_DOMAIN_REPLICATION_INFORMATION;
234
235 typedef struct _SAMPR_DOMAIN_LOCKOUT_INFORMATION
236 {
237 LARGE_INTEGER LockoutDuration;
238 LARGE_INTEGER LockoutObservationWindow;
239 unsigned short LockoutThreshold;
240 } SAMPR_DOMAIN_LOCKOUT_INFORMATION, *PSAMPR_DOMAIN_LOCKOUT_INFORMATION;
241
242 cpp_quote("#ifndef _NTSAM_")
243 typedef enum _DOMAIN_INFORMATION_CLASS
244 {
245 DomainPasswordInformation = 1,
246 DomainGeneralInformation = 2,
247 DomainLogoffInformation = 3,
248 DomainOemInformation = 4,
249 DomainNameInformation = 5,
250 DomainReplicationInformation = 6,
251 DomainServerRoleInformation = 7,
252 DomainModifiedInformation = 8,
253 DomainStateInformation = 9,
254 DomainGeneralInformation2 = 11,
255 DomainLockoutInformation = 12,
256 DomainModifiedInformation2 = 13
257 } DOMAIN_INFORMATION_CLASS;
258 cpp_quote("#endif")
259
260 typedef [switch_type(DOMAIN_INFORMATION_CLASS)] union _SAMPR_DOMAIN_INFO_BUFFER
261 {
262 [case(DomainPasswordInformation)] DOMAIN_PASSWORD_INFORMATION Password;
263 [case(DomainGeneralInformation)] SAMPR_DOMAIN_GENERAL_INFORMATION General;
264 [case(DomainLogoffInformation)] DOMAIN_LOGOFF_INFORMATION Logoff;
265 [case(DomainOemInformation)] SAMPR_DOMAIN_OEM_INFORMATION Oem;
266 [case(DomainNameInformation)] SAMPR_DOMAIN_NAME_INFORMATION Name;
267 [case(DomainServerRoleInformation)] DOMAIN_SERVER_ROLE_INFORMATION Role;
268 [case(DomainReplicationInformation)] SAMPR_DOMAIN_REPLICATION_INFORMATION Replication;
269 [case(DomainModifiedInformation)] DOMAIN_MODIFIED_INFORMATION Modified;
270 [case(DomainStateInformation)] DOMAIN_STATE_INFORMATION State;
271 [case(DomainGeneralInformation2)] SAMPR_DOMAIN_GENERAL_INFORMATION2 General2;
272 [case(DomainLockoutInformation)] SAMPR_DOMAIN_LOCKOUT_INFORMATION Lockout;
273 [case(DomainModifiedInformation2)] DOMAIN_MODIFIED_INFORMATION2 Modified2;
274 } SAMPR_DOMAIN_INFO_BUFFER, *PSAMPR_DOMAIN_INFO_BUFFER;
275
276 typedef enum _DOMAIN_DISPLAY_INFORMATION
277 {
278 DomainDisplayUser = 1,
279 DomainDisplayMachine,
280 DomainDisplayGroup,
281 DomainDisplayOemUser,
282 DomainDisplayOemGroup
283 } DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION;
284
285 typedef struct _SAMPR_DOMAIN_DISPLAY_USER
286 {
287 unsigned long Index;
288 unsigned long Rid;
289 unsigned long AccountControl;
290 RPC_UNICODE_STRING AccountName;
291 RPC_UNICODE_STRING AdminComment;
292 RPC_UNICODE_STRING FullName;
293 } SAMPR_DOMAIN_DISPLAY_USER, *PSAMPR_DOMAIN_DISPLAY_USER;
294
295 typedef struct _SAMPR_DOMAIN_DISPLAY_MACHINE
296 {
297 unsigned long Index;
298 unsigned long Rid;
299 unsigned long AccountControl;
300 RPC_UNICODE_STRING AccountName;
301 RPC_UNICODE_STRING AdminComment;
302 } SAMPR_DOMAIN_DISPLAY_MACHINE, *PSAMPR_DOMAIN_DISPLAY_MACHINE;
303
304 typedef struct _SAMPR_DOMAIN_DISPLAY_GROUP
305 {
306 unsigned long Index;
307 unsigned long Rid;
308 unsigned long Attributes;
309 RPC_UNICODE_STRING AccountName;
310 RPC_UNICODE_STRING AdminComment;
311 } SAMPR_DOMAIN_DISPLAY_GROUP, *PSAMPR_DOMAIN_DISPLAY_GROUP;
312
313 typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_USER
314 {
315 unsigned long Index;
316 RPC_STRING OemAccountName;
317 } SAMPR_DOMAIN_DISPLAY_OEM_USER, *PSAMPR_DOMAIN_DISPLAY_OEM_USER;
318
319 typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_GROUP
320 {
321 unsigned long Index;
322 RPC_STRING OemAccountName;
323 } SAMPR_DOMAIN_DISPLAY_OEM_GROUP, *PSAMPR_DOMAIN_DISPLAY_OEM_GROUP;
324
325 typedef struct _SAMPR_DOMAIN_DISPLAY_USER_BUFFER
326 {
327 unsigned long EntriesRead;
328 [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_USER Buffer;
329 } SAMPR_DOMAIN_DISPLAY_USER_BUFFER, *PSAMPR_DOMAIN_DISPLAY_USER_BUFFER;
330
331 typedef struct _SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER
332 {
333 unsigned long EntriesRead;
334 [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_MACHINE Buffer;
335 } SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER, *PSAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER;
336
337 typedef struct _SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER
338 {
339 unsigned long EntriesRead;
340 [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_GROUP Buffer;
341 } SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER, *PSAMPR_DOMAIN_DISPLAY_GROUP_BUFFER;
342
343 typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER
344 {
345 unsigned long EntriesRead;
346 [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_OEM_USER Buffer;
347 } SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER, *PSAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER;
348
349 typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER
350 {
351 unsigned long EntriesRead;
352 [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_OEM_GROUP Buffer;
353 } SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER, *PSAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER;
354
355 typedef [switch_type(DOMAIN_DISPLAY_INFORMATION)] union _SAMPR_DISPLAY_INFO_BUFFER
356 {
357 [case(DomainDisplayUser)] SAMPR_DOMAIN_DISPLAY_USER_BUFFER UserInformation;
358 [case(DomainDisplayMachine)] SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER MachineInformation;
359 [case(DomainDisplayGroup)] SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER GroupInformation;
360 [case(DomainDisplayOemUser)] SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER OemUserInformation;
361 [case(DomainDisplayOemGroup)] SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER OemGroupInformation;
362 } SAMPR_DISPLAY_INFO_BUFFER, *PSAMPR_DISPLAY_INFO_BUFFER;
363
364 typedef struct _GROUP_ATTRIBUTE_INFORMATION
365 {
366 unsigned long Attributes;
367 } GROUP_ATTRIBUTE_INFORMATION, *PGROUP_ATTRIBUTE_INFORMATION;
368
369 typedef struct _SAMPR_GROUP_GENERAL_INFORMATION
370 {
371 RPC_UNICODE_STRING Name;
372 unsigned long Attributes;
373 unsigned long MemberCount;
374 RPC_UNICODE_STRING AdminComment;
375 } SAMPR_GROUP_GENERAL_INFORMATION, *PSAMPR_GROUP_GENERAL_INFORMATION;
376
377 typedef struct _SAMPR_GROUP_NAME_INFORMATION
378 {
379 RPC_UNICODE_STRING Name;
380 } SAMPR_GROUP_NAME_INFORMATION, *PSAMPR_GROUP_NAME_INFORMATION;
381
382 typedef struct _SAMPR_GROUP_ADM_COMMENT_INFORMATION
383 {
384 RPC_UNICODE_STRING AdminComment;
385 } SAMPR_GROUP_ADM_COMMENT_INFORMATION, *PSAMPR_GROUP_ADM_COMMENT_INFORMATION;
386
387 cpp_quote("#ifndef _NTSAM_")
388 typedef enum _GROUP_INFORMATION_CLASS
389 {
390 GroupGeneralInformation = 1,
391 GroupNameInformation,
392 GroupAttributeInformation,
393 GroupAdminCommentInformation,
394 GroupReplicationInformation
395 } GROUP_INFORMATION_CLASS;
396 cpp_quote("#endif")
397
398 typedef [switch_type(GROUP_INFORMATION_CLASS)] union _SAMPR_GROUP_INFO_BUFFER
399 {
400 [case(GroupGeneralInformation)] SAMPR_GROUP_GENERAL_INFORMATION General;
401 [case(GroupNameInformation)] SAMPR_GROUP_NAME_INFORMATION Name;
402 [case(GroupAttributeInformation)] GROUP_ATTRIBUTE_INFORMATION Attribute;
403 [case(GroupAdminCommentInformation)] SAMPR_GROUP_ADM_COMMENT_INFORMATION AdminComment;
404 [case(GroupReplicationInformation)] SAMPR_GROUP_GENERAL_INFORMATION DoNotUse;
405 } SAMPR_GROUP_INFO_BUFFER, *PSAMPR_GROUP_INFO_BUFFER;
406
407 typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION
408 {
409 RPC_UNICODE_STRING Name;
410 ULONG MemberCount;
411 RPC_UNICODE_STRING AdminComment;
412 } SAMPR_ALIAS_GENERAL_INFORMATION, *PSAMPR_ALIAS_GENERAL_INFORMATION;
413
414 typedef struct _SAMPR_ALIAS_NAME_INFORMATION
415 {
416 RPC_UNICODE_STRING Name;
417 } SAMPR_ALIAS_NAME_INFORMATION, *PSAMPR_ALIAS_NAME_INFORMATION;
418
419 typedef struct _SAMPR_ALIAS_ADM_COMMENT_INFORMATION
420 {
421 RPC_UNICODE_STRING AdminComment;
422 } SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION;
423
424 cpp_quote("#ifndef _NTSAM_")
425 typedef enum _ALIAS_INFORMATION_CLASS
426 {
427 AliasGeneralInformation = 1,
428 AliasNameInformation,
429 AliasAdminCommentInformation,
430 } ALIAS_INFORMATION_CLASS;
431 cpp_quote("#endif")
432
433 typedef [switch_type(ALIAS_INFORMATION_CLASS)] union _SAMPR_ALIAS_INFO_BUFFER
434 {
435 [case(AliasGeneralInformation)] SAMPR_ALIAS_GENERAL_INFORMATION General;
436 [case(AliasNameInformation)] SAMPR_ALIAS_NAME_INFORMATION Name;
437 [case(AliasAdminCommentInformation)] SAMPR_ALIAS_ADM_COMMENT_INFORMATION AdminComment;
438 } SAMPR_ALIAS_INFO_BUFFER, *PSAMPR_ALIAS_INFO_BUFFER;
439
440 typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD
441 {
442 unsigned char Buffer[(256 * 2) + 4];
443 } SAMPR_ENCRYPTED_USER_PASSWORD, *PSAMPR_ENCRYPTED_USER_PASSWORD;
444
445 typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD_NEW
446 {
447 unsigned char Buffer[(256 * 2) + 4 + 16];
448 } SAMPR_ENCRYPTED_USER_PASSWORD_NEW, *PSAMPR_ENCRYPTED_USER_PASSWORD_NEW;
449
450 typedef struct _USER_PRIMARY_GROUP_INFORMATION
451 {
452 unsigned long PrimaryGroupId;
453 } USER_PRIMARY_GROUP_INFORMATION, *PUSER_PRIMARY_GROUP_INFORMATION;
454
455 typedef struct _USER_CONTROL_INFORMATION
456 {
457 unsigned long UserAccountControl;
458 } USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION;
459
460 typedef struct _USER_EXPIRES_INFORMATION
461 {
462 OLD_LARGE_INTEGER AccountExpires;
463 } USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION;
464
465 typedef struct _SAMPR_LOGON_HOURS
466 {
467 unsigned short UnitsPerWeek;
468 // [size_is(1260), length_is((UnitsPerWeek + 7) / 8)] unsigned char *LogonHours; // FIXME
469 [size_is(1260)] unsigned char *LogonHours;
470 } SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS;
471
472 typedef struct _SAMPR_USER_ALL_INFORMATION
473 {
474 OLD_LARGE_INTEGER LastLogon;
475 OLD_LARGE_INTEGER LastLogoff;
476 OLD_LARGE_INTEGER PasswordLastSet;
477 OLD_LARGE_INTEGER AccountExpires;
478 OLD_LARGE_INTEGER PasswordCanChange;
479 OLD_LARGE_INTEGER PasswordMustChange;
480 RPC_UNICODE_STRING UserName;
481 RPC_UNICODE_STRING FullName;
482 RPC_UNICODE_STRING HomeDirectory;
483 RPC_UNICODE_STRING HomeDirectoryDrive;
484 RPC_UNICODE_STRING ScriptPath;
485 RPC_UNICODE_STRING ProfilePath;
486 RPC_UNICODE_STRING AdminComment;
487 RPC_UNICODE_STRING WorkStations;
488 RPC_UNICODE_STRING UserComment;
489 RPC_UNICODE_STRING Parameters;
490 RPC_SHORT_BLOB LmOwfPassword;
491 RPC_SHORT_BLOB NtOwfPassword;
492 RPC_UNICODE_STRING PrivateData;
493 SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor;
494 unsigned long UserId;
495 unsigned long PrimaryGroupId;
496 unsigned long UserAccountControl;
497 unsigned long WhichFields;
498 SAMPR_LOGON_HOURS LogonHours;
499 unsigned short BadPasswordCount;
500 unsigned short LogonCount;
501 unsigned short CountryCode;
502 unsigned short CodePage;
503 unsigned char LmPasswordPresent;
504 unsigned char NtPasswordPresent;
505 unsigned char PasswordExpired;
506 unsigned char PrivateDataSensitive;
507 } SAMPR_USER_ALL_INFORMATION, *PSAMPR_USER_ALL_INFORMATION;
508
509 typedef struct _SAMPR_USER_GENERAL_INFORMATION
510 {
511 RPC_UNICODE_STRING UserName;
512 RPC_UNICODE_STRING FullName;
513 unsigned long PrimaryGroupId;
514 RPC_UNICODE_STRING AdminComment;
515 RPC_UNICODE_STRING UserComment;
516 } SAMPR_USER_GENERAL_INFORMATION, *PSAMPR_USER_GENERAL_INFORMATION;
517
518 typedef struct _SAMPR_USER_PREFERENCES_INFORMATION
519 {
520 RPC_UNICODE_STRING UserComment;
521 RPC_UNICODE_STRING Reserved1;
522 unsigned short CountryCode;
523 unsigned short CodePage;
524 } SAMPR_USER_PREFERENCES_INFORMATION, *PSAMPR_USER_PREFERENCES_INFORMATION;
525
526 typedef struct _SAMPR_USER_PARAMETERS_INFORMATION
527 {
528 RPC_UNICODE_STRING Parameters;
529 } SAMPR_USER_PARAMETERS_INFORMATION, *PSAMPR_USER_PARAMETERS_INFORMATION;
530
531 typedef struct _SAMPR_USER_LOGON_INFORMATION
532 {
533 RPC_UNICODE_STRING UserName;
534 RPC_UNICODE_STRING FullName;
535 unsigned long UserId;
536 unsigned long PrimaryGroupId;
537 RPC_UNICODE_STRING HomeDirectory;
538 RPC_UNICODE_STRING HomeDirectoryDrive;
539 RPC_UNICODE_STRING ScriptPath;
540 RPC_UNICODE_STRING ProfilePath;
541 RPC_UNICODE_STRING WorkStations;
542 OLD_LARGE_INTEGER LastLogon;
543 OLD_LARGE_INTEGER LastLogoff;
544 OLD_LARGE_INTEGER PasswordLastSet;
545 OLD_LARGE_INTEGER PasswordCanChange;
546 OLD_LARGE_INTEGER PasswordMustChange;
547 SAMPR_LOGON_HOURS LogonHours;
548 unsigned short BadPasswordCount;
549 unsigned short LogonCount;
550 unsigned long UserAccountControl;
551 } SAMPR_USER_LOGON_INFORMATION, *PSAMPR_USER_LOGON_INFORMATION;
552
553 typedef struct _SAMPR_USER_ACCOUNT_INFORMATION
554 {
555 RPC_UNICODE_STRING UserName;
556 RPC_UNICODE_STRING FullName;
557 unsigned long UserId;
558 unsigned long PrimaryGroupId;
559 RPC_UNICODE_STRING HomeDirectory;
560 RPC_UNICODE_STRING HomeDirectoryDrive;
561 RPC_UNICODE_STRING ScriptPath;
562 RPC_UNICODE_STRING ProfilePath;
563 RPC_UNICODE_STRING AdminComment;
564 RPC_UNICODE_STRING WorkStations;
565 OLD_LARGE_INTEGER LastLogon;
566 OLD_LARGE_INTEGER LastLogoff;
567 SAMPR_LOGON_HOURS LogonHours;
568 unsigned short BadPasswordCount;
569 unsigned short LogonCount;
570 OLD_LARGE_INTEGER PasswordLastSet;
571 OLD_LARGE_INTEGER AccountExpires;
572 unsigned long UserAccountControl;
573 } SAMPR_USER_ACCOUNT_INFORMATION, *PSAMPR_USER_ACCOUNT_INFORMATION;
574
575 typedef struct _SAMPR_USER_A_NAME_INFORMATION
576 {
577 RPC_UNICODE_STRING UserName;
578 } SAMPR_USER_A_NAME_INFORMATION, *PSAMPR_USER_A_NAME_INFORMATION;
579
580 typedef struct _SAMPR_USER_F_NAME_INFORMATION
581 {
582 RPC_UNICODE_STRING FullName;
583 } SAMPR_USER_F_NAME_INFORMATION, *PSAMPR_USER_F_NAME_INFORMATION;
584
585 typedef struct _SAMPR_USER_NAME_INFORMATION
586 {
587 RPC_UNICODE_STRING UserName;
588 RPC_UNICODE_STRING FullName;
589 } SAMPR_USER_NAME_INFORMATION, *PSAMPR_USER_NAME_INFORMATION;
590
591 typedef struct _SAMPR_USER_HOME_INFORMATION
592 {
593 RPC_UNICODE_STRING HomeDirectory;
594 RPC_UNICODE_STRING HomeDirectoryDrive;
595 } SAMPR_USER_HOME_INFORMATION, *PSAMPR_USER_HOME_INFORMATION;
596
597 typedef struct _SAMPR_USER_SCRIPT_INFORMATION
598 {
599 RPC_UNICODE_STRING ScriptPath;
600 } SAMPR_USER_SCRIPT_INFORMATION, *PSAMPR_USER_SCRIPT_INFORMATION;
601
602 typedef struct _SAMPR_USER_PROFILE_INFORMATION
603 {
604 RPC_UNICODE_STRING ProfilePath;
605 } SAMPR_USER_PROFILE_INFORMATION, *PSAMPR_USER_PROFILE_INFORMATION;
606
607 typedef struct _SAMPR_USER_ADMIN_COMMENT_INFORMATION
608 {
609 RPC_UNICODE_STRING AdminComment;
610 } SAMPR_USER_ADMIN_COMMENT_INFORMATION, *PSAMPR_USER_ADMIN_COMMENT_INFORMATION;
611
612 typedef struct _SAMPR_USER_WORKSTATIONS_INFORMATION
613 {
614 RPC_UNICODE_STRING WorkStations;
615 } SAMPR_USER_WORKSTATIONS_INFORMATION, *PSAMPR_USER_WORKSTATIONS_INFORMATION;
616
617 typedef struct _SAMPR_USER_SET_PASSWORD_INFORMATION
618 {
619 // SAMPR_ENCRYPTED_USER_PASSWORD Password;
620 RPC_UNICODE_STRING Password;
621 BOOLEAN PasswordExpired;
622 } SAMPR_USER_SET_PASSWORD_INFORMATION, *PSAMPR_USER_SET_PASSWORD_INFORMATION;
623
624 typedef struct _SAMPR_USER_LOGON_HOURS_INFORMATION
625 {
626 SAMPR_LOGON_HOURS LogonHours;
627 } SAMPR_USER_LOGON_HOURS_INFORMATION, *PSAMPR_USER_LOGON_HOURS_INFORMATION;
628
629 typedef struct _SAMPR_USER_INTERNAL1_INFORMATION
630 {
631 ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword;
632 ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword;
633 BOOLEAN NtPasswordPresent;
634 BOOLEAN LmPasswordPresent;
635 BOOLEAN PasswordExpired;
636 } SAMPR_USER_INTERNAL1_INFORMATION, *PSAMPR_USER_INTERNAL1_INFORMATION;
637
638 typedef struct _SAMPR_USER_INTERNAL4_INFORMATION
639 {
640 SAMPR_USER_ALL_INFORMATION I1;
641 SAMPR_ENCRYPTED_USER_PASSWORD UserPassword;
642 } SAMPR_USER_INTERNAL4_INFORMATION, *PSAMPR_USER_INTERNAL4_INFORMATION;
643
644 typedef struct _SAMPR_USER_INTERNAL4_INFORMATION_NEW
645 {
646 SAMPR_USER_ALL_INFORMATION I1;
647 SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword;
648 } SAMPR_USER_INTERNAL4_INFORMATION_NEW, *PSAMPR_USER_INTERNAL4_INFORMATION_NEW;
649
650 typedef struct _SAMPR_USER_INTERNAL5_INFORMATION
651 {
652 SAMPR_ENCRYPTED_USER_PASSWORD UserPassword;
653 BOOLEAN PasswordExpired;
654 } SAMPR_USER_INTERNAL5_INFORMATION, *PSAMPR_USER_INTERNAL5_INFORMATION;
655
656 typedef struct _SAMPR_USER_INTERNAL5_INFORMATION_NEW
657 {
658 SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword;
659 BOOLEAN PasswordExpired;
660 } SAMPR_USER_INTERNAL5_INFORMATION_NEW, *PSAMPR_USER_INTERNAL5_INFORMATION_NEW;
661
662 cpp_quote("#ifndef _NTSAM_")
663 typedef enum _USER_INFORMATION_CLASS
664 {
665 UserGeneralInformation = 1,
666 UserPreferencesInformation = 2,
667 UserLogonInformation = 3,
668 UserLogonHoursInformation = 4,
669 UserAccountInformation = 5,
670 UserNameInformation = 6,
671 UserAccountNameInformation = 7,
672 UserFullNameInformation = 8,
673 UserPrimaryGroupInformation = 9,
674 UserHomeInformation = 10,
675 UserScriptInformation = 11,
676 UserProfileInformation = 12,
677 UserAdminCommentInformation = 13,
678 UserWorkStationsInformation = 14,
679 UserSetPasswordInformation = 15, /* This is missing from the SAM RPC documentation */
680 UserControlInformation = 16,
681 UserExpiresInformation = 17,
682 UserInternal1Information = 18,
683 UserInternal2Information = 19, /* This is missing from the SAM RPC documentation */
684 UserParametersInformation = 20,
685 UserAllInformation = 21,
686 UserInternal3Information = 22, /* This is missing from the SAM RPC documentation */
687 UserInternal4Information = 23,
688 UserInternal5Information = 24,
689 UserInternal4InformationNew = 25,
690 UserInternal5InformationNew = 26,
691 UserInternal6Information, /* This is missing from the SAM RPC documentation */
692 UserExtendedInformation, /* This is missing from the SAM RPC documentation */
693 UserLogonUIInformation, /* This is missing from the SAM RPC documentation */
694 } USER_INFORMATION_CLASS, *PUSER_INFORMATION_CLASS;
695 cpp_quote("#endif")
696
697 typedef [switch_type(USER_INFORMATION_CLASS)] union _SAMPR_USER_INFO_BUFFER
698 {
699 [case(UserGeneralInformation)] SAMPR_USER_GENERAL_INFORMATION General;
700 [case(UserPreferencesInformation)] SAMPR_USER_PREFERENCES_INFORMATION Preferences;
701 [case(UserLogonInformation)] SAMPR_USER_LOGON_INFORMATION Logon;
702 [case(UserLogonHoursInformation)] SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours;
703 [case(UserAccountInformation)] SAMPR_USER_ACCOUNT_INFORMATION Account;
704 [case(UserNameInformation)] SAMPR_USER_NAME_INFORMATION Name;
705 [case(UserAccountNameInformation)] SAMPR_USER_A_NAME_INFORMATION AccountName;
706 [case(UserFullNameInformation)] SAMPR_USER_F_NAME_INFORMATION FullName;
707 [case(UserPrimaryGroupInformation)] USER_PRIMARY_GROUP_INFORMATION PrimaryGroup;
708 [case(UserHomeInformation)] SAMPR_USER_HOME_INFORMATION Home;
709 [case(UserScriptInformation)] SAMPR_USER_SCRIPT_INFORMATION Script;
710 [case(UserProfileInformation)] SAMPR_USER_PROFILE_INFORMATION Profile;
711 [case(UserAdminCommentInformation)] SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment;
712 [case(UserWorkStationsInformation)] SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations;
713 [case(UserSetPasswordInformation)] SAMPR_USER_SET_PASSWORD_INFORMATION SetPassword;
714 [case(UserControlInformation)] USER_CONTROL_INFORMATION Control;
715 [case(UserExpiresInformation)] USER_EXPIRES_INFORMATION Expires;
716 [case(UserInternal1Information)] SAMPR_USER_INTERNAL1_INFORMATION Internal1;
717 [case(UserParametersInformation)] SAMPR_USER_PARAMETERS_INFORMATION Parameters;
718 [case(UserAllInformation)] SAMPR_USER_ALL_INFORMATION All;
719 [case(UserInternal4Information)] SAMPR_USER_INTERNAL4_INFORMATION Internal4;
720 [case(UserInternal5Information)] SAMPR_USER_INTERNAL5_INFORMATION Internal5;
721 [case(UserInternal4InformationNew)] SAMPR_USER_INTERNAL4_INFORMATION_NEW Internal4New;
722 [case(UserInternal5InformationNew)] SAMPR_USER_INTERNAL5_INFORMATION_NEW Internal5New;
723 } SAMPR_USER_INFO_BUFFER, *PSAMPR_USER_INFO_BUFFER;
724
725 typedef enum _PASSWORD_POLICY_VALIDATION_TYPE
726 {
727 SamValidateAuthentication = 1,
728 SamValidatePasswordChange,
729 SamValidatePasswordReset
730 } PASSWORD_POLICY_VALIDATION_TYPE;
731
732 typedef struct _SAM_VALIDATE_PASSWORD_HASH
733 {
734 unsigned long Length;
735 [unique,size_is(Length)] unsigned char* Hash;
736 } SAM_VALIDATE_PASSWORD_HASH, *PSAM_VALIDATE_PASSWORD_HASH;
737
738 typedef struct _SAM_VALIDATE_PERSISTED_FIELDS
739 {
740 unsigned long PresentFields;
741 LARGE_INTEGER PasswordLastSet;
742 LARGE_INTEGER BadPasswordTime;
743 LARGE_INTEGER LockoutTime;
744 unsigned long BadPasswordCount;
745 unsigned long PasswordHistoryLength;
746 [unique,size_is(PasswordHistoryLength)] PSAM_VALIDATE_PASSWORD_HASH PasswordHistory;
747 } SAM_VALIDATE_PERSISTED_FIELDS, *PSAM_VALIDATE_PERSISTED_FIELDS;
748
749 typedef enum _SAM_VALIDATE_VALIDATION_STATUS
750 {
751 SamValidateSuccess = 0,
752 SamValidatePasswordMustChange,
753 SamValidateAccountLockedOut,
754 SamValidatePasswordExpired,
755 SamValidatePasswordIncorrect,
756 SamValidatePasswordIsInHistory,
757 SamValidatePasswordTooShort,
758 SamValidatePasswordTooLong,
759 SamValidatePasswordNotComplexEnough,
760 SamValidatePasswordTooRecent,
761 SamValidatePasswordFilterError
762 } SAM_VALIDATE_VALIDATION_STATUS, *PSAM_VALIDATE_VALIDATION_STATUS;
763
764 typedef struct _SAM_VALIDATE_STANDARD_OUTPUT_ARG
765 {
766 SAM_VALIDATE_PERSISTED_FIELDS ChangedPersistedFields;
767 SAM_VALIDATE_VALIDATION_STATUS ValidationStatus;
768 } SAM_VALIDATE_STANDARD_OUTPUT_ARG, *PSAM_VALIDATE_STANDARD_OUTPUT_ARG;
769
770 typedef struct _SAM_VALIDATE_AUTHENTICATION_INPUT_ARG
771 {
772 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
773 unsigned char PasswordMatched;
774 } SAM_VALIDATE_AUTHENTICATION_INPUT_ARG, *PSAM_VALIDATE_AUTHENTICATION_INPUT_ARG;
775
776 typedef struct _SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG
777 {
778 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
779 RPC_UNICODE_STRING ClearPassword;
780 RPC_UNICODE_STRING UserAccountName;
781 SAM_VALIDATE_PASSWORD_HASH HashedPassword;
782 unsigned char PasswordMatch;
783 } SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
784
785 typedef struct _SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG
786 {
787 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
788 RPC_UNICODE_STRING ClearPassword;
789 RPC_UNICODE_STRING UserAccountName;
790 SAM_VALIDATE_PASSWORD_HASH HashedPassword;
791 unsigned char PasswordMustChangeAtNextLogon;
792 unsigned char ClearLockout;
793 } SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_RESET_INPUT_ARG;
794
795 typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_INPUT_ARG
796 {
797 [case(SamValidateAuthentication)] SAM_VALIDATE_AUTHENTICATION_INPUT_ARG ValidateAuthenticationInput;
798 [case(SamValidatePasswordChange)] SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG ValidatePasswordChangeInput;
799 [case(SamValidatePasswordReset)] SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG ValidatePasswordResetInput;
800 } SAM_VALIDATE_INPUT_ARG, *PSAM_VALIDATE_INPUT_ARG;
801
802 typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_OUTPUT_ARG
803 {
804 [case(SamValidateAuthentication)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidateAuthenticationOutput;
805 [case(SamValidatePasswordChange)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordChangeOutput;
806 [case(SamValidatePasswordReset)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordResetOutput;
807 } SAM_VALIDATE_OUTPUT_ARG, *PSAM_VALIDATE_OUTPUT_ARG;
808
809 [
810 uuid(12345778-1234-ABCD-EF00-0123456789AC),
811 version(1.0),
812 pointer_default(unique),
813 endpoint("ncacn_np:[\\pipe\\samr]")
814 #ifndef __midl
815 ,explicit_handle
816 #endif
817 ]
818 interface samr
819 {
820 /* Function 0 */
821 NTSTATUS
822 __stdcall
823 SamrConnect(
824 [in, unique] PSAMPR_SERVER_NAME ServerName,
825 [out] SAMPR_HANDLE *ServerHandle,
826 [in] ACCESS_MASK DesiredAccess);
827
828 /* Function 1 */
829 NTSTATUS
830 __stdcall
831 SamrCloseHandle(
832 [in,out] SAMPR_HANDLE *SamHandle);
833
834 /* Function 2 */
835 NTSTATUS
836 __stdcall
837 SamrSetSecurityObject(
838 [in] SAMPR_HANDLE ObjectHandle,
839 [in] SECURITY_INFORMATION SecurityInformation,
840 [in] PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor);
841
842 /* Function 3 */
843 NTSTATUS
844 __stdcall
845 SamrQuerySecurityObject(
846 [in] SAMPR_HANDLE ObjectHandle,
847 [in] SECURITY_INFORMATION SecurityInformation,
848 [out] PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor);
849
850 /* Function 4 */
851 NTSTATUS
852 __stdcall
853 SamrShutdownSamServer(
854 [in] SAMPR_HANDLE ServerHandle);
855
856 /* Function 5 */
857 NTSTATUS
858 __stdcall
859 SamrLookupDomainInSamServer(
860 [in] SAMPR_HANDLE ServerHandle,
861 [in] PRPC_UNICODE_STRING Name,
862 [out] PRPC_SID *DomainId);
863
864 /* Function 6 */
865 NTSTATUS
866 __stdcall
867 SamrEnumerateDomainsInSamServer(
868 [in] SAMPR_HANDLE ServerHandle,
869 [in,out] unsigned long *EnumerationContext,
870 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
871 [in] unsigned long PreferedMaximumLength,
872 [out] unsigned long *CountReturned);
873
874 /* Function 7 */
875 NTSTATUS
876 __stdcall
877 SamrOpenDomain(
878 [in] SAMPR_HANDLE ServerHandle,
879 [in] ACCESS_MASK DesiredAccess,
880 [in] PRPC_SID DomainId,
881 [out] SAMPR_HANDLE *DomainHandle);
882
883 /* Function 8 */
884 NTSTATUS
885 __stdcall
886 SamrQueryInformationDomain(
887 [in] SAMPR_HANDLE DomainHandle,
888 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
889 [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer);
890
891 /* Function 9 */
892 NTSTATUS
893 __stdcall
894 SamrSetInformationDomain(
895 [in] SAMPR_HANDLE DomainHandle,
896 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
897 [in, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER DomainInformation);
898
899 /* Function 10 */
900 NTSTATUS
901 __stdcall
902 SamrCreateGroupInDomain(
903 [in] SAMPR_HANDLE DomainHandle,
904 [in] PRPC_UNICODE_STRING Name,
905 [in] ACCESS_MASK DesiredAccess,
906 [out] SAMPR_HANDLE *GroupHandle,
907 [out] unsigned long *RelativeId);
908
909 /* Function 11 */
910 NTSTATUS
911 __stdcall
912 SamrEnumerateGroupsInDomain(
913 [in] SAMPR_HANDLE DomainHandle,
914 [in,out] unsigned long *EnumerationContext,
915 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
916 [in] unsigned long PreferedMaximumLength,
917 [out] unsigned long *CountReturned);
918
919 /* Function 12 */
920 NTSTATUS
921 __stdcall
922 SamrCreateUserInDomain([in] SAMPR_HANDLE DomainHandle,
923 [in] PRPC_UNICODE_STRING Name,
924 [in] ACCESS_MASK DesiredAccess,
925 [out] SAMPR_HANDLE *UserHandle,
926 [out] unsigned long *RelativeId);
927
928 /* Function 13 */
929 NTSTATUS
930 __stdcall
931 SamrEnumerateUsersInDomain([in] SAMPR_HANDLE DomainHandle,
932 [in,out] unsigned long *EnumerationContext,
933 [in] unsigned long UserAccountControl,
934 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
935 [in] unsigned long PreferedMaximumLength,
936 [out] unsigned long *CountReturned);
937
938 /* Function 14 */
939 NTSTATUS
940 __stdcall
941 SamrCreateAliasInDomain([in] SAMPR_HANDLE DomainHandle,
942 [in] PRPC_UNICODE_STRING AccountName,
943 [in] ACCESS_MASK DesiredAccess,
944 [out] SAMPR_HANDLE *AliasHandle,
945 [out] unsigned long *RelativeId);
946
947 /* Function 15 */
948 NTSTATUS
949 __stdcall
950 SamrEnumerateAliasesInDomain([in] SAMPR_HANDLE DomainHandle,
951 [in,out] unsigned long *EnumerationContext,
952 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
953 [in] unsigned long PreferedMaximumLength,
954 [out] unsigned long *CountReturned);
955
956 /* Function 16 */
957 NTSTATUS
958 __stdcall
959 SamrGetAliasMembership([in] SAMPR_HANDLE DomainHandle,
960 [in] PSAMPR_PSID_ARRAY SidArray,
961 [out] PSAMPR_ULONG_ARRAY Membership);
962
963 /* Function 17 */
964 NTSTATUS
965 __stdcall
966 SamrLookupNamesInDomain([in] SAMPR_HANDLE DomainHandle,
967 [in, range(0, 1000)] unsigned long Count,
968 [in, size_is(1000), length_is(Count)] RPC_UNICODE_STRING Names[*],
969 [out] PSAMPR_ULONG_ARRAY RelativeIds,
970 [out] PSAMPR_ULONG_ARRAY Use);
971
972 /* Function 18 */
973 NTSTATUS
974 __stdcall
975 SamrLookupIdsInDomain(
976 [in] SAMPR_HANDLE DomainHandle,
977 [in, range(0, 1000)] unsigned long Count,
978 [in, size_is(1000), length_is(Count)] unsigned long *RelativeIds,
979 [out] PSAMPR_RETURNED_USTRING_ARRAY Names,
980 [out] PSAMPR_ULONG_ARRAY Use);
981
982 /* Function 19 */
983 NTSTATUS
984 __stdcall
985 SamrOpenGroup(
986 [in] SAMPR_HANDLE DomainHandle,
987 [in] ACCESS_MASK DesiredAccess,
988 [in] unsigned long GroupId,
989 [out] SAMPR_HANDLE *GroupHandle);
990
991 /* Function 20 */
992 NTSTATUS
993 __stdcall
994 SamrQueryInformationGroup(
995 [in] SAMPR_HANDLE GroupHandle,
996 [in] GROUP_INFORMATION_CLASS GroupInformationClass,
997 [out, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER *Buffer);
998
999 /* Function 21 */
1000 NTSTATUS
1001 __stdcall
1002 SamrSetInformationGroup(
1003 [in] SAMPR_HANDLE GroupHandle,
1004 [in] GROUP_INFORMATION_CLASS GroupInformationClass,
1005 [in, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER Buffer);
1006
1007 /* Function 22 */
1008 NTSTATUS
1009 __stdcall
1010 SamrAddMemberToGroup(
1011 [in] SAMPR_HANDLE GroupHandle,
1012 [in] unsigned long MemberId,
1013 [in] unsigned long Attributes);
1014
1015 /* Function 21 */
1016 NTSTATUS
1017 __stdcall
1018 SamrDeleteGroup(
1019 [in,out] SAMPR_HANDLE *GroupHandle);
1020
1021 /* Function 24 */
1022 NTSTATUS
1023 __stdcall
1024 SamrRemoveMemberFromGroup(
1025 [in] SAMPR_HANDLE GroupHandle,
1026 [in] unsigned long MemberId);
1027
1028 /* Function 25 */
1029 NTSTATUS
1030 __stdcall
1031 SamrGetMembersInGroup(
1032 [in] SAMPR_HANDLE GroupHandle,
1033 [out] PSAMPR_GET_MEMBERS_BUFFER *Members);
1034
1035 /* Function 26 */
1036 NTSTATUS
1037 __stdcall
1038 SamrSetMemberAttributesOfGroup(
1039 [in] SAMPR_HANDLE GroupHandle,
1040 [in] unsigned long MemberId,
1041 [in] unsigned long Attributes);
1042
1043 /* Function 27 */
1044 NTSTATUS
1045 __stdcall
1046 SamrOpenAlias(
1047 [in] SAMPR_HANDLE DomainHandle,
1048 [in] ACCESS_MASK DesiredAccess,
1049 [in] ULONG AliasId,
1050 [out] SAMPR_HANDLE *AliasHandle);
1051
1052 /* Function 28 */
1053 NTSTATUS
1054 __stdcall
1055 SamrQueryInformationAlias(
1056 [in] SAMPR_HANDLE AliasHandle,
1057 [in] ALIAS_INFORMATION_CLASS AliasInformationClass,
1058 [out, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER *Buffer);
1059
1060 /* Function 29 */
1061 NTSTATUS
1062 __stdcall
1063 SamrSetInformationAlias(
1064 [in] SAMPR_HANDLE AliasHandle,
1065 [in] ALIAS_INFORMATION_CLASS AliasInformationClass,
1066 [in, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER Buffer);
1067
1068 /* Function 30 */
1069 NTSTATUS
1070 __stdcall
1071 SamrDeleteAlias(
1072 [in, out] SAMPR_HANDLE *AliasHandle);
1073
1074 /* Function 31 */
1075 NTSTATUS
1076 __stdcall
1077 SamrAddMemberToAlias(
1078 [in] SAMPR_HANDLE AliasHandle,
1079 [in] PRPC_SID MemberId);
1080
1081 /* Function 32 */
1082 NTSTATUS
1083 __stdcall
1084 SamrRemoveMemberFromAlias(
1085 [in] SAMPR_HANDLE AliasHandle,
1086 [in] PRPC_SID MemberId);
1087
1088 /* Function 33 */
1089 NTSTATUS
1090 __stdcall
1091 SamrGetMembersInAlias(
1092 [in] SAMPR_HANDLE AliasHandle,
1093 [out] PSAMPR_PSID_ARRAY_OUT Members);
1094
1095 /* Function 34 */
1096 NTSTATUS
1097 __stdcall
1098 SamrOpenUser(
1099 [in] SAMPR_HANDLE DomainHandle,
1100 [in] ACCESS_MASK DesiredAccess,
1101 [in] ULONG UserId,
1102 [out] SAMPR_HANDLE *UserHandle);
1103
1104 /* Function 35 */
1105 NTSTATUS
1106 __stdcall
1107 SamrDeleteUser(
1108 [in,out] SAMPR_HANDLE *UserHandle);
1109
1110 /* Function 36 */
1111 NTSTATUS
1112 __stdcall
1113 SamrQueryInformationUser(
1114 [in] SAMPR_HANDLE UserHandle,
1115 [in] USER_INFORMATION_CLASS UserInformationClass,
1116 [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer);
1117
1118 /* Function 37 */
1119 NTSTATUS
1120 __stdcall
1121 SamrSetInformationUser(
1122 [in] SAMPR_HANDLE UserHandle,
1123 [in] USER_INFORMATION_CLASS UserInformationClass,
1124 [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer);
1125
1126 /* Function 38 */
1127 NTSTATUS
1128 __stdcall
1129 SamrChangePasswordUser(
1130 [in] SAMPR_HANDLE UserHandle,
1131 [in] unsigned char LmPresent,
1132 [in, unique] PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm,
1133 [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm,
1134 [in] unsigned char NtPresent,
1135 [in, unique] PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt,
1136 [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt,
1137 [in] unsigned char NtCrossEncryptionPresent,
1138 [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm,
1139 [in] unsigned char LmCrossEncryptionPresent,
1140 [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt);
1141
1142 /* Function 39 */
1143 NTSTATUS
1144 __stdcall
1145 SamrGetGroupsForUser(
1146 [in] SAMPR_HANDLE UserHandle,
1147 [out] PSAMPR_GET_GROUPS_BUFFER *Groups);
1148
1149 /* Function 40 */
1150 NTSTATUS
1151 __stdcall
1152 SamrQueryDisplayInformation(
1153 [in] SAMPR_HANDLE DomainHandle,
1154 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1155 [in] unsigned long Index,
1156 [in] unsigned long EntryCount,
1157 [in] unsigned long PreferredMaximumLength,
1158 [out] unsigned long * TotalAvailable,
1159 [out] unsigned long * TotalReturned,
1160 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1161
1162 /* Function 41 */
1163 NTSTATUS
1164 __stdcall
1165 SamrGetDisplayEnumerationIndex(
1166 [in] SAMPR_HANDLE DomainHandle,
1167 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1168 [in] PRPC_UNICODE_STRING Prefix,
1169 [out] unsigned long *Index);
1170
1171 /* Function 42 */
1172 NTSTATUS
1173 __stdcall
1174 SamrTestPrivateFunctionsDomain(
1175 [in] SAMPR_HANDLE DomainHandle);
1176
1177 /* Function 43 */
1178 NTSTATUS
1179 __stdcall
1180 SamrTestPrivateFunctionsUser(
1181 [in] SAMPR_HANDLE UserHandle);
1182
1183 /* Function 44 */
1184 NTSTATUS
1185 __stdcall
1186 SamrGetUserDomainPasswordInformation(
1187 [in] SAMPR_HANDLE UserHandle,
1188 [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation);
1189
1190 /* Function 45 */
1191 NTSTATUS
1192 __stdcall
1193 SamrRemoveMemberFromForeignDomain(
1194 [in] SAMPR_HANDLE DomainHandle,
1195 [in] PRPC_SID MemberSid);
1196
1197 /* Function 46 */
1198 NTSTATUS
1199 __stdcall
1200 SamrQueryInformationDomain2(
1201 [in] SAMPR_HANDLE DomainHandle,
1202 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
1203 [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer);
1204
1205 /* Function 47 */
1206 NTSTATUS
1207 __stdcall
1208 SamrQueryInformationUser2(
1209 [in] SAMPR_HANDLE UserHandle,
1210 [in] USER_INFORMATION_CLASS UserInformationClass,
1211 [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer);
1212
1213 /* Function 48 */
1214 NTSTATUS
1215 __stdcall
1216 SamrQueryDisplayInformation2(
1217 [in] SAMPR_HANDLE DomainHandle,
1218 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1219 [in] unsigned long Index,
1220 [in] unsigned long EntryCount,
1221 [in] unsigned long PreferredMaximumLength,
1222 [out] unsigned long *TotalAvailable,
1223 [out] unsigned long *TotalReturned,
1224 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1225
1226 /* Function 49 */
1227 NTSTATUS
1228 __stdcall
1229 SamrGetDisplayEnumerationIndex2(
1230 [in] SAMPR_HANDLE DomainHandle,
1231 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1232 [in] PRPC_UNICODE_STRING Prefix,
1233 [out] unsigned long *Index);
1234
1235 /* Function 50 */
1236 NTSTATUS
1237 __stdcall
1238 SamrCreateUser2InDomain(
1239 [in] SAMPR_HANDLE DomainHandle,
1240 [in] PRPC_UNICODE_STRING Name,
1241 [in] unsigned long AccountType,
1242 [in] ACCESS_MASK DesiredAccess,
1243 [out] SAMPR_HANDLE *UserHandle,
1244 [out] unsigned long *GrantedAccess,
1245 [out] unsigned long *RelativeId);
1246
1247 /* Function 51 */
1248 NTSTATUS
1249 __stdcall
1250 SamrQueryDisplayInformation3(
1251 [in] SAMPR_HANDLE DomainHandle,
1252 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1253 [in] unsigned long Index,
1254 [in] unsigned long EntryCount,
1255 [in] unsigned long PreferredMaximumLength,
1256 [out] unsigned long *TotalAvailable,
1257 [out] unsigned long *TotalReturned,
1258 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1259
1260 /* Function 52 */
1261 NTSTATUS
1262 __stdcall
1263 SamrAddMultipleMembersToAlias(
1264 [in] SAMPR_HANDLE AliasHandle,
1265 [in] PSAMPR_PSID_ARRAY MembersBuffer);
1266
1267 /* Function 53 */
1268 NTSTATUS
1269 __stdcall
1270 SamrRemoveMultipleMembersFromAlias(
1271 [in] SAMPR_HANDLE AliasHandle,
1272 [in] PSAMPR_PSID_ARRAY MembersBuffer);
1273
1274 /* Function 54 */
1275 NTSTATUS
1276 __stdcall
1277 SamrOemChangePasswordUser2(
1278 [in] handle_t BindingHandle,
1279 [in,unique] PRPC_STRING ServerName,
1280 [in] PRPC_STRING UserName,
1281 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm,
1282 [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLm);
1283
1284 /* Function 55 */
1285 NTSTATUS
1286 __stdcall
1287 SamrUnicodeChangePasswordUser2(
1288 [in] handle_t BindingHandle,
1289 [in,unique] PRPC_UNICODE_STRING ServerName,
1290 [in] PRPC_UNICODE_STRING UserName,
1291 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt,
1292 [in,unique] PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt,
1293 [in] unsigned char LmPresent,
1294 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm,
1295 [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewNt);
1296
1297 /* Function 56 */
1298 NTSTATUS
1299 __stdcall
1300 SamrGetDomainPasswordInformation(
1301 [in] handle_t BindingHandle,
1302 [in,unique] PRPC_UNICODE_STRING Unused,
1303 [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation);
1304
1305 /* Function 57 */
1306 NTSTATUS
1307 __stdcall
1308 SamrConnect2(
1309 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1310 [out] SAMPR_HANDLE *ServerHandle,
1311 [in] ACCESS_MASK DesiredAccess);
1312
1313 /* Function 58 */
1314 NTSTATUS
1315 __stdcall
1316 SamrSetInformationUser2(
1317 [in] SAMPR_HANDLE UserHandle,
1318 [in] USER_INFORMATION_CLASS UserInformationClass,
1319 [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer);
1320
1321 /* Function 59 */
1322 NTSTATUS
1323 __stdcall
1324 SamrSetBootKeyInformation(
1325 [in] handle_t BindingHandle); /* FIXME */
1326
1327 /* Function 60 */
1328 NTSTATUS
1329 __stdcall
1330 SamrGetBootKeyInformation(
1331 [in] handle_t BindingHandle); /* FIXME */
1332
1333 /* Function 61 */
1334 NTSTATUS
1335 __stdcall
1336 SamrConnect3(
1337 [in] handle_t BindingHandle); /* FIXME */
1338
1339 /* Function 62 */
1340 NTSTATUS
1341 __stdcall
1342 SamrConnect4(
1343 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1344 [out] SAMPR_HANDLE *ServerHandle,
1345 [in] unsigned long ClientRevision,
1346 [in] ACCESS_MASK DesiredAccess);
1347
1348 /* Function 63 */
1349 NTSTATUS
1350 __stdcall
1351 SamrUnicodeChangePasswordUser3(
1352 [in] handle_t BindingHandle); /* FIXME */
1353
1354 /* Function 64 */
1355 NTSTATUS
1356 __stdcall
1357 SamrConnect5(
1358 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1359 [in] ACCESS_MASK DesiredAccess,
1360 [in] unsigned long InVersion,
1361 [in,switch_is(InVersion)] SAMPR_REVISION_INFO *InRevisionInfo,
1362 [out] unsigned long *OutVersion,
1363 [out,switch_is(*OutVersion)] SAMPR_REVISION_INFO *OutRevisionInfo,
1364 [out] SAMPR_HANDLE *ServerHandle);
1365
1366 /* Function 65 */
1367 NTSTATUS
1368 __stdcall
1369 SamrRidToSid(
1370 [in] SAMPR_HANDLE ObjectHandle,
1371 [in] unsigned long Rid,
1372 [out] PRPC_SID *Sid);
1373
1374 /* Function 66 */
1375 NTSTATUS
1376 __stdcall
1377 SamrSetDSRMPassword(
1378 [in] handle_t BindingHandle,
1379 [in,unique] PRPC_UNICODE_STRING Unused,
1380 [in] unsigned long UserId,
1381 [in,unique] PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword);
1382
1383 /* Function 67 */
1384 NTSTATUS
1385 __stdcall
1386 SamrValidatePassword(
1387 [in] handle_t Handle,
1388 [in] PASSWORD_POLICY_VALIDATION_TYPE ValidationType,
1389 [in,switch_is(ValidationType)] PSAM_VALIDATE_INPUT_ARG InputArg,
1390 [out,switch_is(ValidationType)] PSAM_VALIDATE_OUTPUT_ARG *OutputArg);
1391 }