ReactOS 0.4.17-dev-1321-g5c122a9
ntsam.h File Reference
#include "pshpack4.h"
#include "poppack.h"
Include dependency graph for ntsam.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SAM_RID_ENUMERATION
 
struct  _SAM_SID_ENUMERATION
 
struct  _ALIAS_GENERAL_INFORMATION
 
struct  _ALIAS_NAME_INFORMATION
 
struct  _ALIAS_ADM_COMMENT_INFORMATION
 
struct  _DOMAIN_DISPLAY_USER
 
struct  _DOMAIN_DISPLAY_MACHINE
 
struct  _DOMAIN_DISPLAY_GROUP
 
struct  _DOMAIN_PASSWORD_INFORMATION
 
struct  _DOMAIN_GENERAL_INFORMATION
 
struct  _DOMAIN_LOGOFF_INFORMATION
 
struct  _DOMAIN_OEM_INFORMATION
 
struct  _DOMAIN_NAME_INFORMATION
 
struct  _DOMAIN_REPLICATION_INFORMATION
 
struct  _DOMAIN_SERVER_ROLE_INFORMATION
 
struct  _DOMAIN_MODIFIED_INFORMATION
 
struct  _DOMAIN_STATE_INFORMATION
 
struct  _DOMAIN_UAS_INFORMATION
 
struct  _DOMAIN_GENERAL_INFORMATION2
 
struct  _DOMAIN_LOCKOUT_INFORMATION
 
struct  _DOMAIN_MODIFIED_INFORMATION2
 
struct  _GROUP_GENERAL_INFORMATION
 
struct  _GROUP_NAME_INFORMATION
 
struct  _GROUP_ATTRIBUTE_INFORMATION
 
struct  GROUP_ADM_COMMENT_INFORMATION
 
struct  _GROUP_MEMBERSHIP
 
struct  _LOGON_HOURS
 
struct  _SR_SECURITY_DESCRIPTOR
 
struct  _USER_GENERAL_INFORMATION
 
struct  _USER_PREFERENCES_INFORMATION
 
struct  _USER_LOGON_INFORMATION
 
struct  _USER_LOGON_HOURS_INFORMATION
 
struct  _USER_ACCOUNT_INFORMATION
 
struct  _USER_NAME_INFORMATION
 
struct  _USER_ACCOUNT_NAME_INFORMATION
 
struct  _USER_FULL_NAME_INFORMATION
 
struct  _USER_PRIMARY_GROUP_INFORMATION
 
struct  _USER_HOME_INFORMATION
 
struct  _USER_SCRIPT_INFORMATION
 
struct  _USER_PROFILE_INFORMATION
 
struct  _USER_ADMIN_COMMENT_INFORMATION
 
struct  _USER_WORKSTATIONS_INFORMATION
 
struct  _USER_SET_PASSWORD_INFORMATION
 
struct  _USER_CONTROL_INFORMATION
 
struct  _USER_EXPIRES_INFORMATION
 
struct  _USER_PARAMETERS_INFORMATION
 
struct  _USER_ALL_INFORMATION
 
struct  _USER_PWD_CHANGE_FAILURE_INFORMATION
 

Macros

#define ALIAS_ADD_MEMBER   0x00000001
 
#define ALIAS_REMOVE_MEMBER   0x00000002
 
#define ALIAS_LIST_MEMBERS   0x00000004
 
#define ALIAS_READ_INFORMATION   0x00000008
 
#define ALIAS_WRITE_ACCOUNT   0x00000010
 
#define ALIAS_READ
 
#define ALIAS_WRITE
 
#define ALIAS_EXECUTE
 
#define ALIAS_ALL_ACCESS
 
#define DOMAIN_READ_PASSWORD_PARAMETERS   0x00000001
 
#define DOMAIN_WRITE_PASSWORD_PARAMS   0x00000002
 
#define DOMAIN_READ_OTHER_PARAMETERS   0x00000004
 
#define DOMAIN_WRITE_OTHER_PARAMETERS   0x00000008
 
#define DOMAIN_CREATE_USER   0x00000010
 
#define DOMAIN_CREATE_GROUP   0x00000020
 
#define DOMAIN_CREATE_ALIAS   0x00000040
 
#define DOMAIN_GET_ALIAS_MEMBERSHIP   0x00000080
 
#define DOMAIN_LIST_ACCOUNTS   0x00000100
 
#define DOMAIN_LOOKUP   0x00000200
 
#define DOMAIN_ADMINISTER_SERVER   0x00000400
 
#define DOMAIN_READ
 
#define DOMAIN_WRITE
 
#define DOMAIN_EXECUTE
 
#define DOMAIN_ALL_ACCESS
 
#define GROUP_READ_INFORMATION   0x00000001
 
#define GROUP_WRITE_ACCOUNT   0x00000002
 
#define GROUP_ADD_MEMBER   0x00000004
 
#define GROUP_REMOVE_MEMBER   0x00000008
 
#define GROUP_LIST_MEMBERS   0x00000010
 
#define GROUP_READ
 
#define GROUP_WRITE
 
#define GROUP_EXECUTE
 
#define GROUP_ALL_ACCESS
 
#define SAM_SERVER_CONNECT   0x00000001
 
#define SAM_SERVER_SHUTDOWN   0x00000002
 
#define SAM_SERVER_INITIALIZE   0x00000004
 
#define SAM_SERVER_CREATE_DOMAIN   0x00000008
 
#define SAM_SERVER_ENUMERATE_DOMAINS   0x00000010
 
#define SAM_SERVER_LOOKUP_DOMAIN   0x00000020
 
#define SAM_SERVER_READ
 
#define SAM_SERVER_WRITE
 
#define SAM_SERVER_EXECUTE
 
#define SAM_SERVER_ALL_ACCESS
 
#define USER_READ_GENERAL   0x00000001
 
#define USER_READ_PREFERENCES   0x00000002
 
#define USER_WRITE_PREFERENCES   0x00000004
 
#define USER_READ_LOGON   0x00000008
 
#define USER_READ_ACCOUNT   0x00000010
 
#define USER_WRITE_ACCOUNT   0x00000020
 
#define USER_CHANGE_PASSWORD   0x00000040
 
#define USER_FORCE_PASSWORD_CHANGE   0x00000080
 
#define USER_LIST_GROUPS   0x00000100
 
#define USER_READ_GROUP_INFORMATION   0x00000200
 
#define USER_WRITE_GROUP_INFORMATION   0x00000400
 
#define USER_READ
 
#define USER_WRITE
 
#define USER_EXECUTE
 
#define USER_ALL_ACCESS
 
#define USER_ACCOUNT_DISABLED   0x00000001
 
#define USER_HOME_DIRECTORY_REQUIRED   0x00000002
 
#define USER_PASSWORD_NOT_REQUIRED   0x00000004
 
#define USER_TEMP_DUPLICATE_ACCOUNT   0x00000008
 
#define USER_NORMAL_ACCOUNT   0x00000010
 
#define USER_MNS_LOGON_ACCOUNT   0x00000020
 
#define USER_INTERDOMAIN_TRUST_ACCOUNT   0x00000040
 
#define USER_WORKSTATION_TRUST_ACCOUNT   0x00000080
 
#define USER_SERVER_TRUST_ACCOUNT   0x00000100
 
#define USER_DONT_EXPIRE_PASSWORD   0x00000200
 
#define USER_ACCOUNT_AUTO_LOCKED   0x00000400
 
#define USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED   0x00000800
 
#define USER_SMARTCARD_REQUIRED   0x00001000
 
#define USER_TRUSTED_FOR_DELEGATION   0x00002000
 
#define USER_NOT_DELEGATED   0x00004000
 
#define USER_USE_DES_KEY_ONLY   0x00008000
 
#define USER_DONT_REQUIRE_PREAUTH   0x00010000
 
#define USER_PASSWORD_EXPIRED   0x00020000
 
#define USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION   0x00040000
 
#define USER_NO_AUTH_DATA_REQUIRED   0x00080000
 
#define USER_PARTIAL_SECRETS_ACCOUNT   0x00100000
 
#define USER_USE_AES_KEYS   0x00200000
 
#define SAM_DAYS_PER_WEEK   (7)
 
#define SAM_HOURS_PER_WEEK   (24 * SAM_DAYS_PER_WEEK)
 
#define SAM_MINUTES_PER_WEEK   (60 * SAM_HOURS_PER_WEEK)
 
#define USER_ALL_USERNAME   0x00000001
 
#define USER_ALL_FULLNAME   0x00000002
 
#define USER_ALL_USERID   0x00000004
 
#define USER_ALL_PRIMARYGROUPID   0x00000008
 
#define USER_ALL_ADMINCOMMENT   0x00000010
 
#define USER_ALL_USERCOMMENT   0x00000020
 
#define USER_ALL_HOMEDIRECTORY   0x00000040
 
#define USER_ALL_HOMEDIRECTORYDRIVE   0x00000080
 
#define USER_ALL_SCRIPTPATH   0x00000100
 
#define USER_ALL_PROFILEPATH   0x00000200
 
#define USER_ALL_WORKSTATIONS   0x00000400
 
#define USER_ALL_LASTLOGON   0x00000800
 
#define USER_ALL_LASTLOGOFF   0x00001000
 
#define USER_ALL_LOGONHOURS   0x00002000
 
#define USER_ALL_BADPASSWORDCOUNT   0x00004000
 
#define USER_ALL_LOGONCOUNT   0x00008000
 
#define USER_ALL_PASSWORDCANCHANGE   0x00010000
 
#define USER_ALL_PASSWORDMUSTCHANGE   0x00020000
 
#define USER_ALL_PASSWORDLASTSET   0x00040000
 
#define USER_ALL_ACCOUNTEXPIRES   0x00080000
 
#define USER_ALL_USERACCOUNTCONTROL   0x00100000
 
#define USER_ALL_PARAMETERS   0x00200000
 
#define USER_ALL_COUNTRYCODE   0x00400000
 
#define USER_ALL_CODEPAGE   0x00800000
 
#define USER_ALL_NTPASSWORDPRESENT   0x01000000
 
#define USER_ALL_LMPASSWORDPRESENT   0x02000000
 
#define USER_ALL_PRIVATEDATA   0x04000000
 
#define USER_ALL_PASSWORDEXPIRED   0x08000000
 
#define USER_ALL_SECURITYDESCRIPTOR   0x10000000
 
#define USER_ALL_OWFPASSWORD   0x20000000
 
#define USER_ALL_UNDEFINED_MASK   0xC0000000
 
#define USER_ALL_READ_GENERAL_MASK   0x0000003F
 
#define USER_ALL_READ_LOGON_MASK   0x0003FFC0
 
#define USER_ALL_READ_ACCOUNT_MASK   0x003C0000
 
#define USER_ALL_READ_PREFERENCES_MASK   0x00C00000
 
#define USER_ALL_READ_TRUSTED_MASK   0x1F000000
 
#define USER_ALL_READ_CANT_MASK   0xC0000000
 
#define USER_ALL_WRITE_ACCOUNT_MASK   0x003827DB
 
#define USER_ALL_WRITE_PREFERENCES_MASK   0x00C00020
 
#define USER_ALL_WRITE_FORCE_PASSWORD_CHANGE_MASK   0x0B000000
 
#define USER_ALL_WRITE_TRUSTED_MASK   0x1404D800
 
#define USER_ALL_WRITE_CANT_MASK   0xC0030004
 
#define SAM_PWD_CHANGE_NO_ERROR   0
 
#define SAM_PWD_CHANGE_PASSWORD_TOO_SHORT   1
 
#define SAM_PWD_CHANGE_PWD_IN_HISTORY   2
 
#define SAM_PWD_CHANGE_USERNAME_IN_PASSWORD   3
 
#define SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD   4
 
#define SAM_PWD_CHANGE_NOT_COMPLEX   5
 
#define SAM_PWD_CHANGE_MACHINE_PASSWORD_NOT_DEFAULT   6
 
#define SAM_PWD_CHANGE_FAILED_BY_FILTER   7
 
#define SAM_PWD_CHANGE_PASSWORD_TOO_LONG   8
 
#define SAM_PWD_CHANGE_FAILURE_REASON_MAX   8
 
#define DOMAIN_PASSWORD_COMPLEX   0x00000001L
 
#define DOMAIN_PASSWORD_NO_ANON_CHANGE   0x00000002L
 
#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE   0x00000004L
 
#define DOMAIN_LOCKOUT_ADMINS   0x00000008L
 
#define DOMAIN_PASSWORD_STORE_CLEARTEXT   0x00000010L
 
#define DOMAIN_REFUSE_PASSWORD_CHANGE   0x00000020L
 
#define DOMAIN_NO_LM_OWF_CHANGE   0x00000040L
 
#define _DOMAIN_PASSWORD_INFORMATION_DEFINED
 
#define SAM_SID_COMPATIBILITY_ALL   0
 
#define SAM_SID_COMPATIBILITY_LAX   1
 
#define SAM_SID_COMPATIBILITY_STRICT   2
 

Typedefs

typedef PVOID SAM_HANDLE
 
typedef PVOID * PSAM_HANDLE
 
typedef ULONG SAM_ENUMERATE_HANDLE
 
typedef ULONG * PSAM_ENUMERATE_HANDLE
 
typedef struct _SAM_RID_ENUMERATION SAM_RID_ENUMERATION
 
typedef struct _SAM_RID_ENUMERATION * PSAM_RID_ENUMERATION
 
typedef struct _SAM_SID_ENUMERATION SAM_SID_ENUMERATION
 
typedef struct _SAM_SID_ENUMERATION * PSAM_SID_ENUMERATION
 
typedef enum _ALIAS_INFORMATION_CLASS ALIAS_INFORMATION_CLASS
 
typedef enum _ALIAS_INFORMATION_CLASS * PALIAS_INFORMATION_CLASS
 
typedef struct _ALIAS_GENERAL_INFORMATION ALIAS_GENERAL_INFORMATION
 
typedef struct _ALIAS_GENERAL_INFORMATION * PALIAS_GENERAL_INFORMATION
 
typedef struct _ALIAS_NAME_INFORMATION ALIAS_NAME_INFORMATION
 
typedef struct _ALIAS_NAME_INFORMATION * PALIAS_NAME_INFORMATION
 
typedef struct _ALIAS_ADM_COMMENT_INFORMATION ALIAS_ADM_COMMENT_INFORMATION
 
typedef struct _ALIAS_ADM_COMMENT_INFORMATION * PALIAS_ADM_COMMENT_INFORMATION
 
typedef enum _DOMAIN_DISPLAY_INFORMATION DOMAIN_DISPLAY_INFORMATION
 
typedef enum _DOMAIN_DISPLAY_INFORMATION * PDOMAIN_DISPLAY_INFORMATION
 
typedef struct _DOMAIN_DISPLAY_USER DOMAIN_DISPLAY_USER
 
typedef struct _DOMAIN_DISPLAY_USER * PDOMAIN_DISPLAY_USER
 
typedef struct _DOMAIN_DISPLAY_MACHINE DOMAIN_DISPLAY_MACHINE
 
typedef struct _DOMAIN_DISPLAY_MACHINE * PDOMAIN_DISPLAY_MACHINE
 
typedef struct _DOMAIN_DISPLAY_GROUP DOMAIN_DISPLAY_GROUP
 
typedef struct _DOMAIN_DISPLAY_GROUP * PDOMAIN_DISPLAY_GROUP
 
typedef enum _DOMAIN_INFORMATION_CLASS DOMAIN_INFORMATION_CLASS
 
typedef enum _DOMAIN_SERVER_ENABLE_STATE DOMAIN_SERVER_ENABLE_STATE
 
typedef enum _DOMAIN_SERVER_ENABLE_STATE * PDOMAIN_SERVER_ENABLE_STATE
 
typedef enum _DOMAIN_SERVER_ROLE DOMAIN_SERVER_ROLE
 
typedef enum _DOMAIN_SERVER_ROLE * PDOMAIN_SERVER_ROLE
 
typedef struct _DOMAIN_PASSWORD_INFORMATION DOMAIN_PASSWORD_INFORMATION
 
typedef struct _DOMAIN_PASSWORD_INFORMATION * PDOMAIN_PASSWORD_INFORMATION
 
typedef struct _DOMAIN_GENERAL_INFORMATION DOMAIN_GENERAL_INFORMATION
 
typedef struct _DOMAIN_GENERAL_INFORMATION * PDOMAIN_GENERAL_INFORMATION
 
typedef struct _DOMAIN_LOGOFF_INFORMATION DOMAIN_LOGOFF_INFORMATION
 
typedef struct _DOMAIN_LOGOFF_INFORMATION * PDOMAIN_LOGOFF_INFORMATION
 
typedef struct _DOMAIN_OEM_INFORMATION DOMAIN_OEM_INFORMATION
 
typedef struct _DOMAIN_OEM_INFORMATION * PDOMAIN_OEM_INFORMATION
 
typedef struct _DOMAIN_NAME_INFORMATION DOMAIN_NAME_INFORMATION
 
typedef struct _DOMAIN_NAME_INFORMATION * PDOMAIN_NAME_INFORMATION
 
typedef struct _DOMAIN_REPLICATION_INFORMATION DOMAIN_REPLICATION_INFORMATION
 
typedef struct _DOMAIN_REPLICATION_INFORMATION * PDOMAIN_REPLICATION_INFORMATION
 
typedef struct _DOMAIN_SERVER_ROLE_INFORMATION DOMAIN_SERVER_ROLE_INFORMATION
 
typedef struct _DOMAIN_SERVER_ROLE_INFORMATION * PDOMAIN_SERVER_ROLE_INFORMATION
 
