[NETAPI32]
[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 cpp_quote("#ifndef _NTSAM_")
451 typedef struct _USER_PRIMARY_GROUP_INFORMATION
452 {
453 unsigned long PrimaryGroupId;
454 } USER_PRIMARY_GROUP_INFORMATION, *PUSER_PRIMARY_GROUP_INFORMATION;
455
456 typedef struct _USER_CONTROL_INFORMATION
457 {
458 unsigned long UserAccountControl;
459 } USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION;
460 cpp_quote("#endif")
461
462 typedef struct _USER_EXPIRES_INFORMATION
463 {
464 OLD_LARGE_INTEGER AccountExpires;
465 } USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION;
466
467 typedef struct _SAMPR_LOGON_HOURS
468 {
469 unsigned short UnitsPerWeek;
470 // [size_is(1260), length_is((UnitsPerWeek + 7) / 8)] unsigned char *LogonHours; // FIXME
471 [size_is(1260)] unsigned char *LogonHours;
472 } SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS;
473
474 typedef struct _SAMPR_USER_ALL_INFORMATION
475 {
476 OLD_LARGE_INTEGER LastLogon;
477 OLD_LARGE_INTEGER LastLogoff;
478 OLD_LARGE_INTEGER PasswordLastSet;
479 OLD_LARGE_INTEGER AccountExpires;
480 OLD_LARGE_INTEGER PasswordCanChange;
481 OLD_LARGE_INTEGER PasswordMustChange;
482 RPC_UNICODE_STRING UserName;
483 RPC_UNICODE_STRING FullName;
484 RPC_UNICODE_STRING HomeDirectory;
485 RPC_UNICODE_STRING HomeDirectoryDrive;
486 RPC_UNICODE_STRING ScriptPath;
487 RPC_UNICODE_STRING ProfilePath;
488 RPC_UNICODE_STRING AdminComment;
489 RPC_UNICODE_STRING WorkStations;
490 RPC_UNICODE_STRING UserComment;
491 RPC_UNICODE_STRING Parameters;
492 RPC_SHORT_BLOB LmOwfPassword;
493 RPC_SHORT_BLOB NtOwfPassword;
494 RPC_UNICODE_STRING PrivateData;
495 SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor;
496 unsigned long UserId;
497 unsigned long PrimaryGroupId;
498 unsigned long UserAccountControl;
499 unsigned long WhichFields;
500 SAMPR_LOGON_HOURS LogonHours;
501 unsigned short BadPasswordCount;
502 unsigned short LogonCount;
503 unsigned short CountryCode;
504 unsigned short CodePage;
505 unsigned char LmPasswordPresent;
506 unsigned char NtPasswordPresent;
507 unsigned char PasswordExpired;
508 unsigned char PrivateDataSensitive;
509 } SAMPR_USER_ALL_INFORMATION, *PSAMPR_USER_ALL_INFORMATION;
510
511 typedef struct _SAMPR_USER_GENERAL_INFORMATION
512 {
513 RPC_UNICODE_STRING UserName;
514 RPC_UNICODE_STRING FullName;
515 unsigned long PrimaryGroupId;
516 RPC_UNICODE_STRING AdminComment;
517 RPC_UNICODE_STRING UserComment;
518 } SAMPR_USER_GENERAL_INFORMATION, *PSAMPR_USER_GENERAL_INFORMATION;
519
520 typedef struct _SAMPR_USER_PREFERENCES_INFORMATION
521 {
522 RPC_UNICODE_STRING UserComment;
523 RPC_UNICODE_STRING Reserved1;
524 unsigned short CountryCode;
525 unsigned short CodePage;
526 } SAMPR_USER_PREFERENCES_INFORMATION, *PSAMPR_USER_PREFERENCES_INFORMATION;
527
528 typedef struct _SAMPR_USER_PARAMETERS_INFORMATION
529 {
530 RPC_UNICODE_STRING Parameters;
531 } SAMPR_USER_PARAMETERS_INFORMATION, *PSAMPR_USER_PARAMETERS_INFORMATION;
532
533 typedef struct _SAMPR_USER_LOGON_INFORMATION
534 {
535 RPC_UNICODE_STRING UserName;
536 RPC_UNICODE_STRING FullName;
537 unsigned long UserId;
538 unsigned long PrimaryGroupId;
539 RPC_UNICODE_STRING HomeDirectory;
540 RPC_UNICODE_STRING HomeDirectoryDrive;
541 RPC_UNICODE_STRING ScriptPath;
542 RPC_UNICODE_STRING ProfilePath;
543 RPC_UNICODE_STRING WorkStations;
544 OLD_LARGE_INTEGER LastLogon;
545 OLD_LARGE_INTEGER LastLogoff;
546 OLD_LARGE_INTEGER PasswordLastSet;
547 OLD_LARGE_INTEGER PasswordCanChange;
548 OLD_LARGE_INTEGER PasswordMustChange;
549 SAMPR_LOGON_HOURS LogonHours;
550 unsigned short BadPasswordCount;
551 unsigned short LogonCount;
552 unsigned long UserAccountControl;
553 } SAMPR_USER_LOGON_INFORMATION, *PSAMPR_USER_LOGON_INFORMATION;
554
555 typedef struct _SAMPR_USER_ACCOUNT_INFORMATION
556 {
557 RPC_UNICODE_STRING UserName;
558 RPC_UNICODE_STRING FullName;
559 unsigned long UserId;
560 unsigned long PrimaryGroupId;
561 RPC_UNICODE_STRING HomeDirectory;
562 RPC_UNICODE_STRING HomeDirectoryDrive;
563 RPC_UNICODE_STRING ScriptPath;
564 RPC_UNICODE_STRING ProfilePath;
565 RPC_UNICODE_STRING AdminComment;
566 RPC_UNICODE_STRING WorkStations;
567 OLD_LARGE_INTEGER LastLogon;
568 OLD_LARGE_INTEGER LastLogoff;
569 SAMPR_LOGON_HOURS LogonHours;
570 unsigned short BadPasswordCount;
571 unsigned short LogonCount;
572 OLD_LARGE_INTEGER PasswordLastSet;
573 OLD_LARGE_INTEGER AccountExpires;
574 unsigned long UserAccountControl;
575 } SAMPR_USER_ACCOUNT_INFORMATION, *PSAMPR_USER_ACCOUNT_INFORMATION;
576
577 typedef struct _SAMPR_USER_A_NAME_INFORMATION
578 {
579 RPC_UNICODE_STRING UserName;
580 } SAMPR_USER_A_NAME_INFORMATION, *PSAMPR_USER_A_NAME_INFORMATION;
581
582 typedef struct _SAMPR_USER_F_NAME_INFORMATION
583 {
584 RPC_UNICODE_STRING FullName;
585 } SAMPR_USER_F_NAME_INFORMATION, *PSAMPR_USER_F_NAME_INFORMATION;
586
587 typedef struct _SAMPR_USER_NAME_INFORMATION
588 {
589 RPC_UNICODE_STRING UserName;
590 RPC_UNICODE_STRING FullName;
591 } SAMPR_USER_NAME_INFORMATION, *PSAMPR_USER_NAME_INFORMATION;
592
593 typedef struct _SAMPR_USER_HOME_INFORMATION
594 {
595 RPC_UNICODE_STRING HomeDirectory;
596 RPC_UNICODE_STRING HomeDirectoryDrive;
597 } SAMPR_USER_HOME_INFORMATION, *PSAMPR_USER_HOME_INFORMATION;
598
599 typedef struct _SAMPR_USER_SCRIPT_INFORMATION
600 {
601 RPC_UNICODE_STRING ScriptPath;
602 } SAMPR_USER_SCRIPT_INFORMATION, *PSAMPR_USER_SCRIPT_INFORMATION;
603
604 typedef struct _SAMPR_USER_PROFILE_INFORMATION
605 {
606 RPC_UNICODE_STRING ProfilePath;
607 } SAMPR_USER_PROFILE_INFORMATION, *PSAMPR_USER_PROFILE_INFORMATION;
608
609 typedef struct _SAMPR_USER_ADMIN_COMMENT_INFORMATION
610 {
611 RPC_UNICODE_STRING AdminComment;
612 } SAMPR_USER_ADMIN_COMMENT_INFORMATION, *PSAMPR_USER_ADMIN_COMMENT_INFORMATION;
613
614 typedef struct _SAMPR_USER_WORKSTATIONS_INFORMATION
615 {
616 RPC_UNICODE_STRING WorkStations;
617 } SAMPR_USER_WORKSTATIONS_INFORMATION, *PSAMPR_USER_WORKSTATIONS_INFORMATION;
618
619 typedef struct _SAMPR_USER_SET_PASSWORD_INFORMATION
620 {
621 // SAMPR_ENCRYPTED_USER_PASSWORD Password;
622 RPC_UNICODE_STRING Password;
623 BOOLEAN PasswordExpired;
624 } SAMPR_USER_SET_PASSWORD_INFORMATION, *PSAMPR_USER_SET_PASSWORD_INFORMATION;
625
626 typedef struct _SAMPR_USER_LOGON_HOURS_INFORMATION
627 {
628 SAMPR_LOGON_HOURS LogonHours;
629 } SAMPR_USER_LOGON_HOURS_INFORMATION, *PSAMPR_USER_LOGON_HOURS_INFORMATION;
630
631 typedef struct _SAMPR_USER_INTERNAL1_INFORMATION
632 {
633 ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword;
634 ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword;
635 BOOLEAN NtPasswordPresent;
636 BOOLEAN LmPasswordPresent;
637 BOOLEAN PasswordExpired;
638 } SAMPR_USER_INTERNAL1_INFORMATION, *PSAMPR_USER_INTERNAL1_INFORMATION;
639
640 typedef struct _SAMPR_USER_INTERNAL4_INFORMATION
641 {
642 SAMPR_USER_ALL_INFORMATION I1;
643 SAMPR_ENCRYPTED_USER_PASSWORD UserPassword;
644 } SAMPR_USER_INTERNAL4_INFORMATION, *PSAMPR_USER_INTERNAL4_INFORMATION;
645
646 typedef struct _SAMPR_USER_INTERNAL4_INFORMATION_NEW
647 {
648 SAMPR_USER_ALL_INFORMATION I1;
649 SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword;
650 } SAMPR_USER_INTERNAL4_INFORMATION_NEW, *PSAMPR_USER_INTERNAL4_INFORMATION_NEW;
651
652 typedef struct _SAMPR_USER_INTERNAL5_INFORMATION
653 {
654 SAMPR_ENCRYPTED_USER_PASSWORD UserPassword;
655 BOOLEAN PasswordExpired;
656 } SAMPR_USER_INTERNAL5_INFORMATION, *PSAMPR_USER_INTERNAL5_INFORMATION;
657
658 typedef struct _SAMPR_USER_INTERNAL5_INFORMATION_NEW
659 {
660 SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword;
661 BOOLEAN PasswordExpired;
662 } SAMPR_USER_INTERNAL5_INFORMATION_NEW, *PSAMPR_USER_INTERNAL5_INFORMATION_NEW;
663
664 cpp_quote("#ifndef _NTSAM_")
665 typedef enum _USER_INFORMATION_CLASS
666 {
667 UserGeneralInformation = 1,
668 UserPreferencesInformation = 2,
669 UserLogonInformation = 3,
670 UserLogonHoursInformation = 4,
671 UserAccountInformation = 5,
672 UserNameInformation = 6,
673 UserAccountNameInformation = 7,
674 UserFullNameInformation = 8,
675 UserPrimaryGroupInformation = 9,
676 UserHomeInformation = 10,
677 UserScriptInformation = 11,
678 UserProfileInformation = 12,
679 UserAdminCommentInformation = 13,
680 UserWorkStationsInformation = 14,
681 UserSetPasswordInformation = 15, /* This is missing from the SAM RPC documentation */
682 UserControlInformation = 16,
683 UserExpiresInformation = 17,
684 UserInternal1Information = 18,
685 UserInternal2Information = 19, /* This is missing from the SAM RPC documentation */
686 UserParametersInformation = 20,
687 UserAllInformation = 21,
688 UserInternal3Information = 22, /* This is missing from the SAM RPC documentation */
689 UserInternal4Information = 23,
690 UserInternal5Information = 24,
691 UserInternal4InformationNew = 25,
692 UserInternal5InformationNew = 26,
693 UserInternal6Information, /* This is missing from the SAM RPC documentation */
694 UserExtendedInformation, /* This is missing from the SAM RPC documentation */
695 UserLogonUIInformation, /* This is missing from the SAM RPC documentation */
696 } USER_INFORMATION_CLASS, *PUSER_INFORMATION_CLASS;
697 cpp_quote("#endif")
698
699 typedef [switch_type(USER_INFORMATION_CLASS)] union _SAMPR_USER_INFO_BUFFER
700 {
701 [case(UserGeneralInformation)] SAMPR_USER_GENERAL_INFORMATION General;
702 [case(UserPreferencesInformation)] SAMPR_USER_PREFERENCES_INFORMATION Preferences;
703 [case(UserLogonInformation)] SAMPR_USER_LOGON_INFORMATION Logon;
704 [case(UserLogonHoursInformation)] SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours;
705 [case(UserAccountInformation)] SAMPR_USER_ACCOUNT_INFORMATION Account;
706 [case(UserNameInformation)] SAMPR_USER_NAME_INFORMATION Name;
707 [case(UserAccountNameInformation)] SAMPR_USER_A_NAME_INFORMATION AccountName;
708 [case(UserFullNameInformation)] SAMPR_USER_F_NAME_INFORMATION FullName;
709 [case(UserPrimaryGroupInformation)] USER_PRIMARY_GROUP_INFORMATION PrimaryGroup;
710 [case(UserHomeInformation)] SAMPR_USER_HOME_INFORMATION Home;
711 [case(UserScriptInformation)] SAMPR_USER_SCRIPT_INFORMATION Script;
712 [case(UserProfileInformation)] SAMPR_USER_PROFILE_INFORMATION Profile;
713 [case(UserAdminCommentInformation)] SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment;
714 [case(UserWorkStationsInformation)] SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations;
715 [case(UserSetPasswordInformation)] SAMPR_USER_SET_PASSWORD_INFORMATION SetPassword;
716 [case(UserControlInformation)] USER_CONTROL_INFORMATION Control;
717 [case(UserExpiresInformation)] USER_EXPIRES_INFORMATION Expires;
718 [case(UserInternal1Information)] SAMPR_USER_INTERNAL1_INFORMATION Internal1;
719 [case(UserParametersInformation)] SAMPR_USER_PARAMETERS_INFORMATION Parameters;
720 [case(UserAllInformation)] SAMPR_USER_ALL_INFORMATION All;
721 [case(UserInternal4Information)] SAMPR_USER_INTERNAL4_INFORMATION Internal4;
722 [case(UserInternal5Information)] SAMPR_USER_INTERNAL5_INFORMATION Internal5;
723 [case(UserInternal4InformationNew)] SAMPR_USER_INTERNAL4_INFORMATION_NEW Internal4New;
724 [case(UserInternal5InformationNew)] SAMPR_USER_INTERNAL5_INFORMATION_NEW Internal5New;
725 } SAMPR_USER_INFO_BUFFER, *PSAMPR_USER_INFO_BUFFER;
726
727 typedef enum _PASSWORD_POLICY_VALIDATION_TYPE
728 {
729 SamValidateAuthentication = 1,
730 SamValidatePasswordChange,
731 SamValidatePasswordReset
732 } PASSWORD_POLICY_VALIDATION_TYPE;
733
734 typedef struct _SAM_VALIDATE_PASSWORD_HASH
735 {
736 unsigned long Length;
737 [unique,size_is(Length)] unsigned char* Hash;
738 } SAM_VALIDATE_PASSWORD_HASH, *PSAM_VALIDATE_PASSWORD_HASH;
739
740 typedef struct _SAM_VALIDATE_PERSISTED_FIELDS
741 {
742 unsigned long PresentFields;
743 LARGE_INTEGER PasswordLastSet;
744 LARGE_INTEGER BadPasswordTime;
745 LARGE_INTEGER LockoutTime;
746 unsigned long BadPasswordCount;
747 unsigned long PasswordHistoryLength;
748 [unique,size_is(PasswordHistoryLength)] PSAM_VALIDATE_PASSWORD_HASH PasswordHistory;
749 } SAM_VALIDATE_PERSISTED_FIELDS, *PSAM_VALIDATE_PERSISTED_FIELDS;
750
751 typedef enum _SAM_VALIDATE_VALIDATION_STATUS
752 {
753 SamValidateSuccess = 0,
754 SamValidatePasswordMustChange,
755 SamValidateAccountLockedOut,
756 SamValidatePasswordExpired,
757 SamValidatePasswordIncorrect,
758 SamValidatePasswordIsInHistory,
759 SamValidatePasswordTooShort,
760 SamValidatePasswordTooLong,
761 SamValidatePasswordNotComplexEnough,
762 SamValidatePasswordTooRecent,
763 SamValidatePasswordFilterError
764 } SAM_VALIDATE_VALIDATION_STATUS, *PSAM_VALIDATE_VALIDATION_STATUS;
765
766 typedef struct _SAM_VALIDATE_STANDARD_OUTPUT_ARG
767 {
768 SAM_VALIDATE_PERSISTED_FIELDS ChangedPersistedFields;
769 SAM_VALIDATE_VALIDATION_STATUS ValidationStatus;
770 } SAM_VALIDATE_STANDARD_OUTPUT_ARG, *PSAM_VALIDATE_STANDARD_OUTPUT_ARG;
771
772 typedef struct _SAM_VALIDATE_AUTHENTICATION_INPUT_ARG
773 {
774 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
775 unsigned char PasswordMatched;
776 } SAM_VALIDATE_AUTHENTICATION_INPUT_ARG, *PSAM_VALIDATE_AUTHENTICATION_INPUT_ARG;
777
778 typedef struct _SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG
779 {
780 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
781 RPC_UNICODE_STRING ClearPassword;
782 RPC_UNICODE_STRING UserAccountName;
783 SAM_VALIDATE_PASSWORD_HASH HashedPassword;
784 unsigned char PasswordMatch;
785 } SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
786
787 typedef struct _SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG
788 {
789 SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields;
790 RPC_UNICODE_STRING ClearPassword;
791 RPC_UNICODE_STRING UserAccountName;
792 SAM_VALIDATE_PASSWORD_HASH HashedPassword;
793 unsigned char PasswordMustChangeAtNextLogon;
794 unsigned char ClearLockout;
795 } SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_RESET_INPUT_ARG;
796
797 typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_INPUT_ARG
798 {
799 [case(SamValidateAuthentication)] SAM_VALIDATE_AUTHENTICATION_INPUT_ARG ValidateAuthenticationInput;
800 [case(SamValidatePasswordChange)] SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG ValidatePasswordChangeInput;
801 [case(SamValidatePasswordReset)] SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG ValidatePasswordResetInput;
802 } SAM_VALIDATE_INPUT_ARG, *PSAM_VALIDATE_INPUT_ARG;
803
804 typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_OUTPUT_ARG
805 {
806 [case(SamValidateAuthentication)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidateAuthenticationOutput;
807 [case(SamValidatePasswordChange)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordChangeOutput;
808 [case(SamValidatePasswordReset)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordResetOutput;
809 } SAM_VALIDATE_OUTPUT_ARG, *PSAM_VALIDATE_OUTPUT_ARG;
810
811 [
812 uuid(12345778-1234-ABCD-EF00-0123456789AC),
813 version(1.0),
814 pointer_default(unique),
815 endpoint("ncacn_np:[\\pipe\\samr]")
816 #ifndef __midl
817 ,explicit_handle
818 #endif
819 ]
820 interface samr
821 {
822 /* Function 0 */
823 NTSTATUS
824 __stdcall
825 SamrConnect(
826 [in, unique] PSAMPR_SERVER_NAME ServerName,
827 [out] SAMPR_HANDLE *ServerHandle,
828 [in] ACCESS_MASK DesiredAccess);
829
830 /* Function 1 */
831 NTSTATUS
832 __stdcall
833 SamrCloseHandle(
834 [in,out] SAMPR_HANDLE *SamHandle);
835
836 /* Function 2 */
837 NTSTATUS
838 __stdcall
839 SamrSetSecurityObject(
840 [in] SAMPR_HANDLE ObjectHandle,
841 [in] SECURITY_INFORMATION SecurityInformation,
842 [in] PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor);
843
844 /* Function 3 */
845 NTSTATUS
846 __stdcall
847 SamrQuerySecurityObject(
848 [in] SAMPR_HANDLE ObjectHandle,
849 [in] SECURITY_INFORMATION SecurityInformation,
850 [out] PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor);
851
852 /* Function 4 */
853 NTSTATUS
854 __stdcall
855 SamrShutdownSamServer(
856 [in] SAMPR_HANDLE ServerHandle);
857
858 /* Function 5 */
859 NTSTATUS
860 __stdcall
861 SamrLookupDomainInSamServer(
862 [in] SAMPR_HANDLE ServerHandle,
863 [in] PRPC_UNICODE_STRING Name,
864 [out] PRPC_SID *DomainId);
865
866 /* Function 6 */
867 NTSTATUS
868 __stdcall
869 SamrEnumerateDomainsInSamServer(
870 [in] SAMPR_HANDLE ServerHandle,
871 [in,out] unsigned long *EnumerationContext,
872 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
873 [in] unsigned long PreferedMaximumLength,
874 [out] unsigned long *CountReturned);
875
876 /* Function 7 */
877 NTSTATUS
878 __stdcall
879 SamrOpenDomain(
880 [in] SAMPR_HANDLE ServerHandle,
881 [in] ACCESS_MASK DesiredAccess,
882 [in] PRPC_SID DomainId,
883 [out] SAMPR_HANDLE *DomainHandle);
884
885 /* Function 8 */
886 NTSTATUS
887 __stdcall
888 SamrQueryInformationDomain(
889 [in] SAMPR_HANDLE DomainHandle,
890 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
891 [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer);
892
893 /* Function 9 */
894 NTSTATUS
895 __stdcall
896 SamrSetInformationDomain(
897 [in] SAMPR_HANDLE DomainHandle,
898 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
899 [in, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER DomainInformation);
900
901 /* Function 10 */
902 NTSTATUS
903 __stdcall
904 SamrCreateGroupInDomain(
905 [in] SAMPR_HANDLE DomainHandle,
906 [in] PRPC_UNICODE_STRING Name,
907 [in] ACCESS_MASK DesiredAccess,
908 [out] SAMPR_HANDLE *GroupHandle,
909 [out] unsigned long *RelativeId);
910
911 /* Function 11 */
912 NTSTATUS
913 __stdcall
914 SamrEnumerateGroupsInDomain(
915 [in] SAMPR_HANDLE DomainHandle,
916 [in,out] unsigned long *EnumerationContext,
917 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
918 [in] unsigned long PreferedMaximumLength,
919 [out] unsigned long *CountReturned);
920
921 /* Function 12 */
922 NTSTATUS
923 __stdcall
924 SamrCreateUserInDomain([in] SAMPR_HANDLE DomainHandle,
925 [in] PRPC_UNICODE_STRING Name,
926 [in] ACCESS_MASK DesiredAccess,
927 [out] SAMPR_HANDLE *UserHandle,
928 [out] unsigned long *RelativeId);
929
930 /* Function 13 */
931 NTSTATUS
932 __stdcall
933 SamrEnumerateUsersInDomain([in] SAMPR_HANDLE DomainHandle,
934 [in,out] unsigned long *EnumerationContext,
935 [in] unsigned long UserAccountControl,
936 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
937 [in] unsigned long PreferedMaximumLength,
938 [out] unsigned long *CountReturned);
939
940 /* Function 14 */
941 NTSTATUS
942 __stdcall
943 SamrCreateAliasInDomain([in] SAMPR_HANDLE DomainHandle,
944 [in] PRPC_UNICODE_STRING AccountName,
945 [in] ACCESS_MASK DesiredAccess,
946 [out] SAMPR_HANDLE *AliasHandle,
947 [out] unsigned long *RelativeId);
948
949 /* Function 15 */
950 NTSTATUS
951 __stdcall
952 SamrEnumerateAliasesInDomain([in] SAMPR_HANDLE DomainHandle,
953 [in,out] unsigned long *EnumerationContext,
954 [out] PSAMPR_ENUMERATION_BUFFER *Buffer,
955 [in] unsigned long PreferedMaximumLength,
956 [out] unsigned long *CountReturned);
957
958 /* Function 16 */
959 NTSTATUS
960 __stdcall
961 SamrGetAliasMembership([in] SAMPR_HANDLE DomainHandle,
962 [in] PSAMPR_PSID_ARRAY SidArray,
963 [out] PSAMPR_ULONG_ARRAY Membership);
964
965 /* Function 17 */
966 NTSTATUS
967 __stdcall
968 SamrLookupNamesInDomain([in] SAMPR_HANDLE DomainHandle,
969 [in, range(0, 1000)] unsigned long Count,
970 [in, size_is(1000), length_is(Count)] RPC_UNICODE_STRING Names[*],
971 [out] PSAMPR_ULONG_ARRAY RelativeIds,
972 [out] PSAMPR_ULONG_ARRAY Use);
973
974 /* Function 18 */
975 NTSTATUS
976 __stdcall
977 SamrLookupIdsInDomain(
978 [in] SAMPR_HANDLE DomainHandle,
979 [in, range(0, 1000)] unsigned long Count,
980 [in, size_is(1000), length_is(Count)] unsigned long *RelativeIds,
981 [out] PSAMPR_RETURNED_USTRING_ARRAY Names,
982 [out] PSAMPR_ULONG_ARRAY Use);
983
984 /* Function 19 */
985 NTSTATUS
986 __stdcall
987 SamrOpenGroup(
988 [in] SAMPR_HANDLE DomainHandle,
989 [in] ACCESS_MASK DesiredAccess,
990 [in] unsigned long GroupId,
991 [out] SAMPR_HANDLE *GroupHandle);
992
993 /* Function 20 */
994 NTSTATUS
995 __stdcall
996 SamrQueryInformationGroup(
997 [in] SAMPR_HANDLE GroupHandle,
998 [in] GROUP_INFORMATION_CLASS GroupInformationClass,
999 [out, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER *Buffer);
1000
1001 /* Function 21 */
1002 NTSTATUS
1003 __stdcall
1004 SamrSetInformationGroup(
1005 [in] SAMPR_HANDLE GroupHandle,
1006 [in] GROUP_INFORMATION_CLASS GroupInformationClass,
1007 [in, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER Buffer);
1008
1009 /* Function 22 */
1010 NTSTATUS
1011 __stdcall
1012 SamrAddMemberToGroup(
1013 [in] SAMPR_HANDLE GroupHandle,
1014 [in] unsigned long MemberId,
1015 [in] unsigned long Attributes);
1016
1017 /* Function 21 */
1018 NTSTATUS
1019 __stdcall
1020 SamrDeleteGroup(
1021 [in,out] SAMPR_HANDLE *GroupHandle);
1022
1023 /* Function 24 */
1024 NTSTATUS
1025 __stdcall
1026 SamrRemoveMemberFromGroup(
1027 [in] SAMPR_HANDLE GroupHandle,
1028 [in] unsigned long MemberId);
1029
1030 /* Function 25 */
1031 NTSTATUS
1032 __stdcall
1033 SamrGetMembersInGroup(
1034 [in] SAMPR_HANDLE GroupHandle,
1035 [out] PSAMPR_GET_MEMBERS_BUFFER *Members);
1036
1037 /* Function 26 */
1038 NTSTATUS
1039 __stdcall
1040 SamrSetMemberAttributesOfGroup(
1041 [in] SAMPR_HANDLE GroupHandle,
1042 [in] unsigned long MemberId,
1043 [in] unsigned long Attributes);
1044
1045 /* Function 27 */
1046 NTSTATUS
1047 __stdcall
1048 SamrOpenAlias(
1049 [in] SAMPR_HANDLE DomainHandle,
1050 [in] ACCESS_MASK DesiredAccess,
1051 [in] ULONG AliasId,
1052 [out] SAMPR_HANDLE *AliasHandle);
1053
1054 /* Function 28 */
1055 NTSTATUS
1056 __stdcall
1057 SamrQueryInformationAlias(
1058 [in] SAMPR_HANDLE AliasHandle,
1059 [in] ALIAS_INFORMATION_CLASS AliasInformationClass,
1060 [out, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER *Buffer);
1061
1062 /* Function 29 */
1063 NTSTATUS
1064 __stdcall
1065 SamrSetInformationAlias(
1066 [in] SAMPR_HANDLE AliasHandle,
1067 [in] ALIAS_INFORMATION_CLASS AliasInformationClass,
1068 [in, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER Buffer);
1069
1070 /* Function 30 */
1071 NTSTATUS
1072 __stdcall
1073 SamrDeleteAlias(
1074 [in, out] SAMPR_HANDLE *AliasHandle);
1075
1076 /* Function 31 */
1077 NTSTATUS
1078 __stdcall
1079 SamrAddMemberToAlias(
1080 [in] SAMPR_HANDLE AliasHandle,
1081 [in] PRPC_SID MemberId);
1082
1083 /* Function 32 */
1084 NTSTATUS
1085 __stdcall
1086 SamrRemoveMemberFromAlias(
1087 [in] SAMPR_HANDLE AliasHandle,
1088 [in] PRPC_SID MemberId);
1089
1090 /* Function 33 */
1091 NTSTATUS
1092 __stdcall
1093 SamrGetMembersInAlias(
1094 [in] SAMPR_HANDLE AliasHandle,
1095 [out] PSAMPR_PSID_ARRAY_OUT Members);
1096
1097 /* Function 34 */
1098 NTSTATUS
1099 __stdcall
1100 SamrOpenUser(
1101 [in] SAMPR_HANDLE DomainHandle,
1102 [in] ACCESS_MASK DesiredAccess,
1103 [in] ULONG UserId,
1104 [out] SAMPR_HANDLE *UserHandle);
1105
1106 /* Function 35 */
1107 NTSTATUS
1108 __stdcall
1109 SamrDeleteUser(
1110 [in,out] SAMPR_HANDLE *UserHandle);
1111
1112 /* Function 36 */
1113 NTSTATUS
1114 __stdcall
1115 SamrQueryInformationUser(
1116 [in] SAMPR_HANDLE UserHandle,
1117 [in] USER_INFORMATION_CLASS UserInformationClass,
1118 [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer);
1119
1120 /* Function 37 */
1121 NTSTATUS
1122 __stdcall
1123 SamrSetInformationUser(
1124 [in] SAMPR_HANDLE UserHandle,
1125 [in] USER_INFORMATION_CLASS UserInformationClass,
1126 [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer);
1127
1128 /* Function 38 */
1129 NTSTATUS
1130 __stdcall
1131 SamrChangePasswordUser(
1132 [in] SAMPR_HANDLE UserHandle,
1133 [in] unsigned char LmPresent,
1134 [in, unique] PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm,
1135 [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm,
1136 [in] unsigned char NtPresent,
1137 [in, unique] PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt,
1138 [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt,
1139 [in] unsigned char NtCrossEncryptionPresent,
1140 [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm,
1141 [in] unsigned char LmCrossEncryptionPresent,
1142 [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt);
1143
1144 /* Function 39 */
1145 NTSTATUS
1146 __stdcall
1147 SamrGetGroupsForUser(
1148 [in] SAMPR_HANDLE UserHandle,
1149 [out] PSAMPR_GET_GROUPS_BUFFER *Groups);
1150
1151 /* Function 40 */
1152 NTSTATUS
1153 __stdcall
1154 SamrQueryDisplayInformation(
1155 [in] SAMPR_HANDLE DomainHandle,
1156 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1157 [in] unsigned long Index,
1158 [in] unsigned long EntryCount,
1159 [in] unsigned long PreferredMaximumLength,
1160 [out] unsigned long * TotalAvailable,
1161 [out] unsigned long * TotalReturned,
1162 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1163
1164 /* Function 41 */
1165 NTSTATUS
1166 __stdcall
1167 SamrGetDisplayEnumerationIndex(
1168 [in] SAMPR_HANDLE DomainHandle,
1169 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1170 [in] PRPC_UNICODE_STRING Prefix,
1171 [out] unsigned long *Index);
1172
1173 /* Function 42 */
1174 NTSTATUS
1175 __stdcall
1176 SamrTestPrivateFunctionsDomain(
1177 [in] SAMPR_HANDLE DomainHandle);
1178
1179 /* Function 43 */
1180 NTSTATUS
1181 __stdcall
1182 SamrTestPrivateFunctionsUser(
1183 [in] SAMPR_HANDLE UserHandle);
1184
1185 /* Function 44 */
1186 NTSTATUS
1187 __stdcall
1188 SamrGetUserDomainPasswordInformation(
1189 [in] SAMPR_HANDLE UserHandle,
1190 [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation);
1191
1192 /* Function 45 */
1193 NTSTATUS
1194 __stdcall
1195 SamrRemoveMemberFromForeignDomain(
1196 [in] SAMPR_HANDLE DomainHandle,
1197 [in] PRPC_SID MemberSid);
1198
1199 /* Function 46 */
1200 NTSTATUS
1201 __stdcall
1202 SamrQueryInformationDomain2(
1203 [in] SAMPR_HANDLE DomainHandle,
1204 [in] DOMAIN_INFORMATION_CLASS DomainInformationClass,
1205 [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer);
1206
1207 /* Function 47 */
1208 NTSTATUS
1209 __stdcall
1210 SamrQueryInformationUser2(
1211 [in] SAMPR_HANDLE UserHandle,
1212 [in] USER_INFORMATION_CLASS UserInformationClass,
1213 [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer);
1214
1215 /* Function 48 */
1216 NTSTATUS
1217 __stdcall
1218 SamrQueryDisplayInformation2(
1219 [in] SAMPR_HANDLE DomainHandle,
1220 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1221 [in] unsigned long Index,
1222 [in] unsigned long EntryCount,
1223 [in] unsigned long PreferredMaximumLength,
1224 [out] unsigned long *TotalAvailable,
1225 [out] unsigned long *TotalReturned,
1226 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1227
1228 /* Function 49 */
1229 NTSTATUS
1230 __stdcall
1231 SamrGetDisplayEnumerationIndex2(
1232 [in] SAMPR_HANDLE DomainHandle,
1233 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1234 [in] PRPC_UNICODE_STRING Prefix,
1235 [out] unsigned long *Index);
1236
1237 /* Function 50 */
1238 NTSTATUS
1239 __stdcall
1240 SamrCreateUser2InDomain(
1241 [in] SAMPR_HANDLE DomainHandle,
1242 [in] PRPC_UNICODE_STRING Name,
1243 [in] unsigned long AccountType,
1244 [in] ACCESS_MASK DesiredAccess,
1245 [out] SAMPR_HANDLE *UserHandle,
1246 [out] unsigned long *GrantedAccess,
1247 [out] unsigned long *RelativeId);
1248
1249 /* Function 51 */
1250 NTSTATUS
1251 __stdcall
1252 SamrQueryDisplayInformation3(
1253 [in] SAMPR_HANDLE DomainHandle,
1254 [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
1255 [in] unsigned long Index,
1256 [in] unsigned long EntryCount,
1257 [in] unsigned long PreferredMaximumLength,
1258 [out] unsigned long *TotalAvailable,
1259 [out] unsigned long *TotalReturned,
1260 [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer);
1261
1262 /* Function 52 */
1263 NTSTATUS
1264 __stdcall
1265 SamrAddMultipleMembersToAlias(
1266 [in] SAMPR_HANDLE AliasHandle,
1267 [in] PSAMPR_PSID_ARRAY MembersBuffer);
1268
1269 /* Function 53 */
1270 NTSTATUS
1271 __stdcall
1272 SamrRemoveMultipleMembersFromAlias(
1273 [in] SAMPR_HANDLE AliasHandle,
1274 [in] PSAMPR_PSID_ARRAY MembersBuffer);
1275
1276 /* Function 54 */
1277 NTSTATUS
1278 __stdcall
1279 SamrOemChangePasswordUser2(
1280 [in] handle_t BindingHandle,
1281 [in,unique] PRPC_STRING ServerName,
1282 [in] PRPC_STRING UserName,
1283 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm,
1284 [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLm);
1285
1286 /* Function 55 */
1287 NTSTATUS
1288 __stdcall
1289 SamrUnicodeChangePasswordUser2(
1290 [in] handle_t BindingHandle,
1291 [in,unique] PRPC_UNICODE_STRING ServerName,
1292 [in] PRPC_UNICODE_STRING UserName,
1293 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt,
1294 [in,unique] PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt,
1295 [in] unsigned char LmPresent,
1296 [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm,
1297 [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewNt);
1298
1299 /* Function 56 */
1300 NTSTATUS
1301 __stdcall
1302 SamrGetDomainPasswordInformation(
1303 [in] handle_t BindingHandle,
1304 [in,unique] PRPC_UNICODE_STRING Unused,
1305 [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation);
1306
1307 /* Function 57 */
1308 NTSTATUS
1309 __stdcall
1310 SamrConnect2(
1311 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1312 [out] SAMPR_HANDLE *ServerHandle,
1313 [in] ACCESS_MASK DesiredAccess);
1314
1315 /* Function 58 */
1316 NTSTATUS
1317 __stdcall
1318 SamrSetInformationUser2(
1319 [in] SAMPR_HANDLE UserHandle,
1320 [in] USER_INFORMATION_CLASS UserInformationClass,
1321 [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer);
1322
1323 /* Function 59 */
1324 NTSTATUS
1325 __stdcall
1326 SamrSetBootKeyInformation(
1327 [in] handle_t BindingHandle); /* FIXME */
1328
1329 /* Function 60 */
1330 NTSTATUS
1331 __stdcall
1332 SamrGetBootKeyInformation(
1333 [in] handle_t BindingHandle); /* FIXME */
1334
1335 /* Function 61 */
1336 NTSTATUS
1337 __stdcall
1338 SamrConnect3(
1339 [in] handle_t BindingHandle); /* FIXME */
1340
1341 /* Function 62 */
1342 NTSTATUS
1343 __stdcall
1344 SamrConnect4(
1345 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1346 [out] SAMPR_HANDLE *ServerHandle,
1347 [in] unsigned long ClientRevision,
1348 [in] ACCESS_MASK DesiredAccess);
1349
1350 /* Function 63 */
1351 NTSTATUS
1352 __stdcall
1353 SamrUnicodeChangePasswordUser3(
1354 [in] handle_t BindingHandle); /* FIXME */
1355
1356 /* Function 64 */
1357 NTSTATUS
1358 __stdcall
1359 SamrConnect5(
1360 [in,unique,string] PSAMPR_SERVER_NAME ServerName,
1361 [in] ACCESS_MASK DesiredAccess,
1362 [in] unsigned long InVersion,
1363 [in,switch_is(InVersion)] SAMPR_REVISION_INFO *InRevisionInfo,
1364 [out] unsigned long *OutVersion,
1365 [out,switch_is(*OutVersion)] SAMPR_REVISION_INFO *OutRevisionInfo,
1366 [out] SAMPR_HANDLE *ServerHandle);
1367
1368 /* Function 65 */
1369 NTSTATUS
1370 __stdcall
1371 SamrRidToSid(
1372 [in] SAMPR_HANDLE ObjectHandle,
1373 [in] unsigned long Rid,
1374 [out] PRPC_SID *Sid);
1375
1376 /* Function 66 */
1377 NTSTATUS
1378 __stdcall
1379 SamrSetDSRMPassword(
1380 [in] handle_t BindingHandle,
1381 [in,unique] PRPC_UNICODE_STRING Unused,
1382 [in] unsigned long UserId,
1383 [in,unique] PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword);
1384
1385 /* Function 67 */
1386 NTSTATUS
1387 __stdcall
1388 SamrValidatePassword(
1389 [in] handle_t Handle,
1390 [in] PASSWORD_POLICY_VALIDATION_TYPE ValidationType,
1391 [in,switch_is(ValidationType)] PSAM_VALIDATE_INPUT_ARG InputArg,
1392 [out,switch_is(ValidationType)] PSAM_VALIDATE_OUTPUT_ARG *OutputArg);
1393 }