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