typedef struct _DOMAIN_MODIFIED_INFORMATION DOMAIN_MODIFIED_INFORMATION
 
typedef struct _DOMAIN_MODIFIED_INFORMATION * PDOMAIN_MODIFIED_INFORMATION
 
typedef struct _DOMAIN_STATE_INFORMATION DOMAIN_STATE_INFORMATION
 
typedef struct _DOMAIN_STATE_INFORMATION * PDOMAIN_STATE_INFORMATION
 
typedef struct _DOMAIN_UAS_INFORMATION DOMAIN_UAS_INFORMATION
 
typedef struct _DOMAIN_GENERAL_INFORMATION2 DOMAIN_GENERAL_INFORMATION2
 
typedef struct _DOMAIN_GENERAL_INFORMATION2 * PDOMAIN_GENERAL_INFORMATION2
 
typedef struct _DOMAIN_LOCKOUT_INFORMATION DOMAIN_LOCKOUT_INFORMATION
 
typedef struct _DOMAIN_LOCKOUT_INFORMATION * PDOMAIN_LOCKOUT_INFORMATION
 
typedef struct _DOMAIN_MODIFIED_INFORMATION2 DOMAIN_MODIFIED_INFORMATION2
 
typedef struct _DOMAIN_MODIFIED_INFORMATION2 * PDOMAIN_MODIFIED_INFORMATION2
 
typedef enum _GROUP_INFORMATION_CLASS GROUP_INFORMATION_CLASS
 
typedef struct _GROUP_GENERAL_INFORMATION GROUP_GENERAL_INFORMATION
 
typedef struct _GROUP_GENERAL_INFORMATION * PGROUP_GENERAL_INFORMATION
 
typedef struct _GROUP_NAME_INFORMATION GROUP_NAME_INFORMATION
 
typedef struct _GROUP_NAME_INFORMATION * PGROUP_NAME_INFORMATION
 
typedef struct _GROUP_ATTRIBUTE_INFORMATION GROUP_ATTRIBUTE_INFORMATION
 
typedef struct _GROUP_ATTRIBUTE_INFORMATION * PGROUP_ATTRIBUTE_INFORMATION
 
typedef struct GROUP_ADM_COMMENT_INFORMATION GROUP_ADM_COMMENT_INFORMATION
 
typedef struct GROUP_ADM_COMMENT_INFORMATION * PGROUP_ADM_COMMENT_INFORMATION
 
typedef struct _GROUP_MEMBERSHIP GROUP_MEMBERSHIP
 
typedef struct _GROUP_MEMBERSHIP * PGROUP_MEMBERSHIP
 
typedef struct _LOGON_HOURS LOGON_HOURS
 
typedef struct _LOGON_HOURS * PLOGON_HOURS
 
typedef struct _SR_SECURITY_DESCRIPTOR SR_SECURITY_DESCRIPTOR
 
typedef struct _SR_SECURITY_DESCRIPTOR * PSR_SECURITY_DESCRIPTOR
 
typedef enum _USER_INFORMATION_CLASS USER_INFORMATION_CLASS
 
typedef enum _USER_INFORMATION_CLASS * PUSER_INFORMATION_CLASS
 
typedef struct _USER_GENERAL_INFORMATION USER_GENERAL_INFORMATION
 
typedef struct _USER_GENERAL_INFORMATION * PUSER_GENERAL_INFORMATION
 
typedef struct _USER_PREFERENCES_INFORMATION USER_PREFERENCES_INFORMATION
 
typedef struct _USER_PREFERENCES_INFORMATION * PUSER_PREFERENCES_INFORMATION
 
typedef struct _USER_LOGON_INFORMATION USER_LOGON_INFORMATION
 
typedef struct _USER_LOGON_INFORMATION * PUSER_LOGON_INFORMATION
 
typedef struct _USER_LOGON_HOURS_INFORMATION USER_LOGON_HOURS_INFORMATION
 
typedef struct _USER_LOGON_HOURS_INFORMATION * PUSER_LOGON_HOURS_INFORMATION
 
typedef struct _USER_ACCOUNT_INFORMATION USER_ACCOUNT_INFORMATION
 
typedef struct _USER_ACCOUNT_INFORMATION * PUSER_ACCOUNT_INFORMATION
 
typedef struct _USER_NAME_INFORMATION USER_NAME_INFORMATION
 
typedef struct _USER_NAME_INFORMATION * PUSER_NAME_INFORMATION
 
typedef struct _USER_ACCOUNT_NAME_INFORMATION USER_ACCOUNT_NAME_INFORMATION
 
typedef struct _USER_ACCOUNT_NAME_INFORMATION * PUSER_ACCOUNT_NAME_INFORMATION
 
typedef struct _USER_FULL_NAME_INFORMATION USER_FULL_NAME_INFORMATION
 
typedef struct _USER_FULL_NAME_INFORMATION * PUSER_FULL_NAME_INFORMATION
 
typedef struct _USER_PRIMARY_GROUP_INFORMATION USER_PRIMARY_GROUP_INFORMATION
 
typedef struct _USER_PRIMARY_GROUP_INFORMATION * PUSER_PRIMARY_GROUP_INFORMATION
 
typedef struct _USER_HOME_INFORMATION USER_HOME_INFORMATION
 
typedef struct _USER_HOME_INFORMATION * PUSER_HOME_INFORMATION
 
typedef struct _USER_SCRIPT_INFORMATION USER_SCRIPT_INFORMATION
 
typedef struct _USER_SCRIPT_INFORMATION * PUSER_SCRIPT_INFORMATION
 
typedef struct _USER_PROFILE_INFORMATION USER_PROFILE_INFORMATION
 
typedef struct _USER_PROFILE_INFORMATION * PUSER_PROFILE_INFORMATION
 
typedef struct _USER_ADMIN_COMMENT_INFORMATION USER_ADMIN_COMMENT_INFORMATION
 
typedef struct _USER_ADMIN_COMMENT_INFORMATION * PUSER_ADMIN_COMMENT_INFORMATION
 
typedef struct _USER_WORKSTATIONS_INFORMATION USER_WORKSTATIONS_INFORMATION
 
typedef struct _USER_WORKSTATIONS_INFORMATION * PUSER_WORKSTATIONS_INFORMATION
 
typedef struct _USER_SET_PASSWORD_INFORMATION USER_SET_PASSWORD_INFORMATION
 
typedef struct _USER_SET_PASSWORD_INFORMATION * PUSER_SET_PASSWORD_INFORMATION
 
typedef struct _USER_CONTROL_INFORMATION USER_CONTROL_INFORMATION
 
typedef struct _USER_CONTROL_INFORMATION * PUSER_CONTROL_INFORMATION
 
typedef struct _USER_EXPIRES_INFORMATION USER_EXPIRES_INFORMATION
 
typedef struct _USER_EXPIRES_INFORMATION * PUSER_EXPIRES_INFORMATION
 
typedef struct _USER_PARAMETERS_INFORMATION USER_PARAMETERS_INFORMATION
 
typedef struct _USER_PARAMETERS_INFORMATION * PUSER_PARAMETERS_INFORMATION
 
typedef struct _USER_ALL_INFORMATION USER_ALL_INFORMATION
 
typedef struct _USER_ALL_INFORMATION * PUSER_ALL_INFORMATION
 
typedef struct _USER_PWD_CHANGE_FAILURE_INFORMATION USER_PWD_CHANGE_FAILURE_INFORMATION
 
typedef struct _USER_PWD_CHANGE_FAILURE_INFORMATION * PUSER_PWD_CHANGE_FAILURE_INFORMATION
 

Enumerations

enum  _ALIAS_INFORMATION_CLASS {
  AliasGeneralInformation = 1 , AliasNameInformation , AliasAdminCommentInformation , AliasGeneralInformation = 1 ,
  AliasNameInformation , AliasAdminCommentInformation
}
 
enum  _DOMAIN_DISPLAY_INFORMATION {
  DomainDisplayUser = 1 , DomainDisplayMachine , DomainDisplayGroup , DomainDisplayOemUser ,
  DomainDisplayOemGroup , DomainDisplayServer , DomainDisplayUser = 1 , DomainDisplayMachine ,
  DomainDisplayGroup , DomainDisplayOemUser , DomainDisplayOemGroup , DomainDisplayServer
}
 
enum  _DOMAIN_INFORMATION_CLASS {
  DomainPasswordInformation = 1 , DomainGeneralInformation , DomainLogoffInformation , DomainOemInformation ,
  DomainNameInformation , DomainReplicationInformation , DomainServerRoleInformation , DomainModifiedInformation ,
  DomainStateInformation , DomainUasInformation , DomainGeneralInformation2 , DomainLockoutInformation ,
  DomainModifiedInformation2 , DomainPasswordInformation = 1 , DomainGeneralInformation = 2 , DomainLogoffInformation = 3 ,
  DomainOemInformation = 4 , DomainNameInformation = 5 , DomainReplicationInformation = 6 , DomainServerRoleInformation = 7 ,
  DomainModifiedInformation = 8 , DomainStateInformation = 9 , DomainGeneralInformation2 = 11 , DomainLockoutInformation = 12 ,
  DomainModifiedInformation2 = 13
}
 
enum  _DOMAIN_SERVER_ENABLE_STATE { DomainServerEnabled = 1 , DomainServerDisabled , DomainServerEnabled = 1 , DomainServerDisabled }
 
enum  _DOMAIN_SERVER_ROLE { DomainServerRoleBackup = 2 , DomainServerRolePrimary , DomainServerRoleBackup = 2 , DomainServerRolePrimary = 3 }
 
enum  _GROUP_INFORMATION_CLASS {
  GroupGeneralInformation = 1 , GroupNameInformation , GroupAttributeInformation , GroupAdminCommentInformation ,
  GroupReplicationInformation , GroupGeneralInformation = 1 , GroupNameInformation , GroupAttributeInformation ,
  GroupAdminCommentInformation , GroupReplicationInformation
}
 
enum  _USER_INFORMATION_CLASS {
  UserGeneralInformation = 1 , UserPreferencesInformation , UserLogonInformation , UserLogonHoursInformation ,
  UserAccountInformation , UserNameInformation , UserAccountNameInformation , UserFullNameInformation ,
  UserPrimaryGroupInformation , UserHomeInformation , UserScriptInformation , UserProfileInformation ,
  UserAdminCommentInformation , UserWorkStationsInformation , UserSetPasswordInformation , UserControlInformation ,
  UserExpiresInformation , UserInternal1Information , UserInternal2Information , UserParametersInformation ,
  UserAllInformation , UserInternal3Information , UserInternal4Information , UserInternal5Information ,
  UserInternal4InformationNew , UserInternal5InformationNew , UserInternal6Information , UserExtendedInformation ,
  UserLogonUIInformation , UserGeneralInformation = 1 , UserPreferencesInformation = 2 , UserLogonInformation = 3 ,
  UserLogonHoursInformation = 4 , UserAccountInformation = 5 , UserNameInformation = 6 , UserAccountNameInformation = 7 ,
  UserFullNameInformation = 8 , UserPrimaryGroupInformation = 9 , UserHomeInformation = 10 , UserScriptInformation = 11 ,
  UserProfileInformation = 12 , UserAdminCommentInformation = 13 , UserWorkStationsInformation = 14 , UserSetPasswordInformation = 15 ,
  UserControlInformation = 16 , UserExpiresInformation = 17 , UserInternal1Information = 18 , UserInternal2Information = 19 ,
  UserParametersInformation = 20 , UserAllInformation = 21 , UserInternal3Information = 22 , UserInternal4Information = 23 ,
  UserInternal5Information = 24 , UserInternal4InformationNew = 25 , UserInternal5InformationNew = 26 , UserInternal6Information ,
  UserExtendedInformation , UserLogonUIInformation
}
 

Functions

