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