[NETAPI32]
[reactos.git] / reactos / include / ddk / ntsam.h
1
2 #ifndef _NTSAM_
3 #define _NTSAM_
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 #define ALIAS_ADD_MEMBER 0x00000001
10 #define ALIAS_REMOVE_MEMBER 0x00000002
11 #define ALIAS_LIST_MEMBERS 0x00000004
12 #define ALIAS_READ_INFORMATION 0x00000008
13 #define ALIAS_WRITE_ACCOUNT 0x00000010
14
15 #define ALIAS_READ (STANDARD_RIGHTS_READ |\
16 ALIAS_LIST_MEMBERS)
17
18 #define ALIAS_WRITE (STANDARD_RIGHTS_WRITE |\
19 ALIAS_ADD_MEMBER |\
20 ALIAS_REMOVE_MEMBER |\
21 ALIAS_WRITE_ACCOUNT)
22
23 #define ALIAS_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
24 ALIAS_READ_INFORMATION)
25
26 #define ALIAS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
27 ALIAS_ADD_MEMBER |\
28 ALIAS_REMOVE_MEMBER |\
29 ALIAS_LIST_MEMBERS |\
30 ALIAS_READ_INFORMATION |\
31 ALIAS_WRITE_ACCOUNT)
32
33 #define DOMAIN_READ_PASSWORD_PARAMETERS 0x00000001
34 #define DOMAIN_WRITE_PASSWORD_PARAMS 0x00000002
35 #define DOMAIN_READ_OTHER_PARAMETERS 0x00000004
36 #define DOMAIN_WRITE_OTHER_PARAMETERS 0x00000008
37 #define DOMAIN_CREATE_USER 0x00000010
38 #define DOMAIN_CREATE_GROUP 0x00000020
39 #define DOMAIN_CREATE_ALIAS 0x00000040
40 #define DOMAIN_GET_ALIAS_MEMBERSHIP 0x00000080
41 #define DOMAIN_LIST_ACCOUNTS 0x00000100
42 #define DOMAIN_LOOKUP 0x00000200
43 #define DOMAIN_ADMINISTER_SERVER 0x00000400
44
45 #define DOMAIN_READ (STANDARD_RIGHTS_READ |\
46 DOMAIN_READ_OTHER_PARAMETERS |\
47 DOMAIN_GET_ALIAS_MEMBERSHIP)
48
49 #define DOMAIN_WRITE (STANDARD_RIGHTS_WRITE |\
50 DOMAIN_WRITE_PASSWORD_PARAMS |\
51 DOMAIN_WRITE_OTHER_PARAMETERS |\
52 DOMAIN_CREATE_USER |\
53 DOMAIN_CREATE_GROUP |\
54 DOMAIN_CREATE_ALIAS |\
55 DOMAIN_ADMINISTER_SERVER)
56
57 #define DOMAIN_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
58 DOMAIN_READ_PASSWORD_PARAMETERS |\
59 DOMAIN_LIST_ACCOUNTS |\
60 DOMAIN_LOOKUP)
61
62 #define DOMAIN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
63 DOMAIN_READ_PASSWORD_PARAMETERS |\
64 DOMAIN_WRITE_PASSWORD_PARAMS |\
65 DOMAIN_READ_OTHER_PARAMETERS |\
66 DOMAIN_WRITE_OTHER_PARAMETERS |\
67 DOMAIN_CREATE_USER |\
68 DOMAIN_CREATE_GROUP |\
69 DOMAIN_CREATE_ALIAS |\
70 DOMAIN_GET_ALIAS_MEMBERSHIP |\
71 DOMAIN_LIST_ACCOUNTS |\
72 DOMAIN_LOOKUP |\
73 DOMAIN_ADMINISTER_SERVER)
74
75 #define GROUP_READ_INFORMATION 0x00000001
76 #define GROUP_WRITE_ACCOUNT 0x00000002
77 #define GROUP_ADD_MEMBER 0x00000004
78 #define GROUP_REMOVE_MEMBER 0x00000008
79 #define GROUP_LIST_MEMBERS 0x00000010
80
81 #define GROUP_READ (STANDARD_RIGHTS_READ |\
82 GROUP_LIST_MEMBERS)
83
84 #define GROUP_WRITE (STANDARD_RIGHTS_WRITE |\
85 GROUP_WRITE_ACCOUNT |\
86 GROUP_ADD_MEMBER |\
87 GROUP_REMOVE_MEMBER)
88
89 #define GROUP_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
90 GROUP_READ_INFORMATION)
91
92 #define GROUP_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
93 GROUP_READ_INFORMATION |\
94 GROUP_WRITE_ACCOUNT |\
95 GROUP_ADD_MEMBER |\
96 GROUP_REMOVE_MEMBER |\
97 GROUP_LIST_MEMBERS)
98
99 #define SAM_SERVER_CONNECT 0x00000001
100 #define SAM_SERVER_SHUTDOWN 0x00000002
101 #define SAM_SERVER_INITIALIZE 0x00000004
102 #define SAM_SERVER_CREATE_DOMAIN 0x00000008
103 #define SAM_SERVER_ENUMERATE_DOMAINS 0x00000010
104 #define SAM_SERVER_LOOKUP_DOMAIN 0x00000020
105
106 #define SAM_SERVER_READ (STANDARD_RIGHTS_READ |\
107 SAM_SERVER_ENUMERATE_DOMAINS)
108
109 #define SAM_SERVER_WRITE (STANDARD_RIGHTS_WRITE |\
110 SAM_SERVER_SHUTDOWN |\
111 SAM_SERVER_INITIALIZE |\
112 SAM_SERVER_CREATE_DOMAIN)
113
114 #define SAM_SERVER_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
115 SAM_SERVER_CONNECT |\
116 SAM_SERVER_LOOKUP_DOMAIN)
117
118 #define SAM_SERVER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
119 SAM_SERVER_CONNECT |\
120 SAM_SERVER_SHUTDOWN |\
121 SAM_SERVER_INITIALIZE |\
122 SAM_SERVER_CREATE_DOMAIN |\
123 SAM_SERVER_ENUMERATE_DOMAINS |\
124 SAM_SERVER_LOOKUP_DOMAIN)
125
126 #define USER_READ_GENERAL 0x00000001
127 #define USER_READ_PREFERENCES 0x00000002
128 #define USER_WRITE_PREFERENCES 0x00000004
129 #define USER_READ_LOGON 0x00000008
130 #define USER_READ_ACCOUNT 0x00000010
131 #define USER_WRITE_ACCOUNT 0x00000020
132 #define USER_CHANGE_PASSWORD 0x00000040
133 #define USER_FORCE_PASSWORD_CHANGE 0x00000080
134 #define USER_LIST_GROUPS 0x00000100
135 #define USER_READ_GROUP_INFORMATION 0x00000200
136 #define USER_WRITE_GROUP_INFORMATION 0x00000400
137
138 #define USER_READ (STANDARD_RIGHTS_READ |\
139 USER_READ_PREFERENCES |\
140 USER_READ_LOGON |\
141 USER_READ_ACCOUNT |\
142 USER_LIST_GROUPS |\
143 USER_READ_GROUP_INFORMATION)
144
145 #define USER_WRITE (STANDARD_RIGHTS_WRITE |\
146 USER_WRITE_PREFERENCES |\
147 USER_CHANGE_PASSWORD)
148
149 #define USER_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
150 USER_READ_GENERAL |\
151 USER_CHANGE_PASSWORD)
152
153 #define USER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
154 USER_READ_GENERAL |\
155 USER_READ_PREFERENCES |\
156 USER_WRITE_PREFERENCES |\
157 USER_READ_LOGON |\
158 USER_READ_ACCOUNT |\
159 USER_WRITE_ACCOUNT |\
160 USER_CHANGE_PASSWORD |\
161 USER_FORCE_PASSWORD_CHANGE |\
162 USER_LIST_GROUPS |\
163 USER_READ_GROUP_INFORMATION |\
164 USER_WRITE_GROUP_INFORMATION)
165
166 /* User account control bits */
167 #define USER_ACCOUNT_DISABLED 0x00000001
168 #define USER_HOME_DIRECTORY_REQUIRED 0x00000002
169 #define USER_PASSWORD_NOT_REQUIRED 0x00000004
170 #define USER_TEMP_DUPLICATE_ACCOUNT 0x00000008
171 #define USER_NORMAL_ACCOUNT 0x00000010
172 #define USER_MNS_LOGON_ACCOUNT 0x00000020
173 #define USER_INTERDOMAIN_TRUST_ACCOUNT 0x00000040
174 #define USER_WORKSTATION_TRUST_ACCOUNT 0x00000080
175 #define USER_SERVER_TRUST_ACCOUNT 0x00000100
176 #define USER_DONT_EXPIRE_PASSWORD 0x00000200
177 #define USER_ACCOUNT_AUTO_LOCKED 0x00000400
178 #define USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x00000800
179 #define USER_SMARTCARD_REQUIRED 0x00001000
180 #define USER_TRUSTED_FOR_DELEGATION 0x00002000
181 #define USER_NOT_DELEGATED 0x00004000
182 #define USER_USE_DES_KEY_ONLY 0x00008000
183 #define USER_DONT_REQUIRE_PREAUTH 0x00010000
184 #define USER_PASSWORD_EXPIRED 0x00020000
185 #define USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x00040000
186 #define USER_NO_AUTH_DATA_REQUIRED 0x00080000
187 #define USER_PARTIAL_SECRETS_ACCOUNT 0x00100000
188 #define USER_USE_AES_KEYS 0x00200000
189
190 /* Constants uses by LOGON_HOURS.UnitsPerWeek */
191 #define SAM_DAYS_PER_WEEK (7)
192 #define SAM_HOURS_PER_WEEK (24 * SAM_DAYS_PER_WEEK)
193 #define SAM_MINUTES_PER_WEEK (60 * SAM_HOURS_PER_WEEK)
194
195
196 typedef PVOID SAM_HANDLE, *PSAM_HANDLE;
197 typedef ULONG SAM_ENUMERATE_HANDLE, *PSAM_ENUMERATE_HANDLE;
198
199 typedef struct _SAM_RID_ENUMERATION
200 {
201 ULONG RelativeId;
202 UNICODE_STRING Name;
203 } SAM_RID_ENUMERATION, *PSAM_RID_ENUMERATION;
204
205 typedef struct _SAM_SID_ENUMERATION
206 {
207 PSID Sid;
208 UNICODE_STRING Name;
209 } SAM_SID_ENUMERATION, *PSAM_SID_ENUMERATION;
210
211 typedef enum _ALIAS_INFORMATION_CLASS
212 {
213 AliasGeneralInformation = 1,
214 AliasNameInformation,
215 AliasAdminCommentInformation
216 } ALIAS_INFORMATION_CLASS, *PALIAS_INFORMATION_CLASS;
217
218 typedef struct _ALIAS_GENERAL_INFORMATION
219 {
220 UNICODE_STRING Name;
221 ULONG MemberCount;
222 UNICODE_STRING AdminComment;
223 } ALIAS_GENERAL_INFORMATION, *PALIAS_GENERAL_INFORMATION;
224
225 typedef struct _ALIAS_NAME_INFORMATION
226 {
227 UNICODE_STRING Name;
228 } ALIAS_NAME_INFORMATION, *PALIAS_NAME_INFORMATION;
229
230 typedef struct _ALIAS_ADM_COMMENT_INFORMATION
231 {
232 UNICODE_STRING AdminComment;
233 } ALIAS_ADM_COMMENT_INFORMATION, *PALIAS_ADM_COMMENT_INFORMATION;
234
235
236 typedef enum _DOMAIN_INFORMATION_CLASS
237 {
238 DomainPasswordInformation = 1,
239 DomainGeneralInformation,
240 DomainLogoffInformation,
241 DomainOemInformation,
242 DomainNameInformation,
243 DomainReplicationInformation,
244 DomainServerRoleInformation,
245 DomainModifiedInformation,
246 DomainStateInformation,
247 DomainUasInformation,
248 DomainGeneralInformation2,
249 DomainLockoutInformation,
250 DomainModifiedInformation2
251 } DOMAIN_INFORMATION_CLASS;
252
253 typedef enum _DOMAIN_SERVER_ENABLE_STATE
254 {
255 DomainServerEnabled = 1,
256 DomainServerDisabled
257 } DOMAIN_SERVER_ENABLE_STATE, *PDOMAIN_SERVER_ENABLE_STATE;
258
259 typedef enum _DOMAIN_SERVER_ROLE
260 {
261 DomainServerRoleBackup = 2,
262 DomainServerRolePrimary
263 } DOMAIN_SERVER_ROLE, *PDOMAIN_SERVER_ROLE;
264
265 typedef struct _DOMAIN_NAME_INFORMATION
266 {
267 UNICODE_STRING DomainName;
268 } DOMAIN_NAME_INFORMATION, *PDOMAIN_NAME_INFORMATION;
269
270 typedef enum _GROUP_INFORMATION_CLASS
271 {
272 GroupGeneralInformation = 1,
273 GroupNameInformation,
274 GroupAttributeInformation,
275 GroupAdminCommentInformation,
276 GroupReplicationInformation
277 } GROUP_INFORMATION_CLASS;
278
279 typedef struct _GROUP_MEMBERSHIP
280 {
281 ULONG RelativeId;
282 ULONG Attributes;
283 } GROUP_MEMBERSHIP, *PGROUP_MEMBERSHIP;
284
285 typedef struct _LOGON_HOURS
286 {
287 USHORT UnitsPerWeek;
288 PUCHAR LogonHours;
289 } LOGON_HOURS, *PLOGON_HOURS;
290
291 typedef enum _USER_INFORMATION_CLASS
292 {
293 UserGeneralInformation = 1,
294 UserPreferencesInformation,
295 UserLogonInformation,
296 UserLogonHoursInformation,
297 UserAccountInformation,
298 UserNameInformation,
299 UserAccountNameInformation,
300 UserFullNameInformation,
301 UserPrimaryGroupInformation,
302 UserHomeInformation,
303 UserScriptInformation,
304 UserProfileInformation,
305 UserAdminCommentInformation,
306 UserWorkStationsInformation,
307 UserSetPasswordInformation,
308 UserControlInformation,
309 UserExpiresInformation,
310 UserInternal1Information,
311 UserInternal2Information,
312 UserParametersInformation,
313 UserAllInformation,
314 UserInternal3Information,
315 UserInternal4Information,
316 UserInternal5Information,
317 UserInternal4InformationNew,
318 UserInternal5InformationNew,
319 UserInternal6Information,
320 UserExtendedInformation,
321 UserLogonUIInformation,
322 } USER_INFORMATION_CLASS, *PUSER_INFORMATION_CLASS;
323
324 typedef struct _USER_GENERAL_INFORMATION
325 {
326 UNICODE_STRING UserName;
327 UNICODE_STRING FullName;
328 ULONG PrimaryGroupId;
329 UNICODE_STRING AdminComment;
330 UNICODE_STRING UserComment;
331 } USER_GENERAL_INFORMATION, *PUSER_GENERAL_INFORMATION;
332
333 typedef struct _USER_PREFERENCES_INFORMATION
334 {
335 UNICODE_STRING UserComment;
336 UNICODE_STRING Reserved1;
337 USHORT CountryCode;
338 USHORT CodePage;
339 } USER_PREFERENCES_INFORMATION, *PUSER_PREFERENCES_INFORMATION;
340
341 #include "pshpack4.h"
342 typedef struct _USER_LOGON_INFORMATION
343 {
344 UNICODE_STRING UserName;
345 UNICODE_STRING FullName;
346 ULONG UserId;
347 ULONG PrimaryGroupId;
348 UNICODE_STRING HomeDirectory;
349 UNICODE_STRING HomeDirectoryDrive;
350 UNICODE_STRING ScriptPath;
351 UNICODE_STRING ProfilePath;
352 UNICODE_STRING WorkStations;
353 LARGE_INTEGER LastLogon;
354 LARGE_INTEGER LastLogoff;
355 LARGE_INTEGER PasswordLastSet;
356 LARGE_INTEGER PasswordCanChange;
357 LARGE_INTEGER PasswordMustChange;
358 LOGON_HOURS LogonHours;
359 USHORT BadPasswordCount;
360 USHORT LogonCount;
361 ULONG UserAccountControl;
362 } USER_LOGON_INFORMATION, *PUSER_LOGON_INFORMATION;
363 #include "poppack.h"
364
365 typedef struct _USER_LOGON_HOURS_INFORMATION
366 {
367 LOGON_HOURS LogonHours;
368 } USER_LOGON_HOURS_INFORMATION, *PUSER_LOGON_HOURS_INFORMATION;
369
370 #include "pshpack4.h"
371 typedef struct _USER_ACCOUNT_INFORMATION
372 {
373 UNICODE_STRING UserName;
374 UNICODE_STRING FullName;
375 ULONG UserId;
376 ULONG PrimaryGroupId;
377 UNICODE_STRING HomeDirectory;
378 UNICODE_STRING HomeDirectoryDrive;
379 UNICODE_STRING ScriptPath;
380 UNICODE_STRING ProfilePath;
381 UNICODE_STRING AdminComment;
382 UNICODE_STRING WorkStations;
383 LARGE_INTEGER LastLogon;
384 LARGE_INTEGER LastLogoff;
385 LOGON_HOURS LogonHours;
386 USHORT BadPasswordCount;
387 USHORT LogonCount;
388 LARGE_INTEGER PasswordLastSet;
389 LARGE_INTEGER AccountExpires;
390 ULONG UserAccountControl;
391 } USER_ACCOUNT_INFORMATION, *PUSER_ACCOUNT_INFORMATION;
392 #include "poppack.h"
393
394 typedef struct _USER_NAME_INFORMATION
395 {
396 UNICODE_STRING UserName;
397 UNICODE_STRING FullName;
398 } USER_NAME_INFORMATION, *PUSER_NAME_INFORMATION;
399
400 typedef struct _USER_ACCOUNT_NAME_INFORMATION
401 {
402 UNICODE_STRING UserName;
403 } USER_ACCOUNT_NAME_INFORMATION, *PUSER_ACCOUNT_NAME_INFORMATION;
404
405 typedef struct _USER_FULL_NAME_INFORMATION
406 {
407 UNICODE_STRING FullName;
408 } USER_FULL_NAME_INFORMATION, *PUSER_FULL_NAME_INFORMATION;
409
410 typedef struct _USER_PRIMARY_GROUP_INFORMATION
411 {
412 ULONG PrimaryGroupId;
413 } USER_PRIMARY_GROUP_INFORMATION, *PUSER_PRIMARY_GROUP_INFORMATION;
414
415 typedef struct _USER_HOME_INFORMATION
416 {
417 UNICODE_STRING HomeDirectory;
418 UNICODE_STRING HomeDirectoryDrive;
419 } USER_HOME_INFORMATION, *PUSER_HOME_INFORMATION;
420
421 typedef struct _USER_SCRIPT_INFORMATION
422 {
423 UNICODE_STRING ScriptPath;
424 } USER_SCRIPT_INFORMATION, *PUSER_SCRIPT_INFORMATION;
425
426 typedef struct _USER_PROFILE_INFORMATION
427 {
428 UNICODE_STRING ProfilePath;
429 } USER_PROFILE_INFORMATION, *PUSER_PROFILE_INFORMATION;
430
431 typedef struct _USER_ADMIN_COMMENT_INFORMATION
432 {
433 UNICODE_STRING AdminComment;
434 } USER_ADMIN_COMMENT_INFORMATION, *PUSER_ADMIN_COMMENT_INFORMATION;
435
436 typedef struct _USER_WORKSTATIONS_INFORMATION
437 {
438 UNICODE_STRING WorkStations;
439 } USER_WORKSTATIONS_INFORMATION, *PUSER_WORKSTATIONS_INFORMATION;
440
441 typedef struct _USER_SET_PASSWORD_INFORMATION
442 {
443 UNICODE_STRING Password;
444 BOOLEAN PasswordExpired;
445 } USER_SET_PASSWORD_INFORMATION, *PUSER_SET_PASSWORD_INFORMATION;
446
447 typedef struct _USER_CONTROL_INFORMATION
448 {
449 ULONG UserAccountControl;
450 } USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION;
451
452
453 #define SAM_SID_COMPATIBILITY_ALL 0
454 #define SAM_SID_COMPATIBILITY_LAX 1
455 #define SAM_SID_COMPATIBILITY_STRICT 2
456
457
458 NTSTATUS
459 NTAPI
460 SamAddMemberToAlias(IN SAM_HANDLE AliasHandle,
461 IN PSID MemberId);
462
463 NTSTATUS
464 NTAPI
465 SamAddMemberToGroup(IN SAM_HANDLE GroupHandle,
466 IN ULONG MemberId,
467 IN ULONG Attributes);
468
469 NTSTATUS
470 NTAPI
471 SamAddMultipleMembersToAlias(IN SAM_HANDLE AliasHandle,
472 IN PSID *MemberIds,
473 IN ULONG MemberCount);
474
475 NTSTATUS
476 NTAPI
477 SamCloseHandle(IN SAM_HANDLE SamHandle);
478
479 NTSTATUS
480 NTAPI
481 SamConnect(IN OUT PUNICODE_STRING ServerName,
482 OUT PSAM_HANDLE ServerHandle,
483 IN ACCESS_MASK DesiredAccess,
484 IN POBJECT_ATTRIBUTES ObjectAttributes);
485
486 NTSTATUS
487 NTAPI
488 SamCreateAliasInDomain(IN SAM_HANDLE DomainHandle,
489 IN PUNICODE_STRING AccountName,
490 IN ACCESS_MASK DesiredAccess,
491 OUT PSAM_HANDLE AliasHandle,
492 OUT PULONG RelativeId);
493
494 NTSTATUS
495 NTAPI
496 SamCreateGroupInDomain(IN SAM_HANDLE DomainHandle,
497 IN PUNICODE_STRING AccountName,
498 IN ACCESS_MASK DesiredAccess,
499 OUT PSAM_HANDLE GroupHandle,
500 OUT PULONG RelativeId);
501
502 NTSTATUS
503 NTAPI
504 SamCreateUser2InDomain(IN SAM_HANDLE DomainHandle,
505 IN PUNICODE_STRING AccountName,
506 IN ULONG AccountType,
507 IN ACCESS_MASK DesiredAccess,
508 OUT PSAM_HANDLE UserHandle,
509 OUT PULONG GrantedAccess,
510 OUT PULONG RelativeId);
511
512 NTSTATUS
513 NTAPI
514 SamCreateUserInDomain(IN SAM_HANDLE DomainHandle,
515 IN PUNICODE_STRING AccountName,
516 IN ACCESS_MASK DesiredAccess,
517 OUT PSAM_HANDLE UserHandle,
518 OUT PULONG RelativeId);
519
520 NTSTATUS
521 NTAPI
522 SamDeleteAlias(IN SAM_HANDLE AliasHandle);
523
524 NTSTATUS
525 NTAPI
526 SamDeleteGroup(IN SAM_HANDLE GroupHandle);
527
528 NTSTATUS
529 NTAPI
530 SamDeleteUser(IN SAM_HANDLE UserHandle);
531
532 NTSTATUS
533 NTAPI
534 SamEnumerateAliasesInDomain(IN SAM_HANDLE DomainHandle,
535 IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
536 OUT PVOID *Buffer,
537 IN ULONG PreferedMaximumLength,
538 OUT PULONG CountReturned);
539
540 NTSTATUS
541 NTAPI
542 SamEnumerateDomainsInSamServer(IN SAM_HANDLE ServerHandle,
543 IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
544 OUT PVOID *Buffer,
545 IN ULONG PreferedMaximumLength,
546 OUT PULONG CountReturned);
547
548 NTSTATUS
549 NTAPI
550 SamEnumerateGroupsInDomain(IN SAM_HANDLE DomainHandle,
551 IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
552 IN PVOID *Buffer,
553 IN ULONG PreferedMaximumLength,
554 OUT PULONG CountReturned);
555
556 NTSTATUS
557 NTAPI
558 SamEnumerateUsersInDomain(IN SAM_HANDLE DomainHandle,
559 IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
560 IN ULONG UserAccountControl,
561 OUT PVOID *Buffer,
562 IN ULONG PreferedMaximumLength,
563 OUT PULONG CountReturned);
564
565 NTSTATUS
566 NTAPI
567 SamFreeMemory(IN PVOID Buffer);
568
569 NTSTATUS
570 NTAPI
571 SamGetAliasMembership(IN SAM_HANDLE DomainHandle,
572 IN ULONG PassedCount,
573 IN PSID *Sids,
574 OUT PULONG MembershipCount,
575 OUT PULONG *Aliases);
576
577 NTSTATUS
578 NTAPI
579 SamGetCompatibilityMode(IN SAM_HANDLE ObjectHandle,
580 OUT PULONG Mode);
581
582 NTSTATUS
583 NTAPI
584 SamGetGroupsForUser(IN SAM_HANDLE UserHandle,
585 OUT PGROUP_MEMBERSHIP *Groups,
586 OUT PULONG MembershipCount);
587
588 NTSTATUS
589 NTAPI
590 SamGetMembersInAlias(IN SAM_HANDLE AliasHandle,
591 OUT PSID **MemberIds,
592 OUT PULONG MemberCount);
593
594 NTSTATUS
595 NTAPI
596 SamGetMembersInGroup(IN SAM_HANDLE GroupHandle,
597 OUT PULONG *MemberIds,
598 OUT PULONG *Attributes,
599 OUT PULONG MemberCount);
600
601 NTSTATUS
602 NTAPI
603 SamLookupDomainInSamServer(IN SAM_HANDLE ServerHandle,
604 IN PUNICODE_STRING Name,
605 OUT PSID *DomainId);
606
607 NTSTATUS
608 NTAPI
609 SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
610 IN ULONG Count,
611 IN PULONG RelativeIds,
612 OUT PUNICODE_STRING *Names,
613 OUT PSID_NAME_USE *Use);
614
615 NTSTATUS
616 NTAPI
617 SamLookupNamesInDomain(IN SAM_HANDLE DomainHandle,
618 IN ULONG Count,
619 IN PUNICODE_STRING Names,
620 OUT PULONG *RelativeIds,
621 OUT PSID_NAME_USE *Use);
622
623 NTSTATUS
624 NTAPI
625 SamOpenAlias(IN SAM_HANDLE DomainHandle,
626 IN ACCESS_MASK DesiredAccess,
627 IN ULONG AliasId,
628 OUT PSAM_HANDLE AliasHandle);
629
630 NTSTATUS
631 NTAPI
632 SamOpenDomain(IN SAM_HANDLE ServerHandle,
633 IN ACCESS_MASK DesiredAccess,
634 IN PSID DomainId,
635 OUT PSAM_HANDLE DomainHandle);
636
637 NTSTATUS
638 NTAPI
639 SamOpenGroup(IN SAM_HANDLE DomainHandle,
640 IN ACCESS_MASK DesiredAccess,
641 IN ULONG GroupId,
642 OUT PSAM_HANDLE GroupHandle);
643
644 NTSTATUS
645 NTAPI
646 SamOpenUser(IN SAM_HANDLE DomainHandle,
647 IN ACCESS_MASK DesiredAccess,
648 IN ULONG UserId,
649 OUT PSAM_HANDLE UserHandle);
650
651 NTSTATUS
652 NTAPI
653 SamQueryInformationAlias(IN SAM_HANDLE AliasHandle,
654 IN ALIAS_INFORMATION_CLASS AliasInformationClass,
655 OUT PVOID *Buffer);
656
657 NTSTATUS
658 NTAPI
659 SamQueryInformationDomain(IN SAM_HANDLE DomainHandle,
660 IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
661 OUT PVOID *Buffer);
662
663 NTSTATUS
664 NTAPI
665 SamQueryInformationGroup(IN SAM_HANDLE GroupHandle,
666 IN GROUP_INFORMATION_CLASS GroupInformationClass,
667 OUT PVOID *Buffer);
668
669 NTSTATUS
670 NTAPI
671 SamQueryInformationUser(IN SAM_HANDLE UserHandle,
672 IN USER_INFORMATION_CLASS UserInformationClass,
673 OUT PVOID *Buffer);
674
675 NTSTATUS
676 NTAPI
677 SamQuerySecurityObject(IN SAM_HANDLE ObjectHandle,
678 IN SECURITY_INFORMATION SecurityInformation,
679 OUT PSECURITY_DESCRIPTOR *SecurityDescriptor);
680
681 NTSTATUS
682 NTAPI
683 SamRemoveMemberFromAlias(IN SAM_HANDLE AliasHandle,
684 IN PSID MemberId);
685
686 NTSTATUS
687 NTAPI
688 SamRemoveMemberFromForeignDomain(IN SAM_HANDLE DomainHandle,
689 IN PSID MemberId);
690
691 NTSTATUS
692 NTAPI
693 SamRemoveMemberFromGroup(IN SAM_HANDLE GroupHandle,
694 IN ULONG MemberId);
695
696 NTSTATUS
697 NTAPI
698 SamRemoveMultipleMembersFromAlias(IN SAM_HANDLE AliasHandle,
699 IN PSID *MemberIds,
700 IN ULONG MemberCount);
701
702 NTSTATUS
703 NTAPI
704 SamRidToSid(IN SAM_HANDLE ObjectHandle,
705 IN ULONG Rid,
706 OUT PSID *Sid);
707
708 NTSTATUS
709 NTAPI
710 SamSetInformationAlias(IN SAM_HANDLE AliasHandle,
711 IN ALIAS_INFORMATION_CLASS AliasInformationClass,
712 IN PVOID Buffer);
713
714 NTSTATUS
715 NTAPI
716 SamSetInformationDomain(IN SAM_HANDLE DomainHandle,
717 IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
718 IN PVOID Buffer);
719
720 NTSTATUS
721 NTAPI
722 SamSetInformationGroup(IN SAM_HANDLE GroupHandle,
723 IN GROUP_INFORMATION_CLASS GroupInformationClass,
724 IN PVOID Buffer);
725
726 NTSTATUS
727 NTAPI
728 SamSetInformationUser(IN SAM_HANDLE UserHandle,
729 IN USER_INFORMATION_CLASS UserInformationClass,
730 IN PVOID Buffer);
731
732 NTSTATUS
733 NTAPI
734 SamSetMemberAttributesOfGroup(IN SAM_HANDLE GroupHandle,
735 IN ULONG MemberId,
736 IN ULONG Attributes);
737
738 NTSTATUS
739 NTAPI
740 SamSetSecurityObject(IN SAM_HANDLE ObjectHandle,
741 IN SECURITY_INFORMATION SecurityInformation,
742 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
743
744 NTSTATUS
745 NTAPI
746 SamShutdownSamServer(IN SAM_HANDLE ServerHandle);
747
748 #ifdef __cplusplus
749 }
750 #endif
751
752 #endif /* _NTSAM_ */