NTSTATUS NTAPI SamAddMemberToAlias (IN SAM_HANDLE AliasHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamAddMemberToGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
 
NTSTATUS NTAPI SamAddMultipleMembersToAlias (IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
 
NTSTATUS NTAPI SamChangePasswordUser (IN SAM_HANDLE UserHandle, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
 
NTSTATUS NTAPI SamChangePasswordUser2 (IN PUNICODE_STRING ServerName, IN PUNICODE_STRING UserName, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
 
NTSTATUS NTAPI SamChangePasswordUser3 (IN PUNICODE_STRING ServerName, IN PUNICODE_STRING UserName, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword, OUT PDOMAIN_PASSWORD_INFORMATION *EffectivePasswordPolicy, OUT PUSER_PWD_CHANGE_FAILURE_INFORMATION *PasswordChangeFailureInfo)
 
NTSTATUS NTAPI SamCloseHandle (IN SAM_HANDLE SamHandle)
 
NTSTATUS NTAPI SamConnect (IN OUT PUNICODE_STRING ServerName OPTIONAL, OUT PSAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
 
NTSTATUS NTAPI SamCreateAliasInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE AliasHandle, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamCreateGroupInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE GroupHandle, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamCreateUser2InDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ULONG AccountType, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE UserHandle, OUT PULONG GrantedAccess, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamCreateUserInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE UserHandle, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamDeleteAlias (IN SAM_HANDLE AliasHandle)
 
NTSTATUS NTAPI SamDeleteGroup (IN SAM_HANDLE GroupHandle)
 
NTSTATUS NTAPI SamDeleteUser (IN SAM_HANDLE UserHandle)
 
NTSTATUS NTAPI SamEnumerateAliasesInDomain (IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamEnumerateDomainsInSamServer (IN SAM_HANDLE ServerHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamEnumerateGroupsInDomain (IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, IN PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamEnumerateUsersInDomain (IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, IN ULONG UserAccountControl, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamFreeMemory (IN PVOID Buffer)
 
NTSTATUS NTAPI SamGetAliasMembership (IN SAM_HANDLE DomainHandle, IN ULONG PassedCount, IN PSID *Sids, OUT PULONG MembershipCount, OUT PULONG *Aliases)
 
NTSTATUS NTAPI SamGetCompatibilityMode (IN SAM_HANDLE ObjectHandle, OUT PULONG Mode)
 
NTSTATUS NTAPI SamGetDisplayEnumerationIndex (IN SAM_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformation, IN PUNICODE_STRING Prefix, OUT PULONG Index)
 
NTSTATUS NTAPI SamGetGroupsForUser (IN SAM_HANDLE UserHandle, OUT PGROUP_MEMBERSHIP *Groups, OUT PULONG MembershipCount)
 
NTSTATUS NTAPI SamGetMembersInAlias (IN SAM_HANDLE AliasHandle, OUT PSID **MemberIds, OUT PULONG MemberCount)
 
NTSTATUS NTAPI SamGetMembersInGroup (IN SAM_HANDLE GroupHandle, OUT PULONG *MemberIds, OUT PULONG *Attributes, OUT PULONG MemberCount)
 
NTSTATUS NTAPI SamLookupDomainInSamServer (IN SAM_HANDLE ServerHandle, IN PUNICODE_STRING Name, OUT PSID *DomainId)
 
NTSTATUS NTAPI SamLookupIdsInDomain (IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PULONG RelativeIds, OUT PUNICODE_STRING *Names, OUT PSID_NAME_USE *Use OPTIONAL)
 
NTSTATUS NTAPI SamLookupNamesInDomain (IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PUNICODE_STRING Names, OUT PULONG *RelativeIds, OUT PSID_NAME_USE *Use)
 
NTSTATUS NTAPI SamOpenAlias (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT PSAM_HANDLE AliasHandle)
 
NTSTATUS NTAPI SamOpenDomain (IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
 
NTSTATUS NTAPI SamOpenGroup (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG GroupId, OUT PSAM_HANDLE GroupHandle)
 
NTSTATUS NTAPI SamOpenUser (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT PSAM_HANDLE UserHandle)
 
NTSTATUS NTAPI SamQueryDisplayInformation (IN SAM_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformation, IN ULONG Index, IN ULONG EntryCount, IN ULONG PreferredMaximumLength, OUT PULONG TotalAvailable, OUT PULONG TotalReturned, OUT PULONG ReturnedEntryCount, OUT PVOID *SortedBuffer)
 
NTSTATUS NTAPI SamQueryInformationAlias (IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationDomain (IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationGroup (IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationUser (IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQuerySecurityObject (IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
NTSTATUS NTAPI SamRemoveMemberFromAlias (IN SAM_HANDLE AliasHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamRemoveMemberFromForeignDomain (IN SAM_HANDLE DomainHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamRemoveMemberFromGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId)
 
NTSTATUS NTAPI SamRemoveMultipleMembersFromAlias (IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
 
NTSTATUS NTAPI SamRidToSid (IN SAM_HANDLE ObjectHandle, IN ULONG Rid, OUT PSID *Sid)
 
NTSTATUS NTAPI SamSetInformationAlias (IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationDomain (IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationGroup (IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationUser (IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetMemberAttributesOfGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
 
NTSTATUS NTAPI SamSetSecurityObject (IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 
NTSTATUS NTAPI SamShutdownSamServer (IN SAM_HANDLE ServerHandle)
 

Macro Definition Documentation

◆ _DOMAIN_PASSWORD_INFORMATION_DEFINED

#define _DOMAIN_PASSWORD_INFORMATION_DEFINED

Definition at line 369 of file ntsam.h.

◆ ALIAS_ADD_MEMBER

#define ALIAS_ADD_MEMBER   0x00000001

Definition at line 9 of file ntsam.h.

◆ ALIAS_ALL_ACCESS

#define ALIAS_ALL_ACCESS
Value:
#define STANDARD_RIGHTS_REQUIRED
Definition: nt_native.h:63
#define ALIAS_WRITE_ACCOUNT
Definition: ntsam.h:13
#define ALIAS_LIST_MEMBERS
Definition: ntsam.h:11
#define ALIAS_READ_INFORMATION
Definition: ntsam.h:12
#define ALIAS_REMOVE_MEMBER
Definition: ntsam.h:10
#define ALIAS_ADD_MEMBER
Definition: ntsam.h:9

Definition at line 26 of file ntsam.h.

◆ ALIAS_EXECUTE

#define ALIAS_EXECUTE
Value:

Definition at line 23 of file ntsam.h.

◆ ALIAS_LIST_MEMBERS

#define ALIAS_LIST_MEMBERS   0x00000004

Definition at line 11 of file ntsam.h.

◆ ALIAS_READ

#define ALIAS_READ
Value:
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65

Definition at line 15 of file ntsam.h.

◆ ALIAS_READ_INFORMATION

#define ALIAS_READ_INFORMATION   0x00000008

Definition at line 12 of file ntsam.h.

◆ ALIAS_REMOVE_MEMBER

#define ALIAS_REMOVE_MEMBER   0x00000002

Definition at line 10 of file ntsam.h.

◆ ALIAS_WRITE

#define ALIAS_WRITE
Value:

Definition at line 18 of file ntsam.h.

◆ ALIAS_WRITE_ACCOUNT

#define ALIAS_WRITE_ACCOUNT   0x00000010

Definition at line 13 of file ntsam.h.

◆ DOMAIN_ADMINISTER_SERVER

#define DOMAIN_ADMINISTER_SERVER   0x00000400

Definition at line 43 of file ntsam.h.

◆ DOMAIN_ALL_ACCESS

#define DOMAIN_ALL_ACCESS
Value:
#define DOMAIN_WRITE_OTHER_PARAMETERS
Definition: ntsam.h:36
#define DOMAIN_CREATE_GROUP
Definition: ntsam.h:38
#define DOMAIN_LOOKUP
Definition: ntsam.h:42
#define DOMAIN_CREATE_ALIAS
Definition: ntsam.h:39
#define DOMAIN_WRITE_PASSWORD_PARAMS
Definition: ntsam.h:34
#define DOMAIN_READ_PASSWORD_PARAMETERS
Definition: ntsam.h:33
#define DOMAIN_CREATE_USER
Definition: ntsam.h:37
#define DOMAIN_GET_ALIAS_MEMBERSHIP
Definition: ntsam.h:40
#define DOMAIN_LIST_ACCOUNTS
Definition: ntsam.h:41
#define DOMAIN_ADMINISTER_SERVER
Definition: ntsam.h:43
#define DOMAIN_READ_OTHER_PARAMETERS
Definition: ntsam.h:35

Definition at line 62 of file ntsam.h.

◆ DOMAIN_CREATE_ALIAS

#define DOMAIN_CREATE_ALIAS   0x00000040

Definition at line 39 of file ntsam.h.

◆ DOMAIN_CREATE_GROUP

#define DOMAIN_CREATE_GROUP   0x00000020

Definition at line 38 of file ntsam.h.

◆ DOMAIN_CREATE_USER

#define DOMAIN_CREATE_USER   0x00000010

Definition at line 37 of file ntsam.h.

◆ DOMAIN_EXECUTE

#define DOMAIN_EXECUTE

◆ DOMAIN_GET_ALIAS_MEMBERSHIP

#define DOMAIN_GET_ALIAS_MEMBERSHIP   0x00000080

Definition at line 40 of file ntsam.h.

◆ DOMAIN_LIST_ACCOUNTS

#define DOMAIN_LIST_ACCOUNTS   0x00000100

Definition at line 41 of file ntsam.h.

◆ DOMAIN_LOCKOUT_ADMINS

#define DOMAIN_LOCKOUT_ADMINS   0x00000008L

Definition at line 257 of file ntsam.h.

◆ DOMAIN_LOOKUP

#define DOMAIN_LOOKUP   0x00000200

Definition at line 42 of file ntsam.h.

◆ DOMAIN_NO_LM_OWF_CHANGE

#define DOMAIN_NO_LM_OWF_CHANGE   0x00000040L

Definition at line 260 of file ntsam.h.

◆ DOMAIN_PASSWORD_COMPLEX

#define DOMAIN_PASSWORD_COMPLEX   0x00000001L

Definition at line 254 of file ntsam.h.

◆ DOMAIN_PASSWORD_NO_ANON_CHANGE

#define DOMAIN_PASSWORD_NO_ANON_CHANGE   0x00000002L

Definition at line 255 of file ntsam.h.

◆ DOMAIN_PASSWORD_NO_CLEAR_CHANGE

#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE   0x00000004L

Definition at line 256 of file ntsam.h.

◆ DOMAIN_PASSWORD_STORE_CLEARTEXT

#define DOMAIN_PASSWORD_STORE_CLEARTEXT   0x00000010L

Definition at line 258 of file ntsam.h.

◆ DOMAIN_READ

#define DOMAIN_READ

◆ DOMAIN_READ_OTHER_PARAMETERS

#define DOMAIN_READ_OTHER_PARAMETERS   0x00000004

Definition at line 35 of file ntsam.h.

◆ DOMAIN_READ_PASSWORD_PARAMETERS

#define DOMAIN_READ_PASSWORD_PARAMETERS   0x00000001

Definition at line 33 of file ntsam.h.

◆ DOMAIN_REFUSE_PASSWORD_CHANGE

#define DOMAIN_REFUSE_PASSWORD_CHANGE   0x00000020L

Definition at line 259 of file ntsam.h.

◆ DOMAIN_WRITE

◆ DOMAIN_WRITE_OTHER_PARAMETERS

#define DOMAIN_WRITE_OTHER_PARAMETERS   0x00000008

Definition at line 36 of file ntsam.h.

◆ DOMAIN_WRITE_PASSWORD_PARAMS

#define DOMAIN_WRITE_PASSWORD_PARAMS   0x00000002

Definition at line 34 of file ntsam.h.

◆ GROUP_ADD_MEMBER

#define GROUP_ADD_MEMBER   0x00000004

Definition at line 77 of file ntsam.h.

◆ GROUP_ALL_ACCESS

#define GROUP_ALL_ACCESS
Value:
#define GROUP_READ_INFORMATION
Definition: ntsam.h:75
#define GROUP_ADD_MEMBER
Definition: ntsam.h:77
#define GROUP_LIST_MEMBERS
Definition: ntsam.h:79
#define GROUP_WRITE_ACCOUNT
Definition: ntsam.h:76
#define GROUP_REMOVE_MEMBER
Definition: ntsam.h:78

Definition at line 92 of file ntsam.h.

◆ GROUP_EXECUTE

#define GROUP_EXECUTE
Value:

Definition at line 89 of file ntsam.h.

◆ GROUP_LIST_MEMBERS

#define GROUP_LIST_MEMBERS   0x00000010

Definition at line 79 of file ntsam.h.

◆ GROUP_READ

#define GROUP_READ
Value:

Definition at line 81 of file ntsam.h.

◆ GROUP_READ_INFORMATION

#define GROUP_READ_INFORMATION   0x00000001

Definition at line 75 of file ntsam.h.

◆ GROUP_REMOVE_MEMBER

#define GROUP_REMOVE_MEMBER   0x00000008

Definition at line 78 of file ntsam.h.

◆ GROUP_WRITE

#define GROUP_WRITE

◆ GROUP_WRITE_ACCOUNT

#define GROUP_WRITE_ACCOUNT   0x00000002

Definition at line 76 of file ntsam.h.

◆ SAM_DAYS_PER_WEEK

#define SAM_DAYS_PER_WEEK   (7)

Definition at line 191 of file ntsam.h.

◆ SAM_HOURS_PER_WEEK

#define SAM_HOURS_PER_WEEK   (24 * SAM_DAYS_PER_WEEK)

Definition at line 192 of file ntsam.h.

◆ SAM_MINUTES_PER_WEEK

#define SAM_MINUTES_PER_WEEK   (60 * SAM_HOURS_PER_WEEK)

Definition at line 193 of file ntsam.h.

◆ SAM_PWD_CHANGE_FAILED_BY_FILTER

#define SAM_PWD_CHANGE_FAILED_BY_FILTER   7

Definition at line 249 of file ntsam.h.

◆ SAM_PWD_CHANGE_FAILURE_REASON_MAX

#define SAM_PWD_CHANGE_FAILURE_REASON_MAX   8

Definition at line 251 of file ntsam.h.

◆ SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD

#define SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD   4

Definition at line 246 of file ntsam.h.

◆ SAM_PWD_CHANGE_MACHINE_PASSWORD_NOT_DEFAULT

#define SAM_PWD_CHANGE_MACHINE_PASSWORD_NOT_DEFAULT   6

Definition at line 248 of file ntsam.h.

◆ SAM_PWD_CHANGE_NO_ERROR

#define SAM_PWD_CHANGE_NO_ERROR   0

Definition at line 242 of file ntsam.h.

◆ SAM_PWD_CHANGE_NOT_COMPLEX

#define SAM_PWD_CHANGE_NOT_COMPLEX   5

Definition at line 247 of file ntsam.h.

◆ SAM_PWD_CHANGE_PASSWORD_TOO_LONG

#define SAM_PWD_CHANGE_PASSWORD_TOO_LONG   8

Definition at line 250 of file ntsam.h.

◆ SAM_PWD_CHANGE_PASSWORD_TOO_SHORT

#define SAM_PWD_CHANGE_PASSWORD_TOO_SHORT   1

Definition at line 243 of file ntsam.h.

◆ SAM_PWD_CHANGE_PWD_IN_HISTORY

#define SAM_PWD_CHANGE_PWD_IN_HISTORY   2

Definition at line 244 of file ntsam.h.

◆ SAM_PWD_CHANGE_USERNAME_IN_PASSWORD

#define SAM_PWD_CHANGE_USERNAME_IN_PASSWORD   3

Definition at line 245 of file ntsam.h.

◆ SAM_SERVER_ALL_ACCESS

#define SAM_SERVER_ALL_ACCESS
Value:
#define SAM_SERVER_SHUTDOWN
Definition: ntsam.h:100
#define SAM_SERVER_LOOKUP_DOMAIN
Definition: ntsam.h:104
#define SAM_SERVER_CONNECT
Definition: ntsam.h:99
#define SAM_SERVER_ENUMERATE_DOMAINS
Definition: ntsam.h:103
#define SAM_SERVER_CREATE_DOMAIN
Definition: ntsam.h:102
#define SAM_SERVER_INITIALIZE
Definition: ntsam.h:101

Definition at line 118 of file ntsam.h.

◆ SAM_SERVER_CONNECT

#define SAM_SERVER_CONNECT   0x00000001

Definition at line 99 of file ntsam.h.

◆ SAM_SERVER_CREATE_DOMAIN

#define SAM_SERVER_CREATE_DOMAIN   0x00000008

Definition at line 102 of file ntsam.h.

◆ SAM_SERVER_ENUMERATE_DOMAINS

#define SAM_SERVER_ENUMERATE_DOMAINS   0x00000010

Definition at line 103 of file ntsam.h.

◆ SAM_SERVER_EXECUTE

#define SAM_SERVER_EXECUTE

◆ SAM_SERVER_INITIALIZE

#define SAM_SERVER_INITIALIZE   0x00000004

Definition at line 101 of file ntsam.h.

◆ SAM_SERVER_LOOKUP_DOMAIN

#define SAM_SERVER_LOOKUP_DOMAIN   0x00000020

Definition at line 104 of file ntsam.h.

◆ SAM_SERVER_READ

#define SAM_SERVER_READ
Value:

Definition at line 106 of file ntsam.h.

◆ SAM_SERVER_SHUTDOWN

#define SAM_SERVER_SHUTDOWN   0x00000002

Definition at line 100 of file ntsam.h.

◆ SAM_SERVER_WRITE

#define SAM_SERVER_WRITE

◆ SAM_SID_COMPATIBILITY_ALL

#define SAM_SID_COMPATIBILITY_ALL   0

Definition at line 728 of file ntsam.h.

◆ SAM_SID_COMPATIBILITY_LAX

#define SAM_SID_COMPATIBILITY_LAX   1

Definition at line 729 of file ntsam.h.

◆ SAM_SID_COMPATIBILITY_STRICT

#define SAM_SID_COMPATIBILITY_STRICT   2

Definition at line 730 of file ntsam.h.

◆ USER_ACCOUNT_AUTO_LOCKED

#define USER_ACCOUNT_AUTO_LOCKED   0x00000400

Definition at line 177 of file ntsam.h.

◆ USER_ACCOUNT_DISABLED

#define USER_ACCOUNT_DISABLED   0x00000001

Definition at line 167 of file ntsam.h.

◆ USER_ALL_ACCESS

#define USER_ALL_ACCESS
Value:
#define USER_READ_GENERAL
Definition: ntsam.h:126
#define USER_READ_LOGON
Definition: ntsam.h:129
#define USER_WRITE_GROUP_INFORMATION
Definition: ntsam.h:136
#define USER_FORCE_PASSWORD_CHANGE
Definition: ntsam.h:133
#define USER_READ_PREFERENCES
Definition: ntsam.h:127
#define USER_WRITE_ACCOUNT
Definition: ntsam.h:131
#define USER_READ_ACCOUNT
Definition: ntsam.h:130
#define USER_LIST_GROUPS
Definition: ntsam.h:134
#define USER_WRITE_PREFERENCES
Definition: ntsam.h:128
#define USER_CHANGE_PASSWORD
Definition: ntsam.h:132
#define USER_READ_GROUP_INFORMATION
Definition: ntsam.h:135

Definition at line 153 of file ntsam.h.

◆ USER_ALL_ACCOUNTEXPIRES

#define USER_ALL_ACCOUNTEXPIRES   0x00080000

Definition at line 215 of file ntsam.h.

◆ USER_ALL_ADMINCOMMENT

#define USER_ALL_ADMINCOMMENT   0x00000010

Definition at line 200 of file ntsam.h.

◆ USER_ALL_BADPASSWORDCOUNT

#define USER_ALL_BADPASSWORDCOUNT   0x00004000

Definition at line 210 of file ntsam.h.

◆ USER_ALL_CODEPAGE

#define USER_ALL_CODEPAGE   0x00800000

Definition at line 219 of file ntsam.h.

◆ USER_ALL_COUNTRYCODE

#define USER_ALL_COUNTRYCODE   0x00400000

Definition at line 218 of file ntsam.h.

◆ USER_ALL_FULLNAME

#define USER_ALL_FULLNAME   0x00000002

Definition at line 197 of file ntsam.h.

◆ USER_ALL_HOMEDIRECTORY

#define USER_ALL_HOMEDIRECTORY   0x00000040

Definition at line 202 of file ntsam.h.

◆ USER_ALL_HOMEDIRECTORYDRIVE

#define USER_ALL_HOMEDIRECTORYDRIVE   0x00000080

Definition at line 203 of file ntsam.h.

◆ USER_ALL_LASTLOGOFF

#define USER_ALL_LASTLOGOFF   0x00001000

Definition at line 208 of file ntsam.h.

◆ USER_ALL_LASTLOGON

#define USER_ALL_LASTLOGON   0x00000800

Definition at line 207 of file ntsam.h.

◆ USER_ALL_LMPASSWORDPRESENT

#define USER_ALL_LMPASSWORDPRESENT   0x02000000

Definition at line 221 of file ntsam.h.

◆ USER_ALL_LOGONCOUNT

#define USER_ALL_LOGONCOUNT   0x00008000

Definition at line 211 of file ntsam.h.

◆ USER_ALL_LOGONHOURS

#define USER_ALL_LOGONHOURS   0x00002000

Definition at line 209 of file ntsam.h.

◆ USER_ALL_NTPASSWORDPRESENT

#define USER_ALL_NTPASSWORDPRESENT   0x01000000

Definition at line 220 of file ntsam.h.

◆ USER_ALL_OWFPASSWORD

#define USER_ALL_OWFPASSWORD   0x20000000

Definition at line 225 of file ntsam.h.

◆ USER_ALL_PARAMETERS

#define USER_ALL_PARAMETERS   0x00200000

Definition at line 217 of file ntsam.h.

◆ USER_ALL_PASSWORDCANCHANGE

#define USER_ALL_PASSWORDCANCHANGE   0x00010000

Definition at line 212 of file ntsam.h.

◆ USER_ALL_PASSWORDEXPIRED

#define USER_ALL_PASSWORDEXPIRED   0x08000000

Definition at line 223 of file ntsam.h.

◆ USER_ALL_PASSWORDLASTSET

#define USER_ALL_PASSWORDLASTSET   0x00040000

Definition at line 214 of file ntsam.h.

◆ USER_ALL_PASSWORDMUSTCHANGE

#define USER_ALL_PASSWORDMUSTCHANGE   0x00020000

Definition at line 213 of file ntsam.h.

◆ USER_ALL_PRIMARYGROUPID

#define USER_ALL_PRIMARYGROUPID   0x00000008

Definition at line 199 of file ntsam.h.

◆ USER_ALL_PRIVATEDATA

#define USER_ALL_PRIVATEDATA   0x04000000

Definition at line 222 of file ntsam.h.

◆ USER_ALL_PROFILEPATH

#define USER_ALL_PROFILEPATH   0x00000200

Definition at line 205 of file ntsam.h.

◆ USER_ALL_READ_ACCOUNT_MASK

#define USER_ALL_READ_ACCOUNT_MASK   0x003C0000

Definition at line 230 of file ntsam.h.

◆ USER_ALL_READ_CANT_MASK

#define USER_ALL_READ_CANT_MASK   0xC0000000

Definition at line 233 of file ntsam.h.

◆ USER_ALL_READ_GENERAL_MASK

#define USER_ALL_READ_GENERAL_MASK   0x0000003F

Definition at line 228 of file ntsam.h.

◆ USER_ALL_READ_LOGON_MASK

#define USER_ALL_READ_LOGON_MASK   0x0003FFC0

Definition at line 229 of file ntsam.h.

◆ USER_ALL_READ_PREFERENCES_MASK

#define USER_ALL_READ_PREFERENCES_MASK   0x00C00000

Definition at line 231 of file ntsam.h.

◆ USER_ALL_READ_TRUSTED_MASK

#define USER_ALL_READ_TRUSTED_MASK   0x1F000000

Definition at line 232 of file ntsam.h.

◆ USER_ALL_SCRIPTPATH

#define USER_ALL_SCRIPTPATH   0x00000100

Definition at line 204 of file ntsam.h.

◆ USER_ALL_SECURITYDESCRIPTOR

#define USER_ALL_SECURITYDESCRIPTOR   0x10000000

Definition at line 224 of file ntsam.h.

◆ USER_ALL_UNDEFINED_MASK

#define USER_ALL_UNDEFINED_MASK   0xC0000000

Definition at line 226 of file ntsam.h.

◆ USER_ALL_USERACCOUNTCONTROL

#define USER_ALL_USERACCOUNTCONTROL   0x00100000

Definition at line 216 of file ntsam.h.

◆ USER_ALL_USERCOMMENT

#define USER_ALL_USERCOMMENT   0x00000020

Definition at line 201 of file ntsam.h.

◆ USER_ALL_USERID

#define USER_ALL_USERID   0x00000004

Definition at line 198 of file ntsam.h.

◆ USER_ALL_USERNAME

#define USER_ALL_USERNAME   0x00000001

Definition at line 196 of file ntsam.h.

◆ USER_ALL_WORKSTATIONS

#define USER_ALL_WORKSTATIONS   0x00000400

Definition at line 206 of file ntsam.h.

◆ USER_ALL_WRITE_ACCOUNT_MASK

#define USER_ALL_WRITE_ACCOUNT_MASK   0x003827DB

Definition at line 235 of file ntsam.h.

◆ USER_ALL_WRITE_CANT_MASK

#define USER_ALL_WRITE_CANT_MASK   0xC0030004

Definition at line 239 of file ntsam.h.

◆ USER_ALL_WRITE_FORCE_PASSWORD_CHANGE_MASK

#define USER_ALL_WRITE_FORCE_PASSWORD_CHANGE_MASK   0x0B000000

Definition at line 237 of file ntsam.h.

◆ USER_ALL_WRITE_PREFERENCES_MASK

#define USER_ALL_WRITE_PREFERENCES_MASK   0x00C00020

Definition at line 236 of file ntsam.h.

◆ USER_ALL_WRITE_TRUSTED_MASK

#define USER_ALL_WRITE_TRUSTED_MASK   0x1404D800

Definition at line 238 of file ntsam.h.

◆ USER_CHANGE_PASSWORD

#define USER_CHANGE_PASSWORD   0x00000040

Definition at line 132 of file ntsam.h.

◆ USER_DONT_EXPIRE_PASSWORD

#define USER_DONT_EXPIRE_PASSWORD   0x00000200

Definition at line 176 of file ntsam.h.

◆ USER_DONT_REQUIRE_PREAUTH

#define USER_DONT_REQUIRE_PREAUTH   0x00010000

Definition at line 183 of file ntsam.h.

◆ USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED

#define USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED   0x00000800

Definition at line 178 of file ntsam.h.

◆ USER_EXECUTE

#define USER_EXECUTE
Value:

Definition at line 149 of file ntsam.h.

◆ USER_FORCE_PASSWORD_CHANGE

#define USER_FORCE_PASSWORD_CHANGE   0x00000080

Definition at line 133 of file ntsam.h.

◆ USER_HOME_DIRECTORY_REQUIRED

#define USER_HOME_DIRECTORY_REQUIRED   0x00000002

Definition at line 168 of file ntsam.h.

◆ USER_INTERDOMAIN_TRUST_ACCOUNT

#define USER_INTERDOMAIN_TRUST_ACCOUNT   0x00000040

Definition at line 173 of file ntsam.h.

◆ USER_LIST_GROUPS

#define USER_LIST_GROUPS   0x00000100

Definition at line 134 of file ntsam.h.

◆ USER_MNS_LOGON_ACCOUNT

#define USER_MNS_LOGON_ACCOUNT   0x00000020

Definition at line 172 of file ntsam.h.

◆ USER_NO_AUTH_DATA_REQUIRED

#define USER_NO_AUTH_DATA_REQUIRED   0x00080000

Definition at line 186 of file ntsam.h.

◆ USER_NORMAL_ACCOUNT

#define USER_NORMAL_ACCOUNT   0x00000010

Definition at line 171 of file ntsam.h.

◆ USER_NOT_DELEGATED

#define USER_NOT_DELEGATED   0x00004000

Definition at line 181 of file ntsam.h.

◆ USER_PARTIAL_SECRETS_ACCOUNT

#define USER_PARTIAL_SECRETS_ACCOUNT   0x00100000

Definition at line 187 of file ntsam.h.

◆ USER_PASSWORD_EXPIRED

#define USER_PASSWORD_EXPIRED   0x00020000

Definition at line 184 of file ntsam.h.

◆ USER_PASSWORD_NOT_REQUIRED

#define USER_PASSWORD_NOT_REQUIRED   0x00000004

Definition at line 169 of file ntsam.h.

◆ USER_READ

◆ USER_READ_ACCOUNT

#define USER_READ_ACCOUNT   0x00000010

Definition at line 130 of file ntsam.h.

◆ USER_READ_GENERAL

#define USER_READ_GENERAL   0x00000001

Definition at line 126 of file ntsam.h.

◆ USER_READ_GROUP_INFORMATION

#define USER_READ_GROUP_INFORMATION   0x00000200

Definition at line 135 of file ntsam.h.

◆ USER_READ_LOGON

#define USER_READ_LOGON   0x00000008

Definition at line 129 of file ntsam.h.

◆ USER_READ_PREFERENCES

#define USER_READ_PREFERENCES   0x00000002

Definition at line 127 of file ntsam.h.

◆ USER_SERVER_TRUST_ACCOUNT

#define USER_SERVER_TRUST_ACCOUNT   0x00000100

Definition at line 175 of file ntsam.h.

◆ USER_SMARTCARD_REQUIRED

#define USER_SMARTCARD_REQUIRED   0x00001000

Definition at line 179 of file ntsam.h.

◆ USER_TEMP_DUPLICATE_ACCOUNT

#define USER_TEMP_DUPLICATE_ACCOUNT   0x00000008

Definition at line 170 of file ntsam.h.

◆ USER_TRUSTED_FOR_DELEGATION

#define USER_TRUSTED_FOR_DELEGATION   0x00002000

Definition at line 180 of file ntsam.h.

◆ USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION

#define USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION   0x00040000

Definition at line 185 of file ntsam.h.

◆ USER_USE_AES_KEYS

#define USER_USE_AES_KEYS   0x00200000

Definition at line 188 of file ntsam.h.

◆ USER_USE_DES_KEY_ONLY

#define USER_USE_DES_KEY_ONLY   0x00008000

Definition at line 182 of file ntsam.h.

◆ USER_WORKSTATION_TRUST_ACCOUNT

#define USER_WORKSTATION_TRUST_ACCOUNT   0x00000080

Definition at line 174 of file ntsam.h.

◆ USER_WRITE

#define USER_WRITE
Value:

Definition at line 145 of file ntsam.h.

◆ USER_WRITE_ACCOUNT

#define USER_WRITE_ACCOUNT   0x00000020

Definition at line 131 of file ntsam.h.

◆ USER_WRITE_GROUP_INFORMATION

#define USER_WRITE_GROUP_INFORMATION   0x00000400

Definition at line 136 of file ntsam.h.

◆ USER_WRITE_PREFERENCES

#define USER_WRITE_PREFERENCES   0x00000004

Definition at line 128 of file ntsam.h.

Typedef Documentation

◆ ALIAS_ADM_COMMENT_INFORMATION

◆ ALIAS_GENERAL_INFORMATION

◆ ALIAS_INFORMATION_CLASS

◆ ALIAS_NAME_INFORMATION

◆ DOMAIN_DISPLAY_GROUP

◆ DOMAIN_DISPLAY_INFORMATION

◆ DOMAIN_DISPLAY_MACHINE

◆ DOMAIN_DISPLAY_USER

◆ DOMAIN_GENERAL_INFORMATION

◆ DOMAIN_GENERAL_INFORMATION2

◆ DOMAIN_INFORMATION_CLASS

◆ DOMAIN_LOCKOUT_INFORMATION

◆ DOMAIN_LOGOFF_INFORMATION

◆ DOMAIN_MODIFIED_INFORMATION

◆ DOMAIN_MODIFIED_INFORMATION2

◆ DOMAIN_NAME_INFORMATION

◆ DOMAIN_OEM_INFORMATION

◆ DOMAIN_PASSWORD_INFORMATION

◆ DOMAIN_REPLICATION_INFORMATION

◆ DOMAIN_SERVER_ENABLE_STATE

◆ DOMAIN_SERVER_ROLE

◆ DOMAIN_SERVER_ROLE_INFORMATION

◆ DOMAIN_STATE_INFORMATION

◆ DOMAIN_UAS_INFORMATION

◆ GROUP_ADM_COMMENT_INFORMATION

◆ GROUP_ATTRIBUTE_INFORMATION

◆ GROUP_GENERAL_INFORMATION

◆ GROUP_INFORMATION_CLASS

◆ GROUP_MEMBERSHIP

◆ GROUP_NAME_INFORMATION

◆ LOGON_HOURS

◆ PALIAS_ADM_COMMENT_INFORMATION

◆ PALIAS_GENERAL_INFORMATION

◆ PALIAS_INFORMATION_CLASS

◆ PALIAS_NAME_INFORMATION

◆ PDOMAIN_DISPLAY_GROUP

◆ PDOMAIN_DISPLAY_INFORMATION

◆ PDOMAIN_DISPLAY_MACHINE

◆ PDOMAIN_DISPLAY_USER

◆ PDOMAIN_GENERAL_INFORMATION

◆ PDOMAIN_GENERAL_INFORMATION2

◆ PDOMAIN_LOCKOUT_INFORMATION

◆ PDOMAIN_LOGOFF_INFORMATION

◆ PDOMAIN_MODIFIED_INFORMATION

◆ PDOMAIN_MODIFIED_INFORMATION2

◆ PDOMAIN_NAME_INFORMATION

◆ PDOMAIN_OEM_INFORMATION

◆ PDOMAIN_PASSWORD_INFORMATION

◆ PDOMAIN_REPLICATION_INFORMATION

◆ PDOMAIN_SERVER_ENABLE_STATE

◆ PDOMAIN_SERVER_ROLE

◆ PDOMAIN_SERVER_ROLE_INFORMATION

◆ PDOMAIN_STATE_INFORMATION

◆ PGROUP_ADM_COMMENT_INFORMATION

◆ PGROUP_ATTRIBUTE_INFORMATION

◆ PGROUP_GENERAL_INFORMATION

◆ PGROUP_MEMBERSHIP

◆ PGROUP_NAME_INFORMATION

◆ PLOGON_HOURS

◆ PSAM_ENUMERATE_HANDLE

Definition at line 263 of file ntsam.h.

◆ PSAM_HANDLE

typedef PVOID * PSAM_HANDLE

Definition at line 262 of file ntsam.h.

◆ PSAM_RID_ENUMERATION

◆ PSAM_SID_ENUMERATION

◆ PSR_SECURITY_DESCRIPTOR

◆ PUSER_ACCOUNT_INFORMATION

◆ PUSER_ACCOUNT_NAME_INFORMATION

◆ PUSER_ADMIN_COMMENT_INFORMATION

◆ PUSER_ALL_INFORMATION

◆ PUSER_CONTROL_INFORMATION

◆ PUSER_EXPIRES_INFORMATION

◆ PUSER_FULL_NAME_INFORMATION

◆ PUSER_GENERAL_INFORMATION

◆ PUSER_HOME_INFORMATION

◆ PUSER_INFORMATION_CLASS

◆ PUSER_LOGON_HOURS_INFORMATION

◆ PUSER_LOGON_INFORMATION

◆ PUSER_NAME_INFORMATION

◆ PUSER_PARAMETERS_INFORMATION

◆ PUSER_PREFERENCES_INFORMATION

◆ PUSER_PRIMARY_GROUP_INFORMATION

◆ PUSER_PROFILE_INFORMATION

◆ PUSER_PWD_CHANGE_FAILURE_INFORMATION

◆ PUSER_SCRIPT_INFORMATION

◆ PUSER_SET_PASSWORD_INFORMATION

◆ PUSER_WORKSTATIONS_INFORMATION

◆ SAM_ENUMERATE_HANDLE

Definition at line 263 of file ntsam.h.

◆ SAM_HANDLE

typedef PVOID SAM_HANDLE

Definition at line 262 of file ntsam.h.

◆ SAM_RID_ENUMERATION

◆ SAM_SID_ENUMERATION

◆ SR_SECURITY_DESCRIPTOR

◆ USER_ACCOUNT_INFORMATION

◆ USER_ACCOUNT_NAME_INFORMATION

◆ USER_ADMIN_COMMENT_INFORMATION

◆ USER_ALL_INFORMATION

◆ USER_CONTROL_INFORMATION

◆ USER_EXPIRES_INFORMATION

◆ USER_FULL_NAME_INFORMATION

◆ USER_GENERAL_INFORMATION

◆ USER_HOME_INFORMATION

◆ USER_INFORMATION_CLASS

◆ USER_LOGON_HOURS_INFORMATION

◆ USER_LOGON_INFORMATION

◆ USER_NAME_INFORMATION

◆ USER_PARAMETERS_INFORMATION

◆ USER_PREFERENCES_INFORMATION

◆ USER_PRIMARY_GROUP_INFORMATION

◆ USER_PROFILE_INFORMATION

◆ USER_PWD_CHANGE_FAILURE_INFORMATION

◆ USER_SCRIPT_INFORMATION

◆ USER_SET_PASSWORD_INFORMATION

◆ USER_WORKSTATIONS_INFORMATION

Enumeration Type Documentation

◆ _ALIAS_INFORMATION_CLASS

Enumerator
AliasGeneralInformation 
AliasNameInformation 
AliasAdminCommentInformation 
AliasGeneralInformation 
AliasNameInformation 
AliasAdminCommentInformation 

Definition at line 277 of file ntsam.h.

278{
@ AliasGeneralInformation
Definition: ntsam.h:279
@ AliasAdminCommentInformation
Definition: ntsam.h:281
@ AliasNameInformation
Definition: ntsam.h:280
enum _ALIAS_INFORMATION_CLASS * PALIAS_INFORMATION_CLASS
enum _ALIAS_INFORMATION_CLASS ALIAS_INFORMATION_CLASS

◆ _DOMAIN_DISPLAY_INFORMATION

Enumerator
DomainDisplayUser 
DomainDisplayMachine 
DomainDisplayGroup 
DomainDisplayOemUser 
DomainDisplayOemGroup 
DomainDisplayServer 
DomainDisplayUser 
DomainDisplayMachine 
DomainDisplayGroup 
DomainDisplayOemUser 
DomainDisplayOemGroup 
DomainDisplayServer 

Definition at line 301 of file ntsam.h.

302{
enum _DOMAIN_DISPLAY_INFORMATION DOMAIN_DISPLAY_INFORMATION
@ DomainDisplayUser
Definition: ntsam.h:303
@ DomainDisplayMachine
Definition: ntsam.h:304
@ DomainDisplayGroup
Definition: ntsam.h:305
@ DomainDisplayServer
Definition: ntsam.h:308
@ DomainDisplayOemUser
Definition: ntsam.h:306
@ DomainDisplayOemGroup
Definition: ntsam.h:307
enum _DOMAIN_DISPLAY_INFORMATION * PDOMAIN_DISPLAY_INFORMATION

◆ _DOMAIN_INFORMATION_CLASS

Enumerator
DomainPasswordInformation 
DomainGeneralInformation 
DomainLogoffInformation 
DomainOemInformation 
DomainNameInformation 
DomainReplicationInformation 
DomainServerRoleInformation 
DomainModifiedInformation 
DomainStateInformation 
DomainUasInformation 
DomainGeneralInformation2 
DomainLockoutInformation 
DomainModifiedInformation2 
DomainPasswordInformation 
DomainGeneralInformation 
DomainLogoffInformation 
DomainOemInformation 
DomainNameInformation 
DomainReplicationInformation 
DomainServerRoleInformation 
DomainModifiedInformation 
DomainStateInformation 
DomainGeneralInformation2 
DomainLockoutInformation 
DomainModifiedInformation2 

Definition at line 339 of file ntsam.h.

340{
@ DomainLogoffInformation
Definition: ntsam.h:343
@ DomainReplicationInformation
Definition: ntsam.h:346
@ DomainOemInformation
Definition: ntsam.h:344
@ DomainNameInformation
Definition: ntsam.h:345
@ DomainServerRoleInformation
Definition: ntsam.h:347
@ DomainUasInformation
Definition: ntsam.h:350
@ DomainPasswordInformation
Definition: ntsam.h:341
@ DomainLockoutInformation
Definition: ntsam.h:352
@ DomainModifiedInformation2
Definition: ntsam.h:353
@ DomainGeneralInformation
Definition: ntsam.h:342
@ DomainGeneralInformation2
Definition: ntsam.h:351
@ DomainStateInformation
Definition: ntsam.h:349
@ DomainModifiedInformation
Definition: ntsam.h:348
enum _DOMAIN_INFORMATION_CLASS DOMAIN_INFORMATION_CLASS

◆ _DOMAIN_SERVER_ENABLE_STATE

Enumerator
DomainServerEnabled 
DomainServerDisabled 
DomainServerEnabled 
DomainServerDisabled 

Definition at line 356 of file ntsam.h.

357{
@ DomainServerEnabled
Definition: ntsam.h:358
@ DomainServerDisabled
Definition: ntsam.h:359
enum _DOMAIN_SERVER_ENABLE_STATE DOMAIN_SERVER_ENABLE_STATE
enum _DOMAIN_SERVER_ENABLE_STATE * PDOMAIN_SERVER_ENABLE_STATE

◆ _DOMAIN_SERVER_ROLE

Enumerator
DomainServerRoleBackup 
DomainServerRolePrimary 
DomainServerRoleBackup 
DomainServerRolePrimary 

Definition at line 362 of file ntsam.h.

363{
enum _DOMAIN_SERVER_ROLE DOMAIN_SERVER_ROLE
enum _DOMAIN_SERVER_ROLE * PDOMAIN_SERVER_ROLE
@ DomainServerRolePrimary
Definition: ntsam.h:365
@ DomainServerRoleBackup
Definition: ntsam.h:364

◆ _GROUP_INFORMATION_CLASS

Enumerator
GroupGeneralInformation 
GroupNameInformation 
GroupAttributeInformation 
GroupAdminCommentInformation 
GroupReplicationInformation 
GroupGeneralInformation 
GroupNameInformation 
GroupAttributeInformation 
GroupAdminCommentInformation 
GroupReplicationInformation 

Definition at line 462 of file ntsam.h.

463{
enum _GROUP_INFORMATION_CLASS GROUP_INFORMATION_CLASS
@ GroupAttributeInformation
Definition: ntsam.h:466
@ GroupGeneralInformation
Definition: ntsam.h:464
@ GroupReplicationInformation
Definition: ntsam.h:468
@ GroupNameInformation
Definition: ntsam.h:465
@ GroupAdminCommentInformation
Definition: ntsam.h:467

◆ _USER_INFORMATION_CLASS

Enumerator
UserGeneralInformation 
UserPreferencesInformation 
UserLogonInformation 
UserLogonHoursInformation 
UserAccountInformation 
UserNameInformation 
UserAccountNameInformation 
UserFullNameInformation 
UserPrimaryGroupInformation 
UserHomeInformation 
UserScriptInformation 
UserProfileInformation 
UserAdminCommentInformation 
UserWorkStationsInformation 
UserSetPasswordInformation 
UserControlInformation 
UserExpiresInformation 
UserInternal1Information 
UserInternal2Information 
UserParametersInformation 
UserAllInformation 
UserInternal3Information 
UserInternal4Information 
UserInternal5Information 
UserInternal4InformationNew 
UserInternal5InformationNew 
UserInternal6Information 
UserExtendedInformation 
UserLogonUIInformation 
UserGeneralInformation 
UserPreferencesInformation 
UserLogonInformation 
UserLogonHoursInformation 
UserAccountInformation 
UserNameInformation 
UserAccountNameInformation 
UserFullNameInformation 
UserPrimaryGroupInformation 
UserHomeInformation 
UserScriptInformation 
UserProfileInformation 
UserAdminCommentInformation 
UserWorkStationsInformation 
UserSetPasswordInformation 
UserControlInformation 
UserExpiresInformation 
UserInternal1Information 
UserInternal2Information 
UserParametersInformation 
UserAllInformation 
UserInternal3Information 
UserInternal4Information 
UserInternal5Information 
UserInternal4InformationNew 
UserInternal5InformationNew 
UserInternal6Information 
UserExtendedInformation 
UserLogonUIInformation 

Definition at line 512 of file ntsam.h.

513{
enum _USER_INFORMATION_CLASS * PUSER_INFORMATION_CLASS
@ UserInternal3Information
Definition: ntsam.h:535
@ UserScriptInformation
Definition: ntsam.h:524
@ UserAccountNameInformation
Definition: ntsam.h:520
@ UserExtendedInformation
Definition: ntsam.h:541
@ UserPrimaryGroupInformation
Definition: ntsam.h:522
@ UserAccountInformation
Definition: ntsam.h:518
@ UserInternal1Information
Definition: ntsam.h:531
@ UserInternal6Information
Definition: ntsam.h:540
@ UserParametersInformation
Definition: ntsam.h:533
@ UserWorkStationsInformation
Definition: ntsam.h:527
@ UserInternal5InformationNew
Definition: ntsam.h:539
@ UserNameInformation
Definition: ntsam.h:519
@ UserLogonHoursInformation
Definition: ntsam.h:517
@ UserInternal4Information
Definition: ntsam.h:536
@ UserLogonInformation
Definition: ntsam.h:516
@ UserSetPasswordInformation
Definition: ntsam.h:528
@ UserGeneralInformation
Definition: ntsam.h:514
@ UserFullNameInformation
Definition: ntsam.h:521
@ UserInternal2Information
Definition: ntsam.h:532
@ UserInternal4InformationNew
Definition: ntsam.h:538
@ UserControlInformation
Definition: ntsam.h:529
@ UserAdminCommentInformation
Definition: ntsam.h:526
@ UserProfileInformation
Definition: ntsam.h:525
@ UserLogonUIInformation
Definition: ntsam.h:542
@ UserAllInformation
Definition: ntsam.h:534
@ UserExpiresInformation
Definition: ntsam.h:530
@ UserInternal5Information
Definition: ntsam.h:537
@ UserPreferencesInformation
Definition: ntsam.h:515
@ UserHomeInformation
Definition: ntsam.h:523
enum _USER_INFORMATION_CLASS USER_INFORMATION_CLASS

Function Documentation

◆ SamAddMemberToAlias()

NTSTATUS NTAPI SamAddMemberToAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID  MemberId 
)

Definition at line 235 of file samlib.c.

237{
239
240 TRACE("SamAddMemberToAlias(%p %p)\n",
241 AliasHandle, MemberId);
242
244 {
246 (PRPC_SID)MemberId);
247 }
249 {
251 }
253
254 return Status;
255}
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:24
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:771
NTSTATUS NTAPI SamrAddMemberToAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5284
#define RpcEndExcept
Definition: rpc.h:123
#define RpcTryExcept
Definition: rpc.h:121
#define RpcExcept(expr)
Definition: rpc.h:122
#define RpcExceptionCode()
Definition: rpc.h:127
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by NetLocalGroupAddMembers().

◆ SamAddMemberToGroup()

NTSTATUS NTAPI SamAddMemberToGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId,
IN ULONG  Attributes 
)

Definition at line 260 of file samlib.c.

263{
265
266 TRACE("SamAddMemberToGroup(%p %lu %lx)\n",
267 GroupHandle, MemberId, Attributes);
268
270 {
272 MemberId,
273 Attributes);
274 }
276 {
278 }
280
281 return Status;
282}
_In_ ULONG Attributes
Definition: dispmprt.h:1077
NTSTATUS NTAPI SamrAddMemberToGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4474

Referenced by NetGroupAddUser(), and NetGroupSetUsers().

◆ SamAddMultipleMembersToAlias()

NTSTATUS NTAPI SamAddMultipleMembersToAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID *  MemberIds,
IN ULONG  MemberCount 
)

Definition at line 287 of file samlib.c.

290{
293
294 TRACE("SamAddMultipleMembersToAlias(%p %p %lu)\n",
295 AliasHandle, MemberIds, MemberCount);
296
297 if (MemberIds == NULL)
299
300 Buffer.Count = MemberCount;
301 Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
302
304 {
306 &Buffer);
307 }
309 {
311 }
313
314 return Status;
315}
struct _SAMPR_SID_INFORMATION * PSAMPR_SID_INFORMATION
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:570
NTSTATUS NTAPI SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9296

◆ SamChangePasswordUser()

NTSTATUS NTAPI SamChangePasswordUser ( IN SAM_HANDLE  UserHandle,
IN PUNICODE_STRING  OldPassword,
IN PUNICODE_STRING  NewPassword 
)

Definition at line 320 of file samlib.c.

323{
324 NT_OWF_PASSWORD OldNtPassword;
325 NT_OWF_PASSWORD NewNtPassword;
326 LM_OWF_PASSWORD OldLmPassword;
327 LM_OWF_PASSWORD NewLmPassword;
328 OEM_STRING LmPwdString;
329 CHAR LmPwdBuffer[15];
330 BOOLEAN OldLmPasswordPresent = FALSE;
331 BOOLEAN NewLmPasswordPresent = FALSE;
333
334 ENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm;
335 ENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm;
336 ENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt;
337 ENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt;
338 PENCRYPTED_LM_OWF_PASSWORD pOldLmEncryptedWithNewLm = NULL;
339 PENCRYPTED_LM_OWF_PASSWORD pNewLmEncryptedWithOldLm = NULL;
340
341 /* Calculate the NT hash for the old password */
342 Status = SystemFunction007(OldPassword,
343 (LPBYTE)&OldNtPassword);
344 if (!NT_SUCCESS(Status))
345 {
346 TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
347 goto done;
348 }
349
350 /* Calculate the NT hash for the new password */
351 Status = SystemFunction007(NewPassword,
352 (LPBYTE)&NewNtPassword);
353 if (!NT_SUCCESS(Status))
354 {
355 TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
356 goto done;
357 }
358
359 /* Calculate the LM password and hash for the old password */
360 LmPwdString.Length = 15;
361 LmPwdString.MaximumLength = 15;
362 LmPwdString.Buffer = LmPwdBuffer;
363 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
364
366 OldPassword,
367 FALSE);
368 if (NT_SUCCESS(Status))
369 {
370 /* Calculate the LM hash value of the password */
371 Status = SystemFunction006(LmPwdString.Buffer,
372 (LPSTR)&OldLmPassword);
373 if (NT_SUCCESS(Status))
374 {
375 OldLmPasswordPresent = TRUE;
376 }
377 }
378
379 /* Calculate the LM password and hash for the new password */
380 LmPwdString.Length = 15;
381 LmPwdString.MaximumLength = 15;
382 LmPwdString.Buffer = LmPwdBuffer;
383 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
384
386 NewPassword,
387 FALSE);
388 if (NT_SUCCESS(Status))
389 {
390 /* Calculate the LM hash value of the password */
391 Status = SystemFunction006(LmPwdString.Buffer,
392 (LPSTR)&NewLmPassword);
393 if (NT_SUCCESS(Status))
394 {
395 NewLmPasswordPresent = TRUE;
396 }
397 }
398
399 if (OldLmPasswordPresent && NewLmPasswordPresent)
400 {
401 /* Encrypt the old LM hash with the new LM hash */
402 Status = SystemFunction012((const BYTE *)&OldLmPassword,
403 (const BYTE *)&NewLmPassword,
404 (LPBYTE)&OldLmEncryptedWithNewLm);
405 if (!NT_SUCCESS(Status))
406 {
407 TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
408 goto done;
409 }
410
411 /* Encrypt the new LM hash with the old LM hash */
412 Status = SystemFunction012((const BYTE *)&NewLmPassword,
413 (const BYTE *)&OldLmPassword,
414 (LPBYTE)&NewLmEncryptedWithOldLm);
415 if (!NT_SUCCESS(Status))
416 {
417 TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
418 goto done;
419 }
420
421 pOldLmEncryptedWithNewLm = &OldLmEncryptedWithNewLm;
422 pNewLmEncryptedWithOldLm = &NewLmEncryptedWithOldLm;
423 }
424
425 /* Encrypt the old NT hash with the new NT hash */
426 Status = SystemFunction012((const BYTE *)&OldNtPassword,
427 (const BYTE *)&NewNtPassword,
428 (LPBYTE)&OldNtEncryptedWithNewNt);
429 if (!NT_SUCCESS(Status))
430 {
431 TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
432 goto done;
433 }
434
435 /* Encrypt the new NT hash with the old NT hash */
436 Status = SystemFunction012((const BYTE *)&NewNtPassword,
437 (const BYTE *)&OldNtPassword,
438 (LPBYTE)&NewNtEncryptedWithOldNt);
439 if (!NT_SUCCESS(Status))
440 {
441 TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
442 goto done;
443 }
444
446 {
448 OldLmPasswordPresent && NewLmPasswordPresent,
449 pOldLmEncryptedWithNewLm,
450 pNewLmEncryptedWithOldLm,
451 TRUE,
452 &OldNtEncryptedWithNewNt,
453 &NewNtEncryptedWithOldNt,
454 FALSE,
455 NULL,
456 FALSE,
457 NULL);
458 }
460 {
462 }
464
465done:
466 SecureZeroMemory(&OldLmPassword, sizeof(OldLmPassword));
467 SecureZeroMemory(&NewLmPassword, sizeof(NewLmPassword));
468 SecureZeroMemory(&OldNtPassword, sizeof(OldNtPassword));
469 SecureZeroMemory(&NewNtPassword, sizeof(NewNtPassword));
470
471 return Status;
472}
unsigned char BOOLEAN
Definition: actypes.h:127
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ZeroMemory
Definition: minwinbase.h:31
NTSTATUS NTAPI SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle, IN unsigned char LmPresent, IN PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm, IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm, IN unsigned char NtPresent, IN PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt, IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt, IN unsigned char NtCrossEncryptionPresent, IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm, IN unsigned char LmCrossEncryptionPresent, IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt)
Definition: samrpc.c:7868
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
char CHAR
Definition: pedump.c:57
NTSTATUS WINAPI SystemFunction012(const BYTE *in, const BYTE *key, LPBYTE out)
Definition: sysfunc.c:353
NTSTATUS WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
Definition: crypt_lmhash.c:53
NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
unsigned char * LPBYTE
Definition: typedefs.h:53
char * LPSTR
Definition: typedefs.h:51
STRING OEM_STRING
Definition: umtypes.h:205
#define SecureZeroMemory
Definition: winbase.h:1441
unsigned char BYTE
Definition: xxhash.c:193

◆ SamChangePasswordUser2()

NTSTATUS NTAPI SamChangePasswordUser2 ( IN PUNICODE_STRING  ServerName,
IN PUNICODE_STRING  UserName,
IN PUNICODE_STRING  OldPassword,
IN PUNICODE_STRING  NewPassword 
)

Definition at line 477 of file samlib.c.

481{
484}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42

◆ SamChangePasswordUser3()

NTSTATUS NTAPI SamChangePasswordUser3 ( IN PUNICODE_STRING  ServerName,
IN PUNICODE_STRING  UserName,
IN PUNICODE_STRING  OldPassword,
IN PUNICODE_STRING  NewPassword,
OUT PDOMAIN_PASSWORD_INFORMATION *  EffectivePasswordPolicy,
OUT PUSER_PWD_CHANGE_FAILURE_INFORMATION *  PasswordChangeFailureInfo 
)

Definition at line 489 of file samlib.c.

495{
498}

◆ SamCloseHandle()

◆ SamConnect()

NTSTATUS NTAPI SamConnect ( IN OUT PUNICODE_STRING ServerName  OPTIONAL,
OUT PSAM_HANDLE  ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN POBJECT_ATTRIBUTES  ObjectAttributes 
)

Definition at line 525 of file samlib.c.

529{
530 PSAMPR_SERVER_NAME pServerName = NULL;
532
533 TRACE("SamConnect(%p %p 0x%08x %p)\n",
534 ServerName, ServerHandle, DesiredAccess, ObjectAttributes);
535
536 if (ServerName != NULL && ServerName->Length > 0 && ServerName->Buffer != NULL)
537 {
538 /* Create a zero-terminated server name */
539 pServerName = midl_user_allocate(ServerName->Length + sizeof(WCHAR));
540 if (pServerName == NULL)
542
543 CopyMemory(pServerName, ServerName->Buffer, ServerName->Length);
544 pServerName[ServerName->Length / sizeof(WCHAR)] = UNICODE_NULL;
545 }
546
548 {
549 Status = SamrConnect(pServerName,
550 (SAMPR_HANDLE *)ServerHandle,
552 }
554 {
556 }
558
559 if (pServerName)
560 midl_user_free(pServerName);
561
562 return Status;
563}
wchar_t * PSAMPR_SERVER_NAME
Definition: authpackage.c:112
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
NTSTATUS NTAPI SamrConnect(IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN ACCESS_MASK DesiredAccess)
Definition: samrpc.c:135
#define CopyMemory
Definition: minwinbase.h:29
#define UNICODE_NULL
short WCHAR
Definition: pedump.c:58
#define midl_user_free
Definition: rpc.h:41
#define midl_user_allocate
Definition: rpc.h:40
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2664

Referenced by ApplyAccountSettings(), ApplyLockoutSettings(), ApplyPasswordSettings(), NetGetDisplayInformationIndex(), NetGroupAdd(), NetGroupAddUser(), NetGroupDel(), NetGroupDelUser(), NetGroupEnum(), NetGroupGetInfo(), NetGroupGetUsers(), NetGroupSetInfo(), NetGroupSetUsers(), NetLocalGroupAdd(), NetLocalGroupAddMembers(), NetLocalGroupDel(), NetLocalGroupDelMembers(), NetLocalGroupEnum(), NetLocalGroupGetInfo(), NetLocalGroupGetMembers(), NetLocalGroupSetInfo(), NetQueryDisplayInformation(), NetUserAdd(), NetUserDel(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), NetUserSetInfo(), SetAccountsDomainSid(), and SetAdministratorPassword().

◆ SamCreateAliasInDomain()

NTSTATUS NTAPI SamCreateAliasInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  AliasHandle,
OUT PULONG  RelativeId 
)

Definition at line 568 of file samlib.c.

573{
575
576 TRACE("SamCreateAliasInDomain(%p %p 0x%08x %p %p)\n",
577 DomainHandle, AccountName, DesiredAccess, AliasHandle, RelativeId);
578
579 *AliasHandle = NULL;
580 *RelativeId = 0;
581
583 {
585 (PRPC_UNICODE_STRING)AccountName,
587 (SAMPR_HANDLE *)AliasHandle,
588 RelativeId);
589 }
591 {
593 }
595
596 return Status;
597}
NTSTATUS NTAPI SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *AliasHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:2913

Referenced by NetLocalGroupAdd().

◆ SamCreateGroupInDomain()

NTSTATUS NTAPI SamCreateGroupInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  GroupHandle,
OUT PULONG  RelativeId 
)

Definition at line 602 of file samlib.c.

607{
609
610 TRACE("SamCreateGroupInDomain(%p %p 0x%08x %p %p)\n",
611 DomainHandle, AccountName, DesiredAccess, GroupHandle, RelativeId);
612
613 *GroupHandle = NULL;
614 *RelativeId = 0;
615
617 {
619 (PRPC_UNICODE_STRING)AccountName,
621 (SAMPR_HANDLE *)GroupHandle,
622 RelativeId);
623 }
625 {
627 }
629
630 return Status;
631}
NTSTATUS NTAPI SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *GroupHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:1898

Referenced by NetGroupAdd().

◆ SamCreateUser2InDomain()

NTSTATUS NTAPI SamCreateUser2InDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ULONG  AccountType,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  UserHandle,
OUT PULONG  GrantedAccess,
OUT PULONG  RelativeId 
)

Definition at line 636 of file samlib.c.

643{
645
646 TRACE("SamCreateUser2InDomain(%p %p %lu 0x%08x %p %p %p)\n",
647 DomainHandle, AccountName, AccountType, DesiredAccess,
648 UserHandle, GrantedAccess, RelativeId);
649
650 *UserHandle = NULL;
651 *RelativeId = 0;
652
654 {
656 (PRPC_UNICODE_STRING)AccountName,
657 AccountType,
659 (SAMPR_HANDLE *)UserHandle,
661 RelativeId);
662
663 }
665 {
667 }
669
670 return Status;
671}
NTSTATUS NTAPI SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN unsigned long AccountType, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *UserHandle, OUT unsigned long *GrantedAccess, OUT unsigned long *RelativeId)
Definition: samrpc.c:8829
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:20

Referenced by NetUserAdd().

◆ SamCreateUserInDomain()

NTSTATUS NTAPI SamCreateUserInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  UserHandle,
OUT PULONG  RelativeId 
)

Definition at line 676 of file samlib.c.

681{
683
684 TRACE("SamCreateUserInDomain(%p %p 0x%08x %p %p)\n",
685 DomainHandle, AccountName, DesiredAccess, UserHandle, RelativeId);
686
687 *UserHandle = NULL;
688 *RelativeId = 0;
689
691 {
693 (PRPC_UNICODE_STRING)AccountName,
695 (SAMPR_HANDLE *)UserHandle,
696 RelativeId);
697 }
699 {
701 }
703
704 return Status;
705}
NTSTATUS NTAPI SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *UserHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:2300

◆ SamDeleteAlias()

NTSTATUS NTAPI SamDeleteAlias ( IN SAM_HANDLE  AliasHandle)

Definition at line 710 of file samlib.c.

711{
712 SAMPR_HANDLE LocalAliasHandle;
714
715 TRACE("SamDeleteAlias(%p)\n", AliasHandle);
716
717 LocalAliasHandle = (SAMPR_HANDLE)AliasHandle;
718
719 if (LocalAliasHandle == NULL)
721
723 {
724 Status = SamrDeleteAlias(&LocalAliasHandle);
725 }
727 {
729 }
731
732 return Status;
733}
void * SAMPR_HANDLE
Definition: authpackage.c:113
#define STATUS_INVALID_HANDLE
Definition: d3dkmdt.h:40
NTSTATUS NTAPI SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:5226

Referenced by NetLocalGroupAdd(), and NetLocalGroupDel().

◆ SamDeleteGroup()

NTSTATUS NTAPI SamDeleteGroup ( IN SAM_HANDLE  GroupHandle)

Definition at line 738 of file samlib.c.

739{
740 SAMPR_HANDLE LocalGroupHandle;
742
743 TRACE("SamDeleteGroup(%p)\n", GroupHandle);
744
745 LocalGroupHandle = (SAMPR_HANDLE)GroupHandle;
746
747 if (LocalGroupHandle == NULL)
749
751 {
752 Status = SamrDeleteGroup(&LocalGroupHandle);
753 }
755 {
757 }
759
760 return Status;
761}
NTSTATUS NTAPI SamrDeleteGroup(IN OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:4538

Referenced by NetGroupAdd(), and NetGroupDel().

◆ SamDeleteUser()

NTSTATUS NTAPI SamDeleteUser ( IN SAM_HANDLE  UserHandle)

Definition at line 766 of file samlib.c.

767{
768 SAMPR_HANDLE LocalUserHandle;
770
771 TRACE("SamDeleteUser(%p)\n", UserHandle);
772
773 LocalUserHandle = (SAMPR_HANDLE)UserHandle;
774
775 if (LocalUserHandle == NULL)
777
779 {
780 Status = SamrDeleteUser(&LocalUserHandle);
781 }
783 {
785 }
787
788 return Status;
789}
NTSTATUS NTAPI SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle)
Definition: samrpc.c:5486

Referenced by NetUserAdd(), and NetUserDel().

◆ SamEnumerateAliasesInDomain()

NTSTATUS NTAPI SamEnumerateAliasesInDomain ( IN SAM_HANDLE  DomainHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
OUT PVOID *  Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 794 of file samlib.c.

799{
800 PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
802
803 TRACE("SamEnumerateAliasesInDomain(%p %p %p %lu %p)\n",
804 DomainHandle, EnumerationContext, Buffer, PreferedMaximumLength,
805 CountReturned);
806
807 if ((EnumerationContext == NULL) ||
808 (Buffer == NULL) ||
809 (CountReturned == NULL))
811
812 *Buffer = NULL;
813
815 {
817 EnumerationContext,
818 &EnumBuffer,
819 PreferedMaximumLength,
820 CountReturned);
821
822 if (EnumBuffer != NULL)
823 {
824 if (EnumBuffer->Buffer != NULL)
825 {
826 *Buffer = EnumBuffer->Buffer;
827 }
828
829 midl_user_free(EnumBuffer);
830 }
831 }
833 {
835 }
837
838 return Status;
839}
NTSTATUS NTAPI SamrEnumerateAliasesInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:3089
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by NetLocalGroupEnum().

◆ SamEnumerateDomainsInSamServer()

NTSTATUS NTAPI SamEnumerateDomainsInSamServer ( IN SAM_HANDLE  ServerHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
OUT PVOID *  Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 844 of file samlib.c.

849{
850 PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
852
853 TRACE("SamEnumerateDomainsInSamServer(%p %p %p %lu %p)\n",
854 ServerHandle, EnumerationContext, Buffer, PreferedMaximumLength,
855 CountReturned);
856
857 if ((EnumerationContext == NULL) ||
858 (Buffer == NULL) ||
859 (CountReturned == NULL))
861
862 *Buffer = NULL;
863
865 {
867 EnumerationContext,
868 &EnumBuffer,
869 PreferedMaximumLength,
870 CountReturned);
871
872 if (EnumBuffer != NULL)
873 {
874 if (EnumBuffer->Buffer != NULL)
875 {
876 *Buffer = EnumBuffer->Buffer;
877 }
878
879 midl_user_free(EnumBuffer);
880 }
881 }
883 {
885 }
887
888 return Status;
889}
NTSTATUS NTAPI SamrEnumerateDomainsInSamServer(IN SAMPR_HANDLE ServerHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samrpc.c:621

◆ SamEnumerateGroupsInDomain()

NTSTATUS NTAPI SamEnumerateGroupsInDomain ( IN SAM_HANDLE  DomainHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
IN PVOID *  Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 894 of file samlib.c.

899{
900 PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
902
903 TRACE("SamEnumerateGroupsInDomain(%p %p %p %lu %p)\n",
904 DomainHandle, EnumerationContext, Buffer,
905 PreferedMaximumLength, CountReturned);
906
907 if (EnumerationContext == NULL || Buffer == NULL || CountReturned == NULL)
909
910 *Buffer = NULL;
911
913 {
915 EnumerationContext,
916 &EnumBuffer,
917 PreferedMaximumLength,
918 CountReturned);
919 if (EnumBuffer != NULL)
920 {
921 if (EnumBuffer->Buffer != NULL)
922 *Buffer = EnumBuffer->Buffer;
923
924 midl_user_free(EnumBuffer);
925 }
926 }
928 {
930 }
932
933 return Status;
934}
NTSTATUS NTAPI SamrEnumerateGroupsInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:2092

Referenced by NetGroupEnum().

◆ SamEnumerateUsersInDomain()

NTSTATUS NTAPI SamEnumerateUsersInDomain ( IN SAM_HANDLE  DomainHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
IN ULONG  UserAccountControl,
OUT PVOID *  Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 939 of file samlib.c.

945{
946 PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
948
949 TRACE("SamEnumerateUsersInDomain(%p %p %lx %p %lu %p)\n",
950 DomainHandle, EnumerationContext, UserAccountControl, Buffer,
951 PreferedMaximumLength, CountReturned);
952
953 if (EnumerationContext == NULL || Buffer == NULL || CountReturned == NULL)
955
956 *Buffer = NULL;
957
959 {
961 EnumerationContext,
962 UserAccountControl,
963 &EnumBuffer,
964 PreferedMaximumLength,
965 CountReturned);
966 if (EnumBuffer != NULL)
967 {
968 if (EnumBuffer->Buffer != NULL)
969 {
970 *Buffer = EnumBuffer->Buffer;
971 }
972
973 midl_user_free(EnumBuffer);
974 }
975
976 }
978 {
980 }
982
983 return Status;
984}
NTSTATUS NTAPI SamrEnumerateUsersInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, IN unsigned long UserAccountControl, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:2704

Referenced by NetUserEnum().

◆ SamFreeMemory()

◆ SamGetAliasMembership()

NTSTATUS NTAPI SamGetAliasMembership ( IN SAM_HANDLE  DomainHandle,
IN ULONG  PassedCount,
IN PSID *  Sids,
OUT PULONG  MembershipCount,
OUT PULONG *  Aliases 
)

Definition at line 1000 of file samlib.c.

1005{
1006 SAMPR_PSID_ARRAY SidArray;
1007 SAMPR_ULONG_ARRAY Membership;
1009
1010 TRACE("SamAliasMembership(%p %lu %p %p %p)\n",
1011 DomainHandle, PassedCount, Sids, MembershipCount, Aliases);
1012
1013 if (Sids == NULL ||
1014 MembershipCount == NULL ||
1015 Aliases == NULL)
1017
1018 Membership.Element = NULL;
1019
1021 {
1022 SidArray.Count = PassedCount;
1023 SidArray.Sids = (PSAMPR_SID_INFORMATION)Sids;
1024
1026 &SidArray,
1027 &Membership);
1028 if (NT_SUCCESS(Status))
1029 {
1030 *MembershipCount = Membership.Count;
1031 *Aliases = Membership.Element;
1032 }
1033 else
1034 {
1035 if (Membership.Element != NULL)
1036 midl_user_free(Membership.Element);
1037 }
1038 }
1040 {
1042 }
1044
1045 return Status;
1046}
NTSTATUS __stdcall SamrGetAliasMembership(SAMPR_HANDLE DomainHandle, PSAMPR_PSID_ARRAY SidArray, PSAMPR_ULONG_ARRAY Membership)
unsigned long Count
Definition: authpackage.c:122
PSAMPR_SID_INFORMATION Sids
Definition: authpackage.c:123
unsigned long * Element
Definition: lsasrv.h:88
unsigned long Count
Definition: lsasrv.h:87

Referenced by GetUserPrivileges(), and NetUserGetLocalGroups().

◆ SamGetCompatibilityMode()

NTSTATUS NTAPI SamGetCompatibilityMode ( IN SAM_HANDLE  ObjectHandle,
OUT PULONG  Mode 
)

Definition at line 1051 of file samlib.c.

1053{
1054 TRACE("SamGetCompatibilityMode(%p %p)\n", ObjectHandle, Mode);
1055
1056 if (Mode == NULL)
1058
1060
1061 return STATUS_SUCCESS;
1062}
_In_ ULONG Mode
Definition: hubbusif.h:303
#define SAM_SID_COMPATIBILITY_ALL
Definition: ntsam.h:728

◆ SamGetDisplayEnumerationIndex()

NTSTATUS NTAPI SamGetDisplayEnumerationIndex ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_DISPLAY_INFORMATION  DisplayInformation,
IN PUNICODE_STRING  Prefix,
OUT PULONG  Index 
)

Definition at line 1067 of file samlib.c.

1071{
1073
1074 TRACE("SamGetDisplayEnumerationIndex(%p %lu %wZ %p)\n",
1075 DomainHandle, DisplayInformation, Prefix, Index);
1076
1077 if ((Prefix == NULL) ||
1078 (Index == NULL))
1080
1082 {
1084 DisplayInformation,
1086 Index);
1087 }
1089 {
1091 }
1093
1094 return Status;
1095}
NTSTATUS NTAPI SamrGetDisplayEnumerationIndex2(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN PRPC_UNICODE_STRING Prefix, OUT unsigned long *Index)
Definition: samrpc.c:8813
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1647

Referenced by NetGetDisplayInformationIndex().

◆ SamGetGroupsForUser()

NTSTATUS NTAPI SamGetGroupsForUser ( IN SAM_HANDLE  UserHandle,
OUT PGROUP_MEMBERSHIP *  Groups,
OUT PULONG  MembershipCount 
)

Definition at line 1100 of file samlib.c.

1103{
1104 PSAMPR_GET_GROUPS_BUFFER GroupsBuffer = NULL;
1106
1107 TRACE("SamGetGroupsForUser(%p %p %p)\n",
1108 UserHandle, Groups, MembershipCount);
1109
1111 {
1113 &GroupsBuffer);
1114 if (NT_SUCCESS(Status))
1115 {
1116 *Groups = GroupsBuffer->Groups;
1117 *MembershipCount = GroupsBuffer->MembershipCount;
1118
1119 MIDL_user_free(GroupsBuffer);
1120 }
1121 else
1122 {
1123 if (GroupsBuffer != NULL)
1124 {
1125 if (GroupsBuffer->Groups != NULL)
1126 MIDL_user_free(GroupsBuffer->Groups);
1127
1128 MIDL_user_free(GroupsBuffer);
1129 }
1130 }
1131 }
1133 {
1135 }
1137
1138 return Status;
1139}
void __RPC_USER MIDL_user_free(void __RPC_FAR *ptr)
Definition: dhcpcsvc.c:31
NTSTATUS NTAPI SamrGetGroupsForUser(IN SAMPR_HANDLE UserHandle, OUT PSAMPR_GET_GROUPS_BUFFER *Groups)
Definition: samrpc.c:8149
unsigned long MembershipCount
Definition: sam.idl:115
PGROUP_MEMBERSHIP Groups
Definition: sam.idl:116

Referenced by GetUserPrivileges(), and NetUserGetGroups().

◆ SamGetMembersInAlias()

NTSTATUS NTAPI SamGetMembersInAlias ( IN SAM_HANDLE  AliasHandle,
OUT PSID **  MemberIds,
OUT PULONG  MemberCount 
)

Definition at line 1144 of file samlib.c.

1147{
1148 SAMPR_PSID_ARRAY_OUT SidArray;
1150
1151 TRACE("SamGetMembersInAlias(%p %p %p)\n",
1152 AliasHandle, MemberIds, MemberCount);
1153
1154 if ((MemberIds == NULL) ||
1155 (MemberCount == NULL))
1157
1158 *MemberIds = NULL;
1159 *MemberCount = 0;
1160
1161 SidArray.Sids = NULL;
1162
1164 {
1166 &SidArray);
1167 if (NT_SUCCESS(Status))
1168 {
1169 *MemberCount = SidArray.Count;
1170 *MemberIds = (PSID *)SidArray.Sids;
1171 }
1172
1173 }
1175 {
1177 }
1179
1180 return Status;
1181}
NTSTATUS NTAPI SamrGetMembersInAlias(IN SAMPR_HANDLE AliasHandle, OUT PSAMPR_PSID_ARRAY_OUT Members)
Definition: samrpc.c:5364
PSAMPR_SID_INFORMATION Sids
Definition: sam.idl:56
unsigned long Count
Definition: sam.idl:55

Referenced by NetLocalGroupGetMembers().

◆ SamGetMembersInGroup()

NTSTATUS NTAPI SamGetMembersInGroup ( IN SAM_HANDLE  GroupHandle,
OUT PULONG *  MemberIds,
OUT PULONG *  Attributes,
OUT PULONG  MemberCount 
)

Definition at line 1186 of file samlib.c.

1190{
1191 PSAMPR_GET_MEMBERS_BUFFER MembersBuffer = NULL;
1193
1194 TRACE("SamGetMembersInGroup(%p %p %p %p)\n",
1195 GroupHandle, MemberIds, Attributes, MemberCount);
1196
1198 {
1200 &MembersBuffer);
1201 if (NT_SUCCESS(Status))
1202 {
1203 *MemberIds = MembersBuffer->Members;
1204 *Attributes = MembersBuffer->Attributes;
1205 *MemberCount = MembersBuffer->MemberCount;
1206
1207 MIDL_user_free(MembersBuffer);
1208 }
1209 else
1210 {
1211 if (MembersBuffer != NULL)
1212 {
1213 if (MembersBuffer->Members != NULL)
1214 MIDL_user_free(MembersBuffer->Members);
1215
1216 if (MembersBuffer->Attributes != NULL)
1217 MIDL_user_free(MembersBuffer->Attributes);
1218
1219 MIDL_user_free(MembersBuffer);
1220 }
1221 }
1222 }
1224 {
1226 }
1228
1229 return Status;
1230}
NTSTATUS NTAPI SamrGetMembersInGroup(IN SAMPR_HANDLE GroupHandle, OUT PSAMPR_GET_MEMBERS_BUFFER *Members)
Definition: samrpc.c:4668
unsigned long * Members
Definition: sam.idl:122
unsigned long MemberCount
Definition: sam.idl:121
unsigned long * Attributes
Definition: sam.idl:123

Referenced by NetGroupGetUsers(), and NetGroupSetUsers().

◆ SamLookupDomainInSamServer()

NTSTATUS NTAPI SamLookupDomainInSamServer ( IN SAM_HANDLE  ServerHandle,
IN PUNICODE_STRING  Name,
OUT PSID *  DomainId 
)

Definition at line 1235 of file samlib.c.

1238{
1240
1241 TRACE("SamLookupDomainInSamServer(%p %p %p)\n",
1242 ServerHandle, Name, DomainId);
1243
1245 {
1248 (PRPC_SID *)DomainId);
1249 }
1251 {
1253 }
1255
1256 return Status;
1257}
LPWSTR Name
Definition: desk.c:124
NTSTATUS NTAPI SamrLookupDomainInSamServer(IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
Definition: samrpc.c:504

◆ SamLookupIdsInDomain()

NTSTATUS NTAPI SamLookupIdsInDomain ( IN SAM_HANDLE  DomainHandle,
IN ULONG  Count,
IN PULONG  RelativeIds,
OUT PUNICODE_STRING *  Names,
OUT PSID_NAME_USE *Use  OPTIONAL 
)

Definition at line 1262 of file samlib.c.

1267{
1268 SAMPR_RETURNED_USTRING_ARRAY NamesBuffer = {0, NULL};
1269 SAMPR_ULONG_ARRAY UseBuffer = {0, NULL};
1270 ULONG i;
1272
1273 TRACE("SamLookupIdsInDomain(%p %lu %p %p %p)\n",
1274 DomainHandle, Count, RelativeIds, Names, Use);
1275
1276 *Names = NULL;
1277
1278 if (Use != NULL)
1279 *Use = NULL;
1280
1282 {
1284 Count,
1285 RelativeIds,
1286 &NamesBuffer,
1287 &UseBuffer);
1288 }
1290 {
1292 }
1294
1295 if (NT_SUCCESS(Status))
1296 {
1298 if (*Names == NULL)
1299 {
1301 goto done;
1302 }
1303
1304 for (i = 0; i < Count; i++)
1305 {
1306 (*Names)[i].Buffer = midl_user_allocate(NamesBuffer.Element[i].MaximumLength);
1307 if ((*Names)[i].Buffer == NULL)
1308 {
1310 goto done;
1311 }
1312 }
1313
1314 for (i = 0; i < Count; i++)
1315 {
1316 (*Names)[i].Length = NamesBuffer.Element[i].Length;
1317 (*Names)[i].MaximumLength = NamesBuffer.Element[i].MaximumLength;
1318
1320 NamesBuffer.Element[i].Buffer,
1321 NamesBuffer.Element[i].Length);
1322 }
1323
1324 if (Use != NULL)
1325 {
1326 *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
1327 if (*Use == NULL)
1328 {
1330 goto done;
1331 }
1332
1333 RtlCopyMemory(*Use,
1334 UseBuffer.Element,
1335 Count * sizeof(SID_NAME_USE));
1336 }
1337 }
1338
1339done:
1340 if (!NT_SUCCESS(Status))
1341 {
1342 if (*Names != NULL)
1343 {
1344 for (i = 0; i < Count; i++)
1345 {
1346 if ((*Names)[i].Buffer != NULL)
1348 }
1349
1351 }
1352
1353 if (Use != NULL && *Use != NULL)
1354 midl_user_free(*Use);
1355 }
1356
1357 if (NamesBuffer.Element != NULL)
1358 {
1359 for (i = 0; i < NamesBuffer.Count; i++)
1360 {
1361 if (NamesBuffer.Element[i].Buffer != NULL)
1362 midl_user_free(NamesBuffer.Element[i].Buffer);
1363 }
1364
1365 midl_user_free(NamesBuffer.Element);
1366 }
1367
1368 if (UseBuffer.Element != NULL)
1369 midl_user_free(UseBuffer.Element);
1370
1371 return 0;
1372}
PWSTR Names[]
NTSTATUS NTAPI SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle, IN ULONG Count, IN ULONG *RelativeIds, OUT PSAMPR_RETURNED_USTRING_ARRAY Names, OUT PSAMPR_ULONG_ARRAY Use)
Definition: samrpc.c:3697
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
enum _SID_NAME_USE SID_NAME_USE
unsigned short Length
Definition: msv1_0.h:22
unsigned short MaximumLength
Definition: msv1_0.h:23
wchar_t * Buffer
Definition: msv1_0.h:24
PRPC_UNICODE_STRING Element
Definition: lookup.c:22
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
USHORT Count
Definition: userreq.cpp:200

Referenced by NetGroupGetUsers(), and NetUserGetLocalGroups().

◆ SamLookupNamesInDomain()

NTSTATUS NTAPI SamLookupNamesInDomain ( IN SAM_HANDLE  DomainHandle,
IN ULONG  Count,
IN PUNICODE_STRING  Names,
OUT PULONG *  RelativeIds,
OUT PSID_NAME_USE *  Use 
)

Definition at line 1377 of file samlib.c.

1382{
1383 SAMPR_ULONG_ARRAY RidBuffer = {0, NULL};
1384 SAMPR_ULONG_ARRAY UseBuffer = {0, NULL};
1386
1387 TRACE("SamLookupNamesInDomain(%p %lu %p %p %p)\n",
1388 DomainHandle, Count, Names, RelativeIds, Use);
1389
1390 *RelativeIds = NULL;
1391 *Use = NULL;
1392
1394 {
1396 Count,
1398 &RidBuffer,
1399 &UseBuffer);
1400 }
1402 {
1404 }
1406
1407 if (NT_SUCCESS(Status))
1408 {
1409 *RelativeIds = midl_user_allocate(Count * sizeof(ULONG));
1410 if (*RelativeIds == NULL)
1411 {
1413 goto done;
1414 }
1415
1416 *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
1417 if (*Use == NULL)
1418 {
1420 goto done;
1421 }
1422
1423 RtlCopyMemory(*RelativeIds,
1424 RidBuffer.Element,
1425 Count * sizeof(ULONG));
1426
1427 RtlCopyMemory(*Use,
1428 UseBuffer.Element,
1429 Count * sizeof(SID_NAME_USE));
1430 }
1431
1432done:
1433 if (!NT_SUCCESS(Status))
1434 {
1435 if (*RelativeIds != NULL)
1436 midl_user_free(*RelativeIds);
1437
1438 if (*Use != NULL)
1439 midl_user_free(*Use);
1440 }
1441
1442 if (RidBuffer.Element != NULL)
1443 midl_user_free(RidBuffer.Element);
1444
1445 if (UseBuffer.Element != NULL)
1446 midl_user_free(UseBuffer.Element);
1447
1448 return Status;
1449}
NTSTATUS NTAPI SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle, IN ULONG Count, IN RPC_UNICODE_STRING Names[], OUT PSAMPR_ULONG_ARRAY RelativeIds, OUT PSAMPR_ULONG_ARRAY Use)
Definition: samrpc.c:3468

Referenced by NetGroupAddUser(), NetGroupDelUser(), NetGroupSetUsers(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), OpenAliasByName(), OpenGroupByName(), and OpenUserByName().

◆ SamOpenAlias()

NTSTATUS NTAPI SamOpenAlias ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  AliasId,
OUT PSAM_HANDLE  AliasHandle 
)

Definition at line 1454 of file samlib.c.

1458{
1460
1461 TRACE("SamOpenAlias(%p 0x%08x %lx %p)\n",
1462 DomainHandle, DesiredAccess, AliasId, AliasHandle);
1463
1465 {
1466 Status = SamrOpenAlias((SAMPR_HANDLE)DomainHandle,
1468 AliasId,
1469 (SAMPR_HANDLE *)AliasHandle);
1470 }
1472 {
1474 }
1476
1477 return Status;
1478}
NTSTATUS NTAPI SamrOpenAlias(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:4825

Referenced by NetLocalGroupEnum(), and OpenAliasByName().

◆ SamOpenDomain()

NTSTATUS NTAPI SamOpenDomain ( IN SAM_HANDLE  ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN PSID  DomainId,
OUT PSAM_HANDLE  DomainHandle 
)

Definition at line 1483 of file samlib.c.

1487{
1489
1490 TRACE("SamOpenDomain(%p 0x%08x %p %p)\n",
1491 ServerHandle, DesiredAccess, DomainId, DomainHandle);
1492
1494 {
1495 Status = SamrOpenDomain((SAMPR_HANDLE)ServerHandle,
1497 (PRPC_SID)DomainId,
1498 (SAMPR_HANDLE *)DomainHandle);
1499 }
1501 {
1503 }
1505
1506 return Status;
1507}
NTSTATUS __stdcall SamrOpenDomain(SAMPR_HANDLE ServerHandle, ACCESS_MASK DesiredAccess, PRPC_SID DomainId, SAMPR_HANDLE *DomainHandle)

Referenced by ApplyAccountSettings(), ApplyLockoutSettings(), ApplyPasswordSettings(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), OpenAccountDomain(), OpenBuiltinDomain(), SetAccountsDomainSid(), and SetAdministratorPassword().

◆ SamOpenGroup()

NTSTATUS NTAPI SamOpenGroup ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  GroupId,
OUT PSAM_HANDLE  GroupHandle 
)

Definition at line 1512 of file samlib.c.

1516{
1518
1519 TRACE("SamOpenGroup(%p 0x%08x %p %p)\n",
1520 DomainHandle, DesiredAccess, GroupId, GroupHandle);
1521
1523 {
1524 Status = SamrOpenGroup((SAMPR_HANDLE)DomainHandle,
1526 GroupId,
1527 (SAMPR_HANDLE *)GroupHandle);
1528 }
1530 {
1532 }
1534
1535 return Status;
1536}
NTSTATUS NTAPI SamrOpenGroup(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN unsigned long GroupId, OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:3982

Referenced by NetGroupEnum(), and OpenGroupByName().

◆ SamOpenUser()

NTSTATUS NTAPI SamOpenUser ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  UserId,
OUT PSAM_HANDLE  UserHandle 
)

Definition at line 1541 of file samlib.c.

1545{
1547
1548 TRACE("SamOpenUser(%p 0x%08x %lx %p)\n",
1549 DomainHandle, DesiredAccess, UserId, UserHandle);
1550
1552 {
1553 Status = SamrOpenUser((SAMPR_HANDLE)DomainHandle,
1555 UserId,
1556 (SAMPR_HANDLE *)UserHandle);
1557 }
1559 {
1561 }
1563
1564 return Status;
1565}
NTSTATUS NTAPI SamrOpenUser(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT SAMPR_HANDLE *UserHandle)

Referenced by EnableAccount(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), OpenUserByName(), SetAdministratorPassword(), and SetNewAccountName().

◆ SamQueryDisplayInformation()

NTSTATUS NTAPI SamQueryDisplayInformation ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_DISPLAY_INFORMATION  DisplayInformation,
IN ULONG  Index,
IN ULONG  EntryCount,
IN ULONG  PreferredMaximumLength,
OUT PULONG  TotalAvailable,
OUT PULONG  TotalReturned,
OUT PULONG  ReturnedEntryCount,
OUT PVOID *  SortedBuffer 
)

Definition at line 1570 of file samlib.c.

1579{
1580 SAMPR_DISPLAY_INFO_BUFFER LocalBuffer;
1582
1583 TRACE("SamQueryDisplayInformation(%p %lu %lu %lu %lu %p %p %p %p)\n",
1584 DomainHandle, DisplayInformation, Index, EntryCount,
1585 PreferredMaximumLength, TotalAvailable, TotalReturned,
1586 ReturnedEntryCount, SortedBuffer);
1587
1588 if ((TotalAvailable == NULL) ||
1589 (TotalReturned == NULL) ||
1590 (ReturnedEntryCount == NULL) ||
1591 (SortedBuffer == NULL))
1593
1595 {
1597 DisplayInformation,
1598 Index,
1599 EntryCount,
1600 PreferredMaximumLength,
1601 TotalAvailable,
1602 TotalReturned,
1603 &LocalBuffer);
1604 if (NT_SUCCESS(Status))
1605 {
1606 switch (DisplayInformation)
1607 {
1608 case DomainDisplayUser:
1609 *ReturnedEntryCount = LocalBuffer.UserInformation.EntriesRead;
1610 *SortedBuffer = LocalBuffer.UserInformation.Buffer;
1611 break;
1612
1614 *ReturnedEntryCount = LocalBuffer.MachineInformation.EntriesRead;
1615 *SortedBuffer = LocalBuffer.MachineInformation.Buffer;
1616 break;
1617
1618 case DomainDisplayGroup:
1619 *ReturnedEntryCount = LocalBuffer.GroupInformation.EntriesRead;
1620 *SortedBuffer = LocalBuffer.GroupInformation.Buffer;
1621 break;
1622
1624 *ReturnedEntryCount = LocalBuffer.OemUserInformation.EntriesRead;
1625 *SortedBuffer = LocalBuffer.OemUserInformation.Buffer;
1626 break;
1627
1629 *ReturnedEntryCount = LocalBuffer.OemGroupInformation.EntriesRead;
1630 *SortedBuffer = LocalBuffer.OemGroupInformation.Buffer;
1631 break;
1632
1634 /* FIXME */
1635 break;
1636 }
1637 }
1638 else
1639 {
1640 *ReturnedEntryCount = 0;
1641 *SortedBuffer = NULL;
1642 }
1643 }
1645 {
1647 }
1649
1650 return Status;
1651}
NTSTATUS NTAPI SamrQueryDisplayInformation3(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN unsigned long Index, IN unsigned long EntryCount, IN unsigned long PreferredMaximumLength, OUT unsigned long *TotalAvailable, OUT unsigned long *TotalReturned, OUT PSAMPR_DISPLAY_INFO_BUFFER Buffer)
Definition: samrpc.c:9244
PSAMPR_DOMAIN_DISPLAY_GROUP Buffer
Definition: sam.idl:348
PSAMPR_DOMAIN_DISPLAY_MACHINE Buffer
Definition: sam.idl:342
PSAMPR_DOMAIN_DISPLAY_OEM_GROUP Buffer
Definition: sam.idl:360
PSAMPR_DOMAIN_DISPLAY_OEM_USER Buffer
Definition: sam.idl:354
PSAMPR_DOMAIN_DISPLAY_USER Buffer
Definition: sam.idl:336
SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER OemGroupInformation
Definition: sam.idl:369
SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER OemUserInformation
Definition: sam.idl:368
SAMPR_DOMAIN_DISPLAY_USER_BUFFER UserInformation
Definition: sam.idl:365
SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER MachineInformation
Definition: sam.idl:366
SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER GroupInformation
Definition: sam.idl:367

Referenced by NetQueryDisplayInformation().

◆ SamQueryInformationAlias()

NTSTATUS NTAPI SamQueryInformationAlias ( IN SAM_HANDLE  AliasHandle,
IN ALIAS_INFORMATION_CLASS  AliasInformationClass,
OUT PVOID *  Buffer 
)

Definition at line 1656 of file samlib.c.

1659{
1661
1662 TRACE("SamQueryInformationAlias(%p %lu %p)\n",
1663 AliasHandle, AliasInformationClass, Buffer);
1664
1666 {
1668 AliasInformationClass,
1670 }
1672 {
1674 }
1676
1677 return Status;
1678}
NTSTATUS NTAPI SamrQueryInformationAlias(IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PSAMPR_ALIAS_INFO_BUFFER *Buffer)
Definition: samrpc.c:5048

Referenced by NetLocalGroupEnum(), and NetLocalGroupGetInfo().

◆ SamQueryInformationDomain()

NTSTATUS NTAPI SamQueryInformationDomain ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_INFORMATION_CLASS  DomainInformationClass,
OUT PVOID *  Buffer 
)

Definition at line 1683 of file samlib.c.

1686{
1688
1689 TRACE("SamQueryInformationDomain(%p %lu %p)\n",
1690 DomainHandle, DomainInformationClass, Buffer);
1691
1693 {
1695 DomainInformationClass,
1697 }
1699 {
1701 }
1703
1704 return Status;
1705}
NTSTATUS NTAPI SamrQueryInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
Definition: samrpc.c:1619

Referenced by ApplyLockoutSettings(), ApplyPasswordSettings(), and NetUserModalsGet().

◆ SamQueryInformationGroup()

NTSTATUS NTAPI SamQueryInformationGroup ( IN SAM_HANDLE  GroupHandle,
IN GROUP_INFORMATION_CLASS  GroupInformationClass,
OUT PVOID *  Buffer 
)

Definition at line 1710 of file samlib.c.

1713{
1715
1716 TRACE("SamQueryInformationGroup(%p %lu %p)\n",
1717 GroupHandle, GroupInformationClass, Buffer);
1718
1720 {
1722 GroupInformationClass,
1724 }
1726 {
1728 }
1730
1731 return Status;
1732}
NTSTATUS NTAPI SamrQueryInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PSAMPR_GROUP_INFO_BUFFER *Buffer)
Definition: samrpc.c:4256

Referenced by NetGroupEnum(), and NetGroupGetInfo().

◆ SamQueryInformationUser()

NTSTATUS NTAPI SamQueryInformationUser ( IN SAM_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
OUT PVOID *  Buffer 
)

Definition at line 1737 of file samlib.c.

1740{
1742
1743 TRACE("SamQueryInformationUser(%p %lu %p)\n",
1744 UserHandle, UserInformationClass, Buffer);
1745
1747 {
1749 UserInformationClass,
1751 }
1753 {
1755 }
1757
1758 return Status;
1759}
NTSTATUS NTAPI SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
Definition: samrpc.c:7238

Referenced by BuildUserInfoBuffer(), EnableAccount(), and SetAdministratorPassword().

◆ SamQuerySecurityObject()

NTSTATUS NTAPI SamQuerySecurityObject ( IN SAM_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
OUT PSECURITY_DESCRIPTOR *  SecurityDescriptor 
)

Definition at line 1764 of file samlib.c.

1767{
1768 PSAMPR_SR_SECURITY_DESCRIPTOR SamSecurityDescriptor = NULL;
1770
1771 TRACE("SamQuerySecurityObject(%p %lu %p)\n",
1773
1775
1777 {
1780 &SamSecurityDescriptor);
1781 }
1783 {
1785 }
1787
1788 TRACE("SamSecurityDescriptor: %p\n", SamSecurityDescriptor);
1789
1790 if (SamSecurityDescriptor != NULL)
1791 {
1792 TRACE("SamSecurityDescriptor->Length: %lu\n", SamSecurityDescriptor->Length);
1793 TRACE("SamSecurityDescriptor->SecurityDescriptor: %p\n", SamSecurityDescriptor->SecurityDescriptor);
1794
1795 *SecurityDescriptor = SamSecurityDescriptor->SecurityDescriptor;
1796
1797 midl_user_free(SamSecurityDescriptor);
1798 }
1799
1800 return Status;
1801}
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1340
NTSTATUS NTAPI SamrQuerySecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: samrpc.c:329
unsigned long Length
Definition: msv1_0.h:45
unsigned char * SecurityDescriptor
Definition: msv1_0.h:46
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:191

Referenced by GetUserDacl().

◆ SamRemoveMemberFromAlias()

NTSTATUS NTAPI SamRemoveMemberFromAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID  MemberId 
)

Definition at line 1806 of file samlib.c.

1808{
1810
1811 TRACE("SamRemoveMemberFromAlias(%p %ul)\n",
1812 AliasHandle, MemberId);
1813
1815 {
1817 MemberId);
1818 }
1820 {
1822 }
1824
1825 return Status;
1826}
NTSTATUS NTAPI SamrRemoveMemberFromAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5324

Referenced by NetLocalGroupDelMembers().

◆ SamRemoveMemberFromForeignDomain()

NTSTATUS NTAPI SamRemoveMemberFromForeignDomain ( IN SAM_HANDLE  DomainHandle,
IN PSID  MemberId 
)

Definition at line 1831 of file samlib.c.

1833{
1835
1836 TRACE("SamRemoveMemberFromForeignDomain(%p %ul)\n",
1837 DomainHandle, MemberId);
1838
1840 {
1842 MemberId);
1843 }
1845 {
1847 }
1849
1850 return Status;
1851}
NTSTATUS NTAPI SamrRemoveMemberFromForeignDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_SID MemberSid)
Definition: samrpc.c:8406

◆ SamRemoveMemberFromGroup()

NTSTATUS NTAPI SamRemoveMemberFromGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId 
)

Definition at line 1856 of file samlib.c.

1858{
1860
1861 TRACE("SamRemoveMemberFromGroup(%p %ul)\n",
1862 GroupHandle, MemberId);
1863
1865 {
1867 MemberId);
1868 }
1870 {
1872 }
1874
1875 return Status;
1876}
NTSTATUS NTAPI SamrRemoveMemberFromGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId)
Definition: samrpc.c:4606

Referenced by NetGroupDelUser(), and NetGroupSetUsers().

◆ SamRemoveMultipleMembersFromAlias()

NTSTATUS NTAPI SamRemoveMultipleMembersFromAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID *  MemberIds,
IN ULONG  MemberCount 
)

Definition at line 1881 of file samlib.c.

1884{
1887
1888 TRACE("SamRemoveMultipleMembersFromAlias(%p %p %lu)\n",
1889 AliasHandle, MemberIds, MemberCount);
1890
1891 if (MemberIds == NULL)
1893
1894 Buffer.Count = MemberCount;
1895 Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
1896
1898 {
1900 &Buffer);
1901 }
1903 {
1905 }
1907
1908 return Status;
1909}
NTSTATUS NTAPI SamrRemoveMultipleMembersFromAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9324

◆ SamRidToSid()

NTSTATUS NTAPI SamRidToSid ( IN SAM_HANDLE  ObjectHandle,
IN ULONG  Rid,
OUT PSID *  Sid 
)

Definition at line 1914 of file samlib.c.

1917{
1920}

◆ SamSetInformationAlias()

NTSTATUS NTAPI SamSetInformationAlias ( IN SAM_HANDLE  AliasHandle,
IN ALIAS_INFORMATION_CLASS  AliasInformationClass,
IN PVOID  Buffer 
)

Definition at line 1925 of file samlib.c.

1928{
1930
1931 TRACE("SamSetInformationAlias(%p %lu %p)\n",
1932 AliasHandle, AliasInformationClass, Buffer);
1933
1935 {
1937 AliasInformationClass,
1938 Buffer);
1939 }
1941 {
1943 }
1945
1946 return Status;
1947}
NTSTATUS NTAPI SamrSetInformationAlias(IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PSAMPR_ALIAS_INFO_BUFFER Buffer)
Definition: samrpc.c:5177

Referenced by NetLocalGroupAdd(), and NetLocalGroupSetInfo().

◆ SamSetInformationDomain()

NTSTATUS NTAPI SamSetInformationDomain ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_INFORMATION_CLASS  DomainInformationClass,
IN PVOID  Buffer 
)

Definition at line 1952 of file samlib.c.

1955{
1957
1958 TRACE("SamSetInformationDomain(%p %lu %p)\n",
1959 DomainHandle, DomainInformationClass, Buffer);
1960
1962 {
1964 DomainInformationClass,
1965 Buffer);
1966 }
1968 {
1970 }
1972
1973 return Status;
1974}
NTSTATUS NTAPI SamrSetInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PSAMPR_DOMAIN_INFO_BUFFER DomainInformation)
Definition: samrpc.c:1794

Referenced by ApplyLockoutSettings(), ApplyPasswordSettings(), and SetAccountsDomainSid().

◆ SamSetInformationGroup()

NTSTATUS NTAPI SamSetInformationGroup ( IN SAM_HANDLE  GroupHandle,
IN GROUP_INFORMATION_CLASS  GroupInformationClass,
IN PVOID  Buffer 
)

Definition at line 1979 of file samlib.c.

1982{
1984
1985 TRACE("SamSetInformationGroup(%p %lu %p)\n",
1986 GroupHandle, GroupInformationClass, Buffer);
1987
1989 {
1991 GroupInformationClass,
1992 Buffer);
1993 }
1995 {
1997 }
1999
2000 return Status;
2001}
NTSTATUS NTAPI SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PSAMPR_GROUP_INFO_BUFFER Buffer)
Definition: samrpc.c:4420

Referenced by NetGroupAdd(), and NetGroupSetInfo().

◆ SamSetInformationUser()

NTSTATUS NTAPI SamSetInformationUser ( IN SAM_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
IN PVOID  Buffer 
)

Definition at line 2006 of file samlib.c.

2009{
2011 SAMPR_USER_INTERNAL1_INFORMATION Internal1Buffer;
2012 USER_ALL_INFORMATION InternalAllBuffer;
2013 OEM_STRING LmPwdString;
2014 CHAR LmPwdBuffer[15];
2016
2017 TRACE("SamSetInformationUser(%p %lu %p)\n",
2018 UserHandle, UserInformationClass, Buffer);
2019
2020 if (UserInformationClass == UserSetPasswordInformation)
2021 {
2023
2024 Status = SampCheckPassword(UserHandle,
2025 (PUNICODE_STRING)&PasswordBuffer->Password);
2026 if (!NT_SUCCESS(Status))
2027 {
2028 TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
2029 return Status;
2030 }
2031
2032 /* Calculate the NT hash value of the password */
2034 (LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
2035 if (!NT_SUCCESS(Status))
2036 {
2037 TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
2038 return Status;
2039 }
2040
2041 Internal1Buffer.NtPasswordPresent = TRUE;
2042 Internal1Buffer.LmPasswordPresent = FALSE;
2043
2044 /* Build the LM password */
2045 LmPwdString.Length = 15;
2046 LmPwdString.MaximumLength = 15;
2047 LmPwdString.Buffer = LmPwdBuffer;
2048 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
2049
2051 (PUNICODE_STRING)&PasswordBuffer->Password,
2052 FALSE);
2053 if (NT_SUCCESS(Status))
2054 {
2055 /* Calculate the LM hash value of the password */
2056 Status = SystemFunction006(LmPwdString.Buffer,
2057 (LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
2058 if (NT_SUCCESS(Status))
2059 Internal1Buffer.LmPasswordPresent = TRUE;
2060 }
2061
2062 Internal1Buffer.PasswordExpired = PasswordBuffer->PasswordExpired;
2063
2065 {
2068 (PVOID)&Internal1Buffer);
2069 }
2071 {
2073 }
2075
2076 if (!NT_SUCCESS(Status))
2077 {
2078 TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
2079 }
2080
2081 return Status;
2082 }
2083 else if (UserInformationClass == UserAllInformation)
2084 {
2085 RtlCopyMemory(&InternalAllBuffer,
2086 Buffer,
2087 sizeof(USER_ALL_INFORMATION));
2088
2090 {
2091 if (InternalAllBuffer.WhichFields & USER_ALL_OWFPASSWORD)
2092 {
2093 /* Check NT password hash */
2094 if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
2095 {
2096 if (InternalAllBuffer.NtPassword.Length != sizeof(ENCRYPTED_NT_OWF_PASSWORD))
2098 }
2099
2100 /* Check LM password hash */
2101 if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
2102 {
2103 if (InternalAllBuffer.LmPassword.Length != sizeof(ENCRYPTED_LM_OWF_PASSWORD))
2105 }
2106 }
2107 else
2108 {
2109 /*
2110 * Only allow the NT password to be set.
2111 * The LM password will be created here.
2112 */
2113 if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
2114 {
2115 TRACE("Do not try to set a clear text LM password!\n");
2117 }
2118
2119 if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
2120 {
2121 Status = SampCheckPassword(UserHandle,
2122 &InternalAllBuffer.NtPassword);
2123 if (!NT_SUCCESS(Status))
2124 {
2125 TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
2126 return Status;
2127 }
2128
2129 /* Calculate the NT password hash */
2130 Status = SystemFunction007((PUNICODE_STRING)&InternalAllBuffer.NtPassword,
2131 (LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
2132 if (!NT_SUCCESS(Status))
2133 {
2134 TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
2135 return Status;
2136 }
2137
2138 InternalAllBuffer.NtPasswordPresent = TRUE;
2139 InternalAllBuffer.LmPasswordPresent = FALSE;
2140
2141 InternalAllBuffer.NtPassword.Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
2142 InternalAllBuffer.NtPassword.MaximumLength = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
2143 InternalAllBuffer.NtPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedNtOwfPassword;
2144
2145 /* Build the LM password */
2146 LmPwdString.Length = 15;
2147 LmPwdString.MaximumLength = 15;
2148 LmPwdString.Buffer = LmPwdBuffer;
2149 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
2150
2152 (PUNICODE_STRING)&InternalAllBuffer.NtPassword,
2153 FALSE);
2154 if (NT_SUCCESS(Status))
2155 {
2156 /* Calculate the LM password hash */
2157 Status = SystemFunction006(LmPwdString.Buffer,
2158 (LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
2159 if (NT_SUCCESS(Status))
2160 {
2161 InternalAllBuffer.WhichFields |= USER_ALL_LMPASSWORDPRESENT;
2162 InternalAllBuffer.LmPasswordPresent = TRUE;
2163
2164 InternalAllBuffer.LmPassword.Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
2165 InternalAllBuffer.LmPassword.MaximumLength = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
2166 InternalAllBuffer.LmPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedLmOwfPassword;
2167 }
2168 }
2169 }
2170 }
2171 }
2172
2174 {
2177 (PVOID)&InternalAllBuffer);
2178 }
2180 {
2182 }
2184
2185 if (!NT_SUCCESS(Status))
2186 {
2187 TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
2188 }
2189
2190 return Status;
2191 }
2192
2194 {
2196 UserInformationClass,
2197 Buffer);
2198 }
2200 {
2202 }
2204
2205 return Status;
2206}
NTSTATUS NTAPI SamrSetInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
Definition: samrpc.c:7852
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
#define USER_ALL_OWFPASSWORD
Definition: ntsam.h:225
#define USER_ALL_LMPASSWORDPRESENT
Definition: ntsam.h:221
#define USER_ALL_NTPASSWORDPRESENT
Definition: ntsam.h:220
struct _SAMPR_USER_SET_PASSWORD_INFORMATION * PSAMPR_USER_SET_PASSWORD_INFORMATION
NTSTATUS SampCheckPassword(IN SAMPR_HANDLE UserHandle, IN PUNICODE_STRING Password)
Definition: samlib.c:148
ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword
Definition: sam.idl:640
ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword
Definition: sam.idl:641
RPC_UNICODE_STRING Password
Definition: sam.idl:629
USHORT MaximumLength
Definition: env_spec_w32.h:370
BOOLEAN LmPasswordPresent
Definition: ntsam.h:715
UNICODE_STRING LmPassword
Definition: ntsam.h:702
UNICODE_STRING NtPassword
Definition: ntsam.h:703
BOOLEAN NtPasswordPresent
Definition: ntsam.h:716
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by EnableAccount(), SetAdministratorPassword(), SetNewAccountName(), and SetUserInfo().

◆ SamSetMemberAttributesOfGroup()

NTSTATUS NTAPI SamSetMemberAttributesOfGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId,
IN ULONG  Attributes 
)

Definition at line 2211 of file samlib.c.

2214{
2216
2217 TRACE("SamSetMemberAttributesOfGroup(%p %lu 0x%lx)\n",
2218 GroupHandle, MemberId, Attributes);
2219
2221 {
2223 MemberId,
2224 Attributes);
2225 }
2227 {
2229 }
2231
2232 return Status;
2233}
NTSTATUS NTAPI SamrSetMemberAttributesOfGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4782

Referenced by NetGroupSetUsers().

◆ SamSetSecurityObject()

NTSTATUS NTAPI SamSetSecurityObject ( IN SAM_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
IN PSECURITY_DESCRIPTOR  SecurityDescriptor 
)

Definition at line 2238 of file samlib.c.

2241{
2242 SAMPR_SR_SECURITY_DESCRIPTOR DescriptorToPass;
2243 ULONG Length;
2245
2246 TRACE("SamSetSecurityObject(%p %lu %p)\n",
2248
2249 /* Retrieve the length of the relative security descriptor */
2250 Length = 0;
2252 NULL,
2253 &Length);
2256
2257
2258 /* Allocate a buffer for the security descriptor */
2259 DescriptorToPass.Length = Length;
2260 DescriptorToPass.SecurityDescriptor = MIDL_user_allocate(Length);
2261 if (DescriptorToPass.SecurityDescriptor == NULL)
2263
2264 /* Convert the given security descriptor to a relative security descriptor */
2266 (PSECURITY_DESCRIPTOR)DescriptorToPass.SecurityDescriptor,
2267 &Length);
2268 if (!NT_SUCCESS(Status))
2269 goto done;
2270
2272 {
2275 &DescriptorToPass);
2276 }
2278 {
2280 }
2282
2283done:
2284 if (DescriptorToPass.SecurityDescriptor != NULL)
2285 MIDL_user_free(DescriptorToPass.SecurityDescriptor);
2286
2287 return Status;
2288}
void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T len)
Definition: dhcpcsvc.c:26
NTSYSAPI NTSTATUS NTAPI RtlMakeSelfRelativeSD(_In_ PSECURITY_DESCRIPTOR AbsoluteSD, _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Inout_ PULONG BufferLength)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTATUS NTAPI SamrSetSecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
Definition: samrpc.c:192
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69

◆ SamShutdownSamServer()

NTSTATUS NTAPI SamShutdownSamServer ( IN SAM_HANDLE  ServerHandle)

Definition at line 2293 of file samlib.c.

2294{
2296
2297 TRACE("SamShutdownSamServer(%p)\n", ServerHandle);
2298
2300 {
2301 Status = SamrShutdownSamServer((SAMPR_HANDLE)ServerHandle);
2302 }
2304 {
2306 }
2308
2309 return Status;
2310}
NTSTATUS NTAPI SamrShutdownSamServer(IN SAMPR_HANDLE ServerHandle)
Definition: samrpc.c:466