ReactOS 0.4.15-dev-7931-gfd331f1
samrpc.c File Reference
#include "samsrv.h"
Include dependency graph for samrpc.c:

Go to the source code of this file.

Functions

static LARGE_INTEGER SampAddRelativeTimeToTime (IN LARGE_INTEGER AbsoluteTime, IN LARGE_INTEGER RelativeTime)
 
VOID SampStartRpcServer (VOID)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
void __RPC_USER SAMPR_HANDLE_rundown (SAMPR_HANDLE hHandle)
 
NTSTATUS NTAPI SamrConnect (IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN ACCESS_MASK DesiredAccess)
 
NTSTATUS NTAPI SamrCloseHandle (IN OUT SAMPR_HANDLE *SamHandle)
 
NTSTATUS NTAPI SamrSetSecurityObject (IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
 
NTSTATUS NTAPI SamrQuerySecurityObject (IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
 
NTSTATUS NTAPI SamrShutdownSamServer (IN SAMPR_HANDLE ServerHandle)
 
NTSTATUS NTAPI SamrLookupDomainInSamServer (IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
 
NTSTATUS NTAPI SamrEnumerateDomainsInSamServer (IN SAMPR_HANDLE ServerHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamrOpenDomain (IN SAMPR_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PRPC_SID DomainId, OUT SAMPR_HANDLE *DomainHandle)
 
static NTSTATUS SampQueryDomainPassword (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampGetNumberOfAccounts (PSAM_DB_OBJECT DomainObject, LPCWSTR AccountType, PULONG Count)
 
static NTSTATUS SampQueryDomainGeneral (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainLogoff (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainOem (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainName (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainReplication (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainServerRole (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainModified (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainState (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainGeneral2 (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainLockout (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryDomainModified2 (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryInformationDomain (IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
static NTSTATUS SampSetDomainPassword (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetDomainLogoff (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetDomainServerRole (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetDomainState (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetDomainLockout (PSAM_DB_OBJECT DomainObject, PSAMPR_DOMAIN_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrSetInformationDomain (IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PSAMPR_DOMAIN_INFO_BUFFER DomainInformation)
 
NTSTATUS NTAPI SamrCreateGroupInDomain (IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *GroupHandle, OUT unsigned long *RelativeId)
 
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)
 
NTSTATUS NTAPI SamrCreateUserInDomain (IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *UserHandle, OUT unsigned long *RelativeId)
 
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)
 
NTSTATUS NTAPI SamrCreateAliasInDomain (IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *AliasHandle, OUT unsigned long *RelativeId)
 
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)
 
NTSTATUS NTAPI SamrGetAliasMembership (IN SAMPR_HANDLE DomainHandle, IN PSAMPR_PSID_ARRAY SidArray, OUT PSAMPR_ULONG_ARRAY Membership)
 
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)
 
NTSTATUS NTAPI SamrLookupIdsInDomain (IN SAMPR_HANDLE DomainHandle, IN ULONG Count, IN ULONG *RelativeIds, OUT PSAMPR_RETURNED_USTRING_ARRAY Names, OUT PSAMPR_ULONG_ARRAY Use)
 
NTSTATUS NTAPI SamrOpenGroup (IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN unsigned long GroupId, OUT SAMPR_HANDLE *GroupHandle)
 
static NTSTATUS SampQueryGroupGeneral (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryGroupName (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryGroupAttribute (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryGroupAdminComment (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryInformationGroup (IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PSAMPR_GROUP_INFO_BUFFER *Buffer)
 
static NTSTATUS SampSetGroupName (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetGroupAttribute (PSAM_DB_OBJECT GroupObject, PSAMPR_GROUP_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrSetInformationGroup (IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PSAMPR_GROUP_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrAddMemberToGroup (IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
 
NTSTATUS NTAPI SamrDeleteGroup (IN OUT SAMPR_HANDLE *GroupHandle)
 
NTSTATUS NTAPI SamrRemoveMemberFromGroup (IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId)
 
NTSTATUS NTAPI SamrGetMembersInGroup (IN SAMPR_HANDLE GroupHandle, OUT PSAMPR_GET_MEMBERS_BUFFER *Members)
 
NTSTATUS NTAPI SamrSetMemberAttributesOfGroup (IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
 
NTSTATUS NTAPI SamrOpenAlias (IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT SAMPR_HANDLE *AliasHandle)
 
static NTSTATUS SampQueryAliasGeneral (PSAM_DB_OBJECT AliasObject, PSAMPR_ALIAS_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryAliasName (PSAM_DB_OBJECT AliasObject, PSAMPR_ALIAS_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryAliasAdminComment (PSAM_DB_OBJECT AliasObject, PSAMPR_ALIAS_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryInformationAlias (IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PSAMPR_ALIAS_INFO_BUFFER *Buffer)
 
static NTSTATUS SampSetAliasName (PSAM_DB_OBJECT AliasObject, PSAMPR_ALIAS_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrSetInformationAlias (IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PSAMPR_ALIAS_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrDeleteAlias (IN OUT SAMPR_HANDLE *AliasHandle)
 
NTSTATUS NTAPI SamrAddMemberToAlias (IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
 
NTSTATUS NTAPI SamrRemoveMemberFromAlias (IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
 
NTSTATUS NTAPI SamrGetMembersInAlias (IN SAMPR_HANDLE AliasHandle, OUT PSAMPR_PSID_ARRAY_OUT Members)
 
NTSTATUS NTAPI SamrOpenUser (IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN unsigned long UserId, OUT SAMPR_HANDLE *UserHandle)
 
NTSTATUS NTAPI SamrDeleteUser (IN OUT SAMPR_HANDLE *UserHandle)
 
static NTSTATUS SampQueryUserGeneral (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserPreferences (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserLogon (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserAccount (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserLogonHours (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserName (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserAccountName (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserFullName (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserPrimaryGroup (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserHome (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserScript (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserProfile (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserAdminComment (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserWorkStations (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserControl (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserExpires (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserInternal1 (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserInternal2 (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserParameters (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampQueryUserAll (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryInformationUser (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
 
static NTSTATUS SampSetUserName (PSAM_DB_OBJECT UserObject, PRPC_UNICODE_STRING NewUserName)
 
static NTSTATUS SampSetUserGeneral (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserPreferences (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserPrimaryGroup (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserControl (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserExpires (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserInternal1 (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserInternal2 (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
static NTSTATUS SampSetUserAll (PSAM_DB_OBJECT UserObject, PSAMPR_USER_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrSetInformationUser (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
 
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)
 
NTSTATUS NTAPI SamrGetGroupsForUser (IN SAMPR_HANDLE UserHandle, OUT PSAMPR_GET_GROUPS_BUFFER *Groups)
 
NTSTATUS NTAPI SamrQueryDisplayInformation (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)
 
NTSTATUS NTAPI SamrGetDisplayEnumerationIndex (IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN PRPC_UNICODE_STRING Prefix, OUT unsigned long *Index)
 
NTSTATUS NTAPI SamrTestPrivateFunctionsDomain (IN SAMPR_HANDLE DomainHandle)
 
NTSTATUS NTAPI SamrTestPrivateFunctionsUser (IN SAMPR_HANDLE UserHandle)
 
NTSTATUS NTAPI SamrGetUserDomainPasswordInformation (IN SAMPR_HANDLE UserHandle, OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation)
 
NTSTATUS NTAPI SamrRemoveMemberFromForeignDomain (IN SAMPR_HANDLE DomainHandle, IN PRPC_SID MemberSid)
 
NTSTATUS NTAPI SamrQueryInformationDomain2 (IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryInformationUser2 (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrQueryDisplayInformation2 (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)
 
NTSTATUS NTAPI SamrGetDisplayEnumerationIndex2 (IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN PRPC_UNICODE_STRING Prefix, OUT unsigned long *Index)
 
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)
 
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)
 
NTSTATUS NTAPI SamrAddMultipleMembersToAlias (IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
 
NTSTATUS NTAPI SamrRemoveMultipleMembersFromAlias (IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
 
NTSTATUS NTAPI SamrOemChangePasswordUser2 (IN handle_t BindingHandle, IN PRPC_STRING ServerName, IN PRPC_STRING UserName, IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, IN PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLm)
 
NTSTATUS NTAPI SamrUnicodeChangePasswordUser2 (IN handle_t BindingHandle, IN PRPC_UNICODE_STRING ServerName, IN PRPC_UNICODE_STRING UserName, IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt, IN PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt, IN unsigned char LmPresent, IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, IN PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewNt)
 
NTSTATUS NTAPI SamrGetDomainPasswordInformation (IN handle_t BindingHandle, IN PRPC_UNICODE_STRING Unused, OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation)
 
NTSTATUS NTAPI SamrConnect2 (IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN ACCESS_MASK DesiredAccess)
 
NTSTATUS NTAPI SamrSetInformationUser2 (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
 
NTSTATUS NTAPI SamrSetBootKeyInformation (IN handle_t BindingHandle)
 
NTSTATUS NTAPI SamrGetBootKeyInformation (IN handle_t BindingHandle)
 
NTSTATUS NTAPI SamrConnect3 (IN handle_t BindingHandle)
 
NTSTATUS NTAPI SamrConnect4 (IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN unsigned long ClientRevision, IN ACCESS_MASK DesiredAccess)
 
NTSTATUS NTAPI SamrUnicodeChangePasswordUser3 (IN handle_t BindingHandle)
 
NTSTATUS NTAPI SamrConnect5 (IN PSAMPR_SERVER_NAME ServerName, IN ACCESS_MASK DesiredAccess, IN unsigned long InVersion, IN SAMPR_REVISION_INFO *InRevisionInfo, OUT unsigned long *OutVersion, OUT SAMPR_REVISION_INFO *OutRevisionInfo, OUT SAMPR_HANDLE *ServerHandle)
 
NTSTATUS NTAPI SamrRidToSid (IN SAMPR_HANDLE ObjectHandle, IN unsigned long Rid, OUT PRPC_SID *Sid)
 
NTSTATUS NTAPI SamrSetDSRMPassword (IN handle_t BindingHandle, IN PRPC_UNICODE_STRING Unused, IN unsigned long UserId, IN PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword)
 
NTSTATUS NTAPI SamrValidatePassword (IN handle_t Handle, IN PASSWORD_POLICY_VALIDATION_TYPE ValidationType, IN PSAM_VALIDATE_INPUT_ARG InputArg, OUT PSAM_VALIDATE_OUTPUT_ARG *OutputArg)
 

Variables

static SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY}
 
static GENERIC_MAPPING ServerMapping
 
static GENERIC_MAPPING DomainMapping
 
static GENERIC_MAPPING AliasMapping
 
static GENERIC_MAPPING GroupMapping
 
static GENERIC_MAPPING UserMapping
 
PGENERIC_MAPPING pServerMapping = &ServerMapping
 

Function Documentation

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 114 of file samrpc.c.

115{
117}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 120 of file samrpc.c.

121{
123}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

◆ SampAddRelativeTimeToTime()

static LARGE_INTEGER SampAddRelativeTimeToTime ( IN LARGE_INTEGER  AbsoluteTime,
IN LARGE_INTEGER  RelativeTime 
)
static

Definition at line 63 of file samrpc.c.

65{
66 LARGE_INTEGER NewTime;
67
68 NewTime.QuadPart = AbsoluteTime.QuadPart - RelativeTime.QuadPart;
69
70 if (NewTime.QuadPart < 0)
71 NewTime.QuadPart = 0;
72
73 return NewTime;
74}
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by SampQueryUserAll(), and SampQueryUserLogon().

◆ SampGetNumberOfAccounts()

static NTSTATUS SampGetNumberOfAccounts ( PSAM_DB_OBJECT  DomainObject,
LPCWSTR  AccountType,
PULONG  Count 
)
static

Definition at line 960 of file samrpc.c.

963{
964 HANDLE AccountKeyHandle = NULL;
965 HANDLE NamesKeyHandle = NULL;
967
968 *Count = 0;
969
970 Status = SampRegOpenKey(DomainObject->KeyHandle,
971 AccountType,
972 KEY_READ,
973 &AccountKeyHandle);
974 if (!NT_SUCCESS(Status))
975 return Status;
976
977 Status = SampRegOpenKey(AccountKeyHandle,
978 L"Names",
979 KEY_READ,
980 &NamesKeyHandle);
981 if (!NT_SUCCESS(Status))
982 goto done;
983
984 Status = SampRegQueryKeyInfo(NamesKeyHandle,
985 NULL,
986 Count);
987
988done:
989 SampRegCloseKey(&NamesKeyHandle);
990 SampRegCloseKey(&AccountKeyHandle);
991
992 return Status;
993}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS SampRegCloseKey(IN OUT PHANDLE KeyHandle)
Definition: registry.c:26
NTSTATUS SampRegQueryKeyInfo(IN HANDLE KeyHandle, OUT PULONG SubKeyCount, OUT PULONG ValueCount)
Definition: registry.c:181
NTSTATUS SampRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
Definition: registry.c:158
Status
Definition: gdiplustypes.h:25
int Count
Definition: noreturn.cpp:7
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
HANDLE KeyHandle
Definition: samsrv.h:52

Referenced by SampQueryDomainGeneral(), and SampQueryDomainGeneral2().

◆ SampQueryAliasAdminComment()

static NTSTATUS SampQueryAliasAdminComment ( PSAM_DB_OBJECT  AliasObject,
PSAMPR_ALIAS_INFO_BUFFER Buffer 
)
static

Definition at line 5002 of file samrpc.c.

5004{
5005 PSAMPR_ALIAS_INFO_BUFFER InfoBuffer = NULL;
5007
5008 *Buffer = NULL;
5009
5010 InfoBuffer = midl_user_allocate(sizeof(SAMPR_ALIAS_INFO_BUFFER));
5011 if (InfoBuffer == NULL)
5013
5015 L"Description",
5016 &InfoBuffer->AdminComment.AdminComment);
5017 if (!NT_SUCCESS(Status))
5018 {
5019 TRACE("Status 0x%08lx\n", Status);
5020 goto done;
5021 }
5022
5023 *Buffer = InfoBuffer;
5024
5025done:
5026 if (!NT_SUCCESS(Status))
5027 {
5028 if (InfoBuffer != NULL)
5029 {
5030 if (InfoBuffer->AdminComment.AdminComment.Buffer != NULL)
5032
5033 midl_user_free(InfoBuffer);
5034 }
5035 }
5036
5037 return Status;
5038}
Definition: bufpool.h:45
NTSTATUS SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PRPC_UNICODE_STRING String)
Definition: database.c:531
#define midl_user_free
Definition: rpc.h:45
#define midl_user_allocate
Definition: rpc.h:44
#define TRACE(s)
Definition: solgame.cpp:4
wchar_t * Buffer
Definition: msv1_0.h:24
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:429
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
SAMPR_ALIAS_ADM_COMMENT_INFORMATION AdminComment
Definition: sam.idl:445

Referenced by SamrQueryInformationAlias().

◆ SampQueryAliasGeneral()

static NTSTATUS SampQueryAliasGeneral ( PSAM_DB_OBJECT  AliasObject,
PSAMPR_ALIAS_INFO_BUFFER Buffer 
)
static

Definition at line 4879 of file samrpc.c.

4881{
4882 PSAMPR_ALIAS_INFO_BUFFER InfoBuffer = NULL;
4883 HANDLE MembersKeyHandle = NULL;
4885
4886 *Buffer = NULL;
4887
4888 InfoBuffer = midl_user_allocate(sizeof(SAMPR_ALIAS_INFO_BUFFER));
4889 if (InfoBuffer == NULL)
4891
4893 L"Name",
4894 &InfoBuffer->General.Name);
4895 if (!NT_SUCCESS(Status))
4896 {
4897 TRACE("Status 0x%08lx\n", Status);
4898 goto done;
4899 }
4900
4902 L"Description",
4903 &InfoBuffer->General.AdminComment);
4904 if (!NT_SUCCESS(Status))
4905 {
4906 TRACE("Status 0x%08lx\n", Status);
4907 goto done;
4908 }
4909
4910 /* Open the Members subkey */
4911 Status = SampRegOpenKey(AliasObject->KeyHandle,
4912 L"Members",
4913 KEY_READ,
4914 &MembersKeyHandle);
4915 if (NT_SUCCESS(Status))
4916 {
4917 /* Retrieve the number of members of the alias */
4918 Status = SampRegQueryKeyInfo(MembersKeyHandle,
4919 NULL,
4920 &InfoBuffer->General.MemberCount);
4921 if (!NT_SUCCESS(Status))
4922 {
4923 TRACE("Status 0x%08lx\n", Status);
4924 goto done;
4925 }
4926 }
4928 {
4929 InfoBuffer->General.MemberCount = 0;
4931 }
4932 else
4933 {
4934 TRACE("Status 0x%08lx\n", Status);
4935 goto done;
4936 }
4937
4938 *Buffer = InfoBuffer;
4939
4940done:
4941 SampRegCloseKey(&MembersKeyHandle);
4942
4943 if (!NT_SUCCESS(Status))
4944 {
4945 if (InfoBuffer != NULL)
4946 {
4947 if (InfoBuffer->General.Name.Buffer != NULL)
4948 midl_user_free(InfoBuffer->General.Name.Buffer);
4949
4950 if (InfoBuffer->General.AdminComment.Buffer != NULL)
4952
4953 midl_user_free(InfoBuffer);
4954 }
4955 }
4956
4957 return Status;
4958}
#define STATUS_SUCCESS
Definition: shellext.h:65
RPC_UNICODE_STRING Name
Definition: sam.idl:417
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:419
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
SAMPR_ALIAS_GENERAL_INFORMATION General
Definition: sam.idl:443

Referenced by SamrQueryInformationAlias().

◆ SampQueryAliasName()

static NTSTATUS SampQueryAliasName ( PSAM_DB_OBJECT  AliasObject,
PSAMPR_ALIAS_INFO_BUFFER Buffer 
)
static

Definition at line 4962 of file samrpc.c.

4964{
4965 PSAMPR_ALIAS_INFO_BUFFER InfoBuffer = NULL;
4967
4968 *Buffer = NULL;
4969
4970 InfoBuffer = midl_user_allocate(sizeof(SAMPR_ALIAS_INFO_BUFFER));
4971 if (InfoBuffer == NULL)
4973
4975 L"Name",
4976 &InfoBuffer->Name.Name);
4977 if (!NT_SUCCESS(Status))
4978 {
4979 TRACE("Status 0x%08lx\n", Status);
4980 goto done;
4981 }
4982
4983 *Buffer = InfoBuffer;
4984
4985done:
4986 if (!NT_SUCCESS(Status))
4987 {
4988 if (InfoBuffer != NULL)
4989 {
4990 if (InfoBuffer->Name.Name.Buffer != NULL)
4991 midl_user_free(InfoBuffer->Name.Name.Buffer);
4992
4993 midl_user_free(InfoBuffer);
4994 }
4995 }
4996
4997 return Status;
4998}
RPC_UNICODE_STRING Name
Definition: sam.idl:424
SAMPR_ALIAS_NAME_INFORMATION Name
Definition: sam.idl:444

Referenced by SamrQueryInformationAlias().

◆ SampQueryDomainGeneral()

static NTSTATUS SampQueryDomainGeneral ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 997 of file samrpc.c.

999{
1000 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1001 SAM_DOMAIN_FIXED_DATA FixedData;
1002 ULONG Length = 0;
1004
1005 *Buffer = NULL;
1006
1007 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1008 if (InfoBuffer == NULL)
1010
1011 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1012 Status = SampGetObjectAttribute(DomainObject,
1013 L"F",
1014 NULL,
1015 (PVOID)&FixedData,
1016 &Length);
1017 if (!NT_SUCCESS(Status))
1018 goto done;
1019
1020 InfoBuffer->General.ForceLogoff.LowPart = FixedData.ForceLogoff.LowPart;
1021 InfoBuffer->General.ForceLogoff.HighPart = FixedData.ForceLogoff.HighPart;
1024 InfoBuffer->General.DomainServerState = FixedData.DomainServerState;
1025 InfoBuffer->General.DomainServerRole = FixedData.DomainServerRole;
1027
1028 /* Get the OemInformation string */
1029 Status = SampGetObjectAttributeString(DomainObject,
1030 L"OemInformation",
1031 &InfoBuffer->General.OemInformation);
1032 if (!NT_SUCCESS(Status))
1033 {
1034 TRACE("Status 0x%08lx\n", Status);
1035 goto done;
1036 }
1037
1038 /* Get the Name string */
1039 Status = SampGetObjectAttributeString(DomainObject,
1040 L"Name",
1041 &InfoBuffer->General.DomainName);
1042 if (!NT_SUCCESS(Status))
1043 {
1044 TRACE("Status 0x%08lx\n", Status);
1045 goto done;
1046 }
1047
1048 /* Get the ReplicaSourceNodeName string */
1049 Status = SampGetObjectAttributeString(DomainObject,
1050 L"ReplicaSourceNodeName",
1051 &InfoBuffer->General.ReplicaSourceNodeName);
1052 if (!NT_SUCCESS(Status))
1053 {
1054 TRACE("Status 0x%08lx\n", Status);
1055 goto done;
1056 }
1057
1058 /* Get the number of Users in the Domain */
1059 Status = SampGetNumberOfAccounts(DomainObject,
1060 L"Users",
1061 &InfoBuffer->General.UserCount);
1062 if (!NT_SUCCESS(Status))
1063 {
1064 TRACE("Status 0x%08lx\n", Status);
1065 goto done;
1066 }
1067
1068 /* Get the number of Groups in the Domain */
1069 Status = SampGetNumberOfAccounts(DomainObject,
1070 L"Groups",
1071 &InfoBuffer->General.GroupCount);
1072 if (!NT_SUCCESS(Status))
1073 {
1074 TRACE("Status 0x%08lx\n", Status);
1075 goto done;
1076 }
1077
1078 /* Get the number of Aliases in the Domain */
1079 Status = SampGetNumberOfAccounts(DomainObject,
1080 L"Aliases",
1081 &InfoBuffer->General.AliasCount);
1082 if (!NT_SUCCESS(Status))
1083 {
1084 TRACE("Status 0x%08lx\n", Status);
1085 goto done;
1086 }
1087
1088 *Buffer = InfoBuffer;
1089
1090done:
1091 if (!NT_SUCCESS(Status))
1092 {
1093 if (InfoBuffer != NULL)
1094 {
1095 if (InfoBuffer->General.OemInformation.Buffer != NULL)
1097
1098 if (InfoBuffer->General.DomainName.Buffer != NULL)
1100
1101 if (InfoBuffer->General.ReplicaSourceNodeName.Buffer != NULL)
1103
1104 midl_user_free(InfoBuffer);
1105 }
1106 }
1107
1108 return Status;
1109}
NTSTATUS SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PULONG AttributeType, LPVOID AttributeData, PULONG AttributeSize)
Definition: database.c:516
struct _SAM_DOMAIN_FIXED_DATA SAM_DOMAIN_FIXED_DATA
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
static NTSTATUS SampGetNumberOfAccounts(PSAM_DB_OBJECT DomainObject, LPCWSTR AccountType, PULONG Count)
Definition: samrpc.c:960
unsigned long LowPart
Definition: msv1_0.h:32
RPC_UNICODE_STRING OemInformation
Definition: sam.idl:204
OLD_LARGE_INTEGER ForceLogoff
Definition: sam.idl:203
unsigned long DomainServerRole
Definition: sam.idl:209
unsigned char UasCompatibilityRequired
Definition: sam.idl:210
RPC_UNICODE_STRING ReplicaSourceNodeName
Definition: sam.idl:206
OLD_LARGE_INTEGER DomainModifiedCount
Definition: sam.idl:207
RPC_UNICODE_STRING DomainName
Definition: sam.idl:205
unsigned long DomainServerState
Definition: sam.idl:208
DOMAIN_SERVER_ENABLE_STATE DomainServerState
Definition: samsrv.h:85
DOMAIN_SERVER_ROLE DomainServerRole
Definition: samsrv.h:86
BOOLEAN UasCompatibilityRequired
Definition: samsrv.h:87
LARGE_INTEGER DomainModifiedCount
Definition: samsrv.h:73
LARGE_INTEGER ForceLogoff
Definition: samsrv.h:76
uint32_t ULONG
Definition: typedefs.h:59
ULONG LowPart
Definition: typedefs.h:106
SAMPR_DOMAIN_GENERAL_INFORMATION General
Definition: sam.idl:268

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainGeneral2()

static NTSTATUS SampQueryDomainGeneral2 ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1404 of file samrpc.c.

1406{
1407 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1408 SAM_DOMAIN_FIXED_DATA FixedData;
1409 ULONG Length = 0;
1411
1412 *Buffer = NULL;
1413
1414 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1415 if (InfoBuffer == NULL)
1417
1418 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1419 Status = SampGetObjectAttribute(DomainObject,
1420 L"F",
1421 NULL,
1422 (PVOID)&FixedData,
1423 &Length);
1424 if (!NT_SUCCESS(Status))
1425 goto done;
1426
1427 InfoBuffer->General2.I1.ForceLogoff.LowPart = FixedData.ForceLogoff.LowPart;
1428 InfoBuffer->General2.I1.ForceLogoff.HighPart = FixedData.ForceLogoff.HighPart;
1431 InfoBuffer->General2.I1.DomainServerState = FixedData.DomainServerState;
1432 InfoBuffer->General2.I1.DomainServerRole = FixedData.DomainServerRole;
1434
1435 InfoBuffer->General2.LockoutDuration = FixedData.LockoutDuration;
1437 InfoBuffer->General2.LockoutThreshold = FixedData.LockoutThreshold;
1438
1439 /* Get the OemInformation string */
1440 Status = SampGetObjectAttributeString(DomainObject,
1441 L"OemInformation",
1442 &InfoBuffer->General2.I1.OemInformation);
1443 if (!NT_SUCCESS(Status))
1444 {
1445 TRACE("Status 0x%08lx\n", Status);
1446 goto done;
1447 }
1448
1449 /* Get the Name string */
1450 Status = SampGetObjectAttributeString(DomainObject,
1451 L"Name",
1452 &InfoBuffer->General2.I1.DomainName);
1453 if (!NT_SUCCESS(Status))
1454 {
1455 TRACE("Status 0x%08lx\n", Status);
1456 goto done;
1457 }
1458
1459 /* Get the ReplicaSourceNodeName string */
1460 Status = SampGetObjectAttributeString(DomainObject,
1461 L"ReplicaSourceNodeName",
1462 &InfoBuffer->General2.I1.ReplicaSourceNodeName);
1463 if (!NT_SUCCESS(Status))
1464 {
1465 TRACE("Status 0x%08lx\n", Status);
1466 goto done;
1467 }
1468
1469 /* Get the number of Users in the Domain */
1470 Status = SampGetNumberOfAccounts(DomainObject,
1471 L"Users",
1472 &InfoBuffer->General2.I1.UserCount);
1473 if (!NT_SUCCESS(Status))
1474 {
1475 TRACE("Status 0x%08lx\n", Status);
1476 goto done;
1477 }
1478
1479 /* Get the number of Groups in the Domain */
1480 Status = SampGetNumberOfAccounts(DomainObject,
1481 L"Groups",
1482 &InfoBuffer->General2.I1.GroupCount);
1483 if (!NT_SUCCESS(Status))
1484 {
1485 TRACE("Status 0x%08lx\n", Status);
1486 goto done;
1487 }
1488
1489 /* Get the number of Aliases in the Domain */
1490 Status = SampGetNumberOfAccounts(DomainObject,
1491 L"Aliases",
1492 &InfoBuffer->General2.I1.AliasCount);
1493 if (!NT_SUCCESS(Status))
1494 {
1495 TRACE("Status 0x%08lx\n", Status);
1496 goto done;
1497 }
1498
1499 *Buffer = InfoBuffer;
1500
1501done:
1502 if (!NT_SUCCESS(Status))
1503 {
1504 if (InfoBuffer != NULL)
1505 {
1506 if (InfoBuffer->General2.I1.OemInformation.Buffer != NULL)
1508
1509 if (InfoBuffer->General2.I1.DomainName.Buffer != NULL)
1511
1512 if (InfoBuffer->General2.I1.ReplicaSourceNodeName.Buffer != NULL)
1514
1515 midl_user_free(InfoBuffer);
1516 }
1517 }
1518
1519 return Status;
1520}
LARGE_INTEGER LockoutObservationWindow
Definition: sam.idl:220
SAMPR_DOMAIN_GENERAL_INFORMATION I1
Definition: sam.idl:218
unsigned short LockoutThreshold
Definition: sam.idl:221
LARGE_INTEGER LockoutObservationWindow
Definition: samsrv.h:78
LARGE_INTEGER LockoutDuration
Definition: samsrv.h:77
USHORT LockoutThreshold
Definition: samsrv.h:84
SAMPR_DOMAIN_GENERAL_INFORMATION2 General2
Definition: sam.idl:276

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainLockout()

static NTSTATUS SampQueryDomainLockout ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1524 of file samrpc.c.

1526{
1527 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1528 SAM_DOMAIN_FIXED_DATA FixedData;
1529 ULONG Length = 0;
1531
1532 *Buffer = NULL;
1533
1534 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1535 if (InfoBuffer == NULL)
1537
1538 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1539 Status = SampGetObjectAttribute(DomainObject,
1540 L"F",
1541 NULL,
1542 (PVOID)&FixedData,
1543 &Length);
1544 if (!NT_SUCCESS(Status))
1545 goto done;
1546
1547 InfoBuffer->Lockout.LockoutDuration = FixedData.LockoutDuration;
1549 InfoBuffer->Lockout.LockoutThreshold = FixedData.LockoutThreshold;
1550
1551 *Buffer = InfoBuffer;
1552
1553done:
1554 if (!NT_SUCCESS(Status))
1555 {
1556 if (InfoBuffer != NULL)
1557 {
1558 midl_user_free(InfoBuffer);
1559 }
1560 }
1561
1562 return Status;
1563}
LARGE_INTEGER LockoutDuration
Definition: sam.idl:242
unsigned short LockoutThreshold
Definition: sam.idl:244
LARGE_INTEGER LockoutObservationWindow
Definition: sam.idl:243
SAMPR_DOMAIN_LOCKOUT_INFORMATION Lockout
Definition: sam.idl:277

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainLogoff()

static NTSTATUS SampQueryDomainLogoff ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1113 of file samrpc.c.

1115{
1116 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1117 SAM_DOMAIN_FIXED_DATA FixedData;
1118 ULONG Length = 0;
1120
1121 *Buffer = NULL;
1122
1123 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1124 if (InfoBuffer == NULL)
1126
1127 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1128 Status = SampGetObjectAttribute(DomainObject,
1129 L"F",
1130 NULL,
1131 (PVOID)&FixedData,
1132 &Length);
1133 if (!NT_SUCCESS(Status))
1134 goto done;
1135
1136 InfoBuffer->Logoff.ForceLogoff.LowPart = FixedData.ForceLogoff.LowPart;
1137 InfoBuffer->Logoff.ForceLogoff.HighPart = FixedData.ForceLogoff.HighPart;
1138
1139 *Buffer = InfoBuffer;
1140
1141done:
1142 if (!NT_SUCCESS(Status))
1143 {
1144 if (InfoBuffer != NULL)
1145 {
1146 midl_user_free(InfoBuffer);
1147 }
1148 }
1149
1150 return Status;
1151}
LARGE_INTEGER ForceLogoff
Definition: ntsam.h:399
DOMAIN_LOGOFF_INFORMATION Logoff
Definition: sam.idl:269

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainModified()

static NTSTATUS SampQueryDomainModified ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1319 of file samrpc.c.

1321{
1322 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1323 SAM_DOMAIN_FIXED_DATA FixedData;
1324 ULONG Length = 0;
1326
1327 *Buffer = NULL;
1328
1329 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1330 if (InfoBuffer == NULL)
1332
1333 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1334 Status = SampGetObjectAttribute(DomainObject,
1335 L"F",
1336 NULL,
1337 (PVOID)&FixedData,
1338 &Length);
1339 if (!NT_SUCCESS(Status))
1340 goto done;
1341
1344 InfoBuffer->Modified.CreationTime.LowPart = FixedData.CreationTime.LowPart;
1345 InfoBuffer->Modified.CreationTime.HighPart = FixedData.CreationTime.HighPart;
1346
1347 *Buffer = InfoBuffer;
1348
1349done:
1350 if (!NT_SUCCESS(Status))
1351 {
1352 if (InfoBuffer != NULL)
1353 {
1354 midl_user_free(InfoBuffer);
1355 }
1356 }
1357
1358 return Status;
1359}
LARGE_INTEGER DomainModifiedCount
Definition: ntsam.h:424
LARGE_INTEGER CreationTime
Definition: ntsam.h:425
LARGE_INTEGER CreationTime
Definition: samsrv.h:72
DOMAIN_MODIFIED_INFORMATION Modified
Definition: sam.idl:274

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainModified2()

static NTSTATUS SampQueryDomainModified2 ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1567 of file samrpc.c.

1569{
1570 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1571 SAM_DOMAIN_FIXED_DATA FixedData;
1572 ULONG Length = 0;
1574
1575 *Buffer = NULL;
1576
1577 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1578 if (InfoBuffer == NULL)
1580
1581 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1582 Status = SampGetObjectAttribute(DomainObject,
1583 L"F",
1584 NULL,
1585 (PVOID)&FixedData,
1586 &Length);
1587 if (!NT_SUCCESS(Status))
1588 goto done;
1589
1592 InfoBuffer->Modified2.CreationTime.LowPart = FixedData.CreationTime.LowPart;
1593 InfoBuffer->Modified2.CreationTime.HighPart = FixedData.CreationTime.HighPart;
1596
1597 *Buffer = InfoBuffer;
1598
1599done:
1600 if (!NT_SUCCESS(Status))
1601 {
1602 if (InfoBuffer != NULL)
1603 {
1604 midl_user_free(InfoBuffer);
1605 }
1606 }
1607
1608 return Status;
1609}
LARGE_INTEGER DomainModifiedCount
Definition: ntsam.h:457
LARGE_INTEGER ModifiedCountAtLastPromotion
Definition: ntsam.h:459
LARGE_INTEGER CreationTime
Definition: ntsam.h:458
LARGE_INTEGER ModifiedCountAtLastPromotion
Definition: samsrv.h:79
DOMAIN_MODIFIED_INFORMATION2 Modified2
Definition: sam.idl:278

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainName()

static NTSTATUS SampQueryDomainName ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1196 of file samrpc.c.

1198{
1199 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1201
1202 *Buffer = NULL;
1203
1204 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1205 if (InfoBuffer == NULL)
1207
1208 /* Get the Name string */
1209 Status = SampGetObjectAttributeString(DomainObject,
1210 L"Name",
1211 &InfoBuffer->Name.DomainName);
1212 if (!NT_SUCCESS(Status))
1213 {
1214 TRACE("Status 0x%08lx\n", Status);
1215 goto done;
1216 }
1217
1218 *Buffer = InfoBuffer;
1219
1220done:
1221 if (!NT_SUCCESS(Status))
1222 {
1223 if (InfoBuffer != NULL)
1224 {
1225 if (InfoBuffer->Name.DomainName.Buffer != NULL)
1226 midl_user_free(InfoBuffer->Name.DomainName.Buffer);
1227
1228 midl_user_free(InfoBuffer);
1229 }
1230 }
1231
1232 return Status;
1233}
RPC_UNICODE_STRING DomainName
Definition: sam.idl:232
SAMPR_DOMAIN_NAME_INFORMATION Name
Definition: sam.idl:271

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainOem()

static NTSTATUS SampQueryDomainOem ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1155 of file samrpc.c.

1157{
1158 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1160
1161 *Buffer = NULL;
1162
1163 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1164 if (InfoBuffer == NULL)
1166
1167 /* Get the OemInformation string */
1168 Status = SampGetObjectAttributeString(DomainObject,
1169 L"OemInformation",
1170 &InfoBuffer->Oem.OemInformation);
1171 if (!NT_SUCCESS(Status))
1172 {
1173 TRACE("Status 0x%08lx\n", Status);
1174 goto done;
1175 }
1176
1177 *Buffer = InfoBuffer;
1178
1179done:
1180 if (!NT_SUCCESS(Status))
1181 {
1182 if (InfoBuffer != NULL)
1183 {
1184 if (InfoBuffer->Oem.OemInformation.Buffer != NULL)
1186
1187 midl_user_free(InfoBuffer);
1188 }
1189 }
1190
1191 return Status;
1192}
RPC_UNICODE_STRING OemInformation
Definition: sam.idl:227
SAMPR_DOMAIN_OEM_INFORMATION Oem
Definition: sam.idl:270

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainPassword()

static NTSTATUS SampQueryDomainPassword ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 913 of file samrpc.c.

915{
916 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
917 SAM_DOMAIN_FIXED_DATA FixedData;
918 ULONG Length = 0;
920
921 *Buffer = NULL;
922
923 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
924 if (InfoBuffer == NULL)
926
928 Status = SampGetObjectAttribute(DomainObject,
929 L"F",
930 NULL,
931 (PVOID)&FixedData,
932 &Length);
933 if (!NT_SUCCESS(Status))
934 goto done;
935
936 InfoBuffer->Password.MinPasswordLength = FixedData.MinPasswordLength;
938 InfoBuffer->Password.PasswordProperties = FixedData.PasswordProperties;
939 InfoBuffer->Password.MaxPasswordAge.LowPart = FixedData.MaxPasswordAge.LowPart;
941 InfoBuffer->Password.MinPasswordAge.LowPart = FixedData.MinPasswordAge.LowPart;
943
944 *Buffer = InfoBuffer;
945
946done:
947 if (!NT_SUCCESS(Status))
948 {
949 if (InfoBuffer != NULL)
950 {
951 midl_user_free(InfoBuffer);
952 }
953 }
954
955 return Status;
956}
LARGE_INTEGER MinPasswordAge
Definition: ntsam.h:376
LARGE_INTEGER MaxPasswordAge
Definition: ntsam.h:375
USHORT PasswordHistoryLength
Definition: samsrv.h:83
LARGE_INTEGER MaxPasswordAge
Definition: samsrv.h:74
USHORT MinPasswordLength
Definition: samsrv.h:82
LARGE_INTEGER MinPasswordAge
Definition: samsrv.h:75
ULONG PasswordProperties
Definition: samsrv.h:81
DOMAIN_PASSWORD_INFORMATION Password
Definition: sam.idl:267

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainReplication()

static NTSTATUS SampQueryDomainReplication ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1237 of file samrpc.c.

1239{
1240 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1242
1243 *Buffer = NULL;
1244
1245 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1246 if (InfoBuffer == NULL)
1248
1249 /* Get the ReplicaSourceNodeName string */
1250 Status = SampGetObjectAttributeString(DomainObject,
1251 L"ReplicaSourceNodeName",
1252 &InfoBuffer->Replication.ReplicaSourceNodeName);
1253 if (!NT_SUCCESS(Status))
1254 {
1255 TRACE("Status 0x%08lx\n", Status);
1256 goto done;
1257 }
1258
1259 *Buffer = InfoBuffer;
1260
1261done:
1262 if (!NT_SUCCESS(Status))
1263 {
1264 if (InfoBuffer != NULL)
1265 {
1266 if (InfoBuffer->Replication.ReplicaSourceNodeName.Buffer != NULL)
1268
1269 midl_user_free(InfoBuffer);
1270 }
1271 }
1272
1273 return Status;
1274}
RPC_UNICODE_STRING ReplicaSourceNodeName
Definition: sam.idl:237
SAMPR_DOMAIN_REPLICATION_INFORMATION Replication
Definition: sam.idl:273

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainServerRole()

static NTSTATUS SampQueryDomainServerRole ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1278 of file samrpc.c.

1280{
1281 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1282 SAM_DOMAIN_FIXED_DATA FixedData;
1283 ULONG Length = 0;
1285
1286 *Buffer = NULL;
1287
1288 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1289 if (InfoBuffer == NULL)
1291
1292 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1293 Status = SampGetObjectAttribute(DomainObject,
1294 L"F",
1295 NULL,
1296 (PVOID)&FixedData,
1297 &Length);
1298 if (!NT_SUCCESS(Status))
1299 goto done;
1300
1301 InfoBuffer->Role.DomainServerRole = FixedData.DomainServerRole;
1302
1303 *Buffer = InfoBuffer;
1304
1305done:
1306 if (!NT_SUCCESS(Status))
1307 {
1308 if (InfoBuffer != NULL)
1309 {
1310 midl_user_free(InfoBuffer);
1311 }
1312 }
1313
1314 return Status;
1315}
DOMAIN_SERVER_ROLE DomainServerRole
Definition: ntsam.h:419
DOMAIN_SERVER_ROLE_INFORMATION Role
Definition: sam.idl:272

Referenced by SamrQueryInformationDomain2().

◆ SampQueryDomainState()

static NTSTATUS SampQueryDomainState ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER Buffer 
)
static

Definition at line 1363 of file samrpc.c.

1365{
1366 PSAMPR_DOMAIN_INFO_BUFFER InfoBuffer = NULL;
1367 SAM_DOMAIN_FIXED_DATA FixedData;
1368 ULONG Length = 0;
1370
1371 *Buffer = NULL;
1372
1373 InfoBuffer = midl_user_allocate(sizeof(SAMPR_DOMAIN_INFO_BUFFER));
1374 if (InfoBuffer == NULL)
1376
1377 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1378 Status = SampGetObjectAttribute(DomainObject,
1379 L"F",
1380 NULL,
1381 (PVOID)&FixedData,
1382 &Length);
1383 if (!NT_SUCCESS(Status))
1384 goto done;
1385
1386 InfoBuffer->State.DomainServerState = FixedData.DomainServerState;
1387
1388 *Buffer = InfoBuffer;
1389
1390done:
1391 if (!NT_SUCCESS(Status))
1392 {
1393 if (InfoBuffer != NULL)
1394 {
1395 midl_user_free(InfoBuffer);
1396 }
1397 }
1398
1399 return Status;
1400}
DOMAIN_SERVER_ENABLE_STATE DomainServerState
Definition: ntsam.h:430
DOMAIN_STATE_INFORMATION State
Definition: sam.idl:275

Referenced by SamrQueryInformationDomain2().

◆ SampQueryGroupAdminComment()

static NTSTATUS SampQueryGroupAdminComment ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER Buffer 
)
static

Definition at line 4210 of file samrpc.c.

4212{
4213 PSAMPR_GROUP_INFO_BUFFER InfoBuffer = NULL;
4215
4216 *Buffer = NULL;
4217
4218 InfoBuffer = midl_user_allocate(sizeof(SAMPR_GROUP_INFO_BUFFER));
4219 if (InfoBuffer == NULL)
4221
4223 L"AdminComment",
4224 &InfoBuffer->AdminComment.AdminComment);
4225 if (!NT_SUCCESS(Status))
4226 {
4227 TRACE("Status 0x%08lx\n", Status);
4228 goto done;
4229 }
4230
4231 *Buffer = InfoBuffer;
4232
4233done:
4234 if (!NT_SUCCESS(Status))
4235 {
4236 if (InfoBuffer != NULL)
4237 {
4238 if (InfoBuffer->AdminComment.AdminComment.Buffer != NULL)
4240
4241 midl_user_free(InfoBuffer);
4242 }
4243 }
4244
4245 return Status;
4246}
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:392
SAMPR_GROUP_ADM_COMMENT_INFORMATION AdminComment
Definition: sam.idl:411

Referenced by SamrQueryInformationGroup().

◆ SampQueryGroupAttribute()

static NTSTATUS SampQueryGroupAttribute ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER Buffer 
)
static

Definition at line 4166 of file samrpc.c.

4168{
4169 PSAMPR_GROUP_INFO_BUFFER InfoBuffer = NULL;
4170 SAM_GROUP_FIXED_DATA FixedData;
4171 ULONG Length = 0;
4173
4174 *Buffer = NULL;
4175
4176 InfoBuffer = midl_user_allocate(sizeof(SAMPR_GROUP_INFO_BUFFER));
4177 if (InfoBuffer == NULL)
4179
4180 Length = sizeof(SAM_GROUP_FIXED_DATA);
4181 Status = SampGetObjectAttribute(GroupObject,
4182 L"F",
4183 NULL,
4184 (PVOID)&FixedData,
4185 &Length);
4186 if (!NT_SUCCESS(Status))
4187 {
4188 TRACE("Status 0x%08lx\n", Status);
4189 goto done;
4190 }
4191
4192 InfoBuffer->Attribute.Attributes = FixedData.Attributes;
4193
4194 *Buffer = InfoBuffer;
4195
4196done:
4197 if (!NT_SUCCESS(Status))
4198 {
4199 if (InfoBuffer != NULL)
4200 {
4201 midl_user_free(InfoBuffer);
4202 }
4203 }
4204
4205 return Status;
4206}
struct _SAM_GROUP_FIXED_DATA SAM_GROUP_FIXED_DATA
SAMPR_GROUP_ATTRIBUTE_INFORMATION Attribute
Definition: sam.idl:410

Referenced by SamrQueryInformationGroup().

◆ SampQueryGroupGeneral()

static NTSTATUS SampQueryGroupGeneral ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER Buffer 
)
static

Definition at line 4036 of file samrpc.c.

4038{
4039 PSAMPR_GROUP_INFO_BUFFER InfoBuffer = NULL;
4040 SAM_GROUP_FIXED_DATA FixedData;
4041 ULONG MembersLength = 0;
4042 ULONG Length = 0;
4044
4045 *Buffer = NULL;
4046
4047 InfoBuffer = midl_user_allocate(sizeof(SAMPR_GROUP_INFO_BUFFER));
4048 if (InfoBuffer == NULL)
4050
4052 L"Name",
4053 &InfoBuffer->General.Name);
4054 if (!NT_SUCCESS(Status))
4055 {
4056 TRACE("Status 0x%08lx\n", Status);
4057 goto done;
4058 }
4059
4061 L"AdminComment",
4062 &InfoBuffer->General.AdminComment);
4063 if (!NT_SUCCESS(Status))
4064 {
4065 TRACE("Status 0x%08lx\n", Status);
4066 goto done;
4067 }
4068
4069 Length = sizeof(SAM_GROUP_FIXED_DATA);
4070 Status = SampGetObjectAttribute(GroupObject,
4071 L"F",
4072 NULL,
4073 (PVOID)&FixedData,
4074 &Length);
4075 if (!NT_SUCCESS(Status))
4076 {
4077 TRACE("Status 0x%08lx\n", Status);
4078 goto done;
4079 }
4080
4081 InfoBuffer->General.Attributes = FixedData.Attributes;
4082
4083 Status = SampGetObjectAttribute(GroupObject,
4084 L"Members",
4085 NULL,
4086 NULL,
4087 &MembersLength);
4089 {
4090 TRACE("Status 0x%08lx\n", Status);
4091 goto done;
4092 }
4093
4095 {
4096 InfoBuffer->General.MemberCount = 0;
4098 }
4099 else
4100 {
4101 InfoBuffer->General.MemberCount = MembersLength / sizeof(ULONG);
4102 }
4103
4104 *Buffer = InfoBuffer;
4105
4106done:
4107 if (!NT_SUCCESS(Status))
4108 {
4109 if (InfoBuffer != NULL)
4110 {
4111 if (InfoBuffer->General.Name.Buffer != NULL)
4112 midl_user_free(InfoBuffer->General.Name.Buffer);
4113
4114 if (InfoBuffer->General.AdminComment.Buffer != NULL)
4116
4117 midl_user_free(InfoBuffer);
4118 }
4119 }
4120
4121 return Status;
4122}
RPC_UNICODE_STRING Name
Definition: sam.idl:379
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:382
SAMPR_GROUP_GENERAL_INFORMATION General
Definition: sam.idl:408

Referenced by SamrQueryInformationGroup().

◆ SampQueryGroupName()

static NTSTATUS SampQueryGroupName ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER Buffer 
)
static

Definition at line 4126 of file samrpc.c.

4128{
4129 PSAMPR_GROUP_INFO_BUFFER InfoBuffer = NULL;
4131
4132 *Buffer = NULL;
4133
4134 InfoBuffer = midl_user_allocate(sizeof(SAMPR_GROUP_INFO_BUFFER));
4135 if (InfoBuffer == NULL)
4137
4139 L"Name",
4140 &InfoBuffer->Name.Name);
4141 if (!NT_SUCCESS(Status))
4142 {
4143 TRACE("Status 0x%08lx\n", Status);
4144 goto done;
4145 }
4146
4147 *Buffer = InfoBuffer;
4148
4149done:
4150 if (!NT_SUCCESS(Status))
4151 {
4152 if (InfoBuffer != NULL)
4153 {
4154 if (InfoBuffer->Name.Name.Buffer != NULL)
4155 midl_user_free(InfoBuffer->Name.Name.Buffer);
4156
4157 midl_user_free(InfoBuffer);
4158 }
4159 }
4160
4161 return Status;
4162}
RPC_UNICODE_STRING Name
Definition: sam.idl:387
SAMPR_GROUP_NAME_INFORMATION Name
Definition: sam.idl:409

Referenced by SamrQueryInformationGroup().

◆ SampQueryUserAccount()

static NTSTATUS SampQueryUserAccount ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 5876 of file samrpc.c.

5878{
5879 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
5880 SAM_USER_FIXED_DATA FixedData;
5881 ULONG Length = 0;
5883
5884 *Buffer = NULL;
5885
5886 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
5887 if (InfoBuffer == NULL)
5889
5890 Length = sizeof(SAM_USER_FIXED_DATA);
5891 Status = SampGetObjectAttribute(UserObject,
5892 L"F",
5893 NULL,
5894 (PVOID)&FixedData,
5895 &Length);
5896 if (!NT_SUCCESS(Status))
5897 goto done;
5898
5899 InfoBuffer->Account.UserId = FixedData.UserId;
5900 InfoBuffer->Account.PrimaryGroupId = FixedData.PrimaryGroupId;
5901 InfoBuffer->Account.LastLogon.LowPart = FixedData.LastLogon.LowPart;
5902 InfoBuffer->Account.LastLogon.HighPart = FixedData.LastLogon.HighPart;
5903 InfoBuffer->Account.LastLogoff.LowPart = FixedData.LastLogoff.LowPart;
5904 InfoBuffer->Account.LastLogoff.HighPart = FixedData.LastLogoff.HighPart;
5905 InfoBuffer->Account.PasswordLastSet.LowPart = FixedData.PasswordLastSet.LowPart;
5907 InfoBuffer->Account.AccountExpires.LowPart = FixedData.AccountExpires.LowPart;
5908 InfoBuffer->Account.AccountExpires.HighPart = FixedData.AccountExpires.HighPart;
5909 InfoBuffer->Account.BadPasswordCount = FixedData.BadPasswordCount;
5910 InfoBuffer->Account.LogonCount = FixedData.LogonCount;
5911 InfoBuffer->Account.UserAccountControl = FixedData.UserAccountControl;
5912
5913 /* Get the Name string */
5915 L"Name",
5916 &InfoBuffer->Account.UserName);
5917 if (!NT_SUCCESS(Status))
5918 {
5919 TRACE("Status 0x%08lx\n", Status);
5920 goto done;
5921 }
5922
5923 /* Get the FullName string */
5925 L"FullName",
5926 &InfoBuffer->Account.FullName);
5927 if (!NT_SUCCESS(Status))
5928 {
5929 TRACE("Status 0x%08lx\n", Status);
5930 goto done;
5931 }
5932
5933 /* Get the HomeDirectory string */
5935 L"HomeDirectory",
5936 &InfoBuffer->Account.HomeDirectory);
5937 if (!NT_SUCCESS(Status))
5938 {
5939 TRACE("Status 0x%08lx\n", Status);
5940 goto done;
5941 }
5942
5943 /* Get the HomeDirectoryDrive string */
5945 L"HomeDirectoryDrive",
5946 &InfoBuffer->Account.HomeDirectoryDrive);
5947 if (!NT_SUCCESS(Status))
5948 {
5949 TRACE("Status 0x%08lx\n", Status);
5950 goto done;
5951 }
5952
5953 /* Get the ScriptPath string */
5955 L"ScriptPath",
5956 &InfoBuffer->Account.ScriptPath);
5957 if (!NT_SUCCESS(Status))
5958 {
5959 TRACE("Status 0x%08lx\n", Status);
5960 goto done;
5961 }
5962
5963 /* Get the ProfilePath string */
5965 L"ProfilePath",
5966 &InfoBuffer->Account.ProfilePath);
5967 if (!NT_SUCCESS(Status))
5968 {
5969 TRACE("Status 0x%08lx\n", Status);
5970 goto done;
5971 }
5972
5973 /* Get the AdminComment string */
5975 L"AdminComment",
5976 &InfoBuffer->Account.AdminComment);
5977 if (!NT_SUCCESS(Status))
5978 {
5979 TRACE("Status 0x%08lx\n", Status);
5980 goto done;
5981 }
5982
5983 /* Get the WorkStations string */
5985 L"WorkStations",
5986 &InfoBuffer->Account.WorkStations);
5987 if (!NT_SUCCESS(Status))
5988 {
5989 TRACE("Status 0x%08lx\n", Status);
5990 goto done;
5991 }
5992
5993 /* Get the LogonHours attribute */
5995 &InfoBuffer->Account.LogonHours);
5996 if (!NT_SUCCESS(Status))
5997 {
5998 TRACE("Status 0x%08lx\n", Status);
5999 goto done;
6000 }
6001
6002 *Buffer = InfoBuffer;
6003
6004done:
6005 if (!NT_SUCCESS(Status))
6006 {
6007 if (InfoBuffer != NULL)
6008 {
6009 if (InfoBuffer->Account.UserName.Buffer != NULL)
6011
6012 if (InfoBuffer->Account.FullName.Buffer != NULL)
6014
6015 if (InfoBuffer->Account.HomeDirectory.Buffer != NULL)
6017
6018 if (InfoBuffer->Account.HomeDirectoryDrive.Buffer != NULL)
6020
6021 if (InfoBuffer->Account.ScriptPath.Buffer != NULL)
6023
6024 if (InfoBuffer->Account.ProfilePath.Buffer != NULL)
6026
6027 if (InfoBuffer->Account.AdminComment.Buffer != NULL)
6029
6030 if (InfoBuffer->Account.WorkStations.Buffer != NULL)
6032
6033 if (InfoBuffer->Account.LogonHours.LogonHours != NULL)
6035
6036 midl_user_free(InfoBuffer);
6037 }
6038 }
6039
6040 return Status;
6041}
NTSTATUS SampGetLogonHoursAttribute(IN PSAM_DB_OBJECT UserObject, IN OUT PSAMPR_LOGON_HOURS LogonHours)
Definition: user.c:619
struct _SAM_USER_FIXED_DATA SAM_USER_FIXED_DATA
unsigned char * LogonHours
Definition: msv1_0.h:63
RPC_UNICODE_STRING FullName
Definition: sam.idl:565
SAMPR_LOGON_HOURS LogonHours
Definition: sam.idl:576
OLD_LARGE_INTEGER LastLogoff
Definition: sam.idl:575
RPC_UNICODE_STRING HomeDirectoryDrive
Definition: sam.idl:569
RPC_UNICODE_STRING ScriptPath
Definition: sam.idl:570
unsigned long UserAccountControl
Definition: sam.idl:581
OLD_LARGE_INTEGER PasswordLastSet
Definition: sam.idl:579
unsigned short BadPasswordCount
Definition: sam.idl:577
RPC_UNICODE_STRING ProfilePath
Definition: sam.idl:571
RPC_UNICODE_STRING HomeDirectory
Definition: sam.idl:568
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:572
OLD_LARGE_INTEGER AccountExpires
Definition: sam.idl:580
RPC_UNICODE_STRING UserName
Definition: sam.idl:564
unsigned short LogonCount
Definition: sam.idl:578
unsigned long PrimaryGroupId
Definition: sam.idl:567
RPC_UNICODE_STRING WorkStations
Definition: sam.idl:573
OLD_LARGE_INTEGER LastLogon
Definition: sam.idl:574
LARGE_INTEGER AccountExpires
Definition: samsrv.h:105
ULONG UserAccountControl
Definition: samsrv.h:109
LARGE_INTEGER LastLogon
Definition: samsrv.h:102
ULONG PrimaryGroupId
Definition: samsrv.h:108
LARGE_INTEGER PasswordLastSet
Definition: samsrv.h:104
USHORT BadPasswordCount
Definition: samsrv.h:112
LARGE_INTEGER LastLogoff
Definition: samsrv.h:103
SAMPR_USER_ACCOUNT_INFORMATION Account
Definition: sam.idl:725

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserAccountName()

static NTSTATUS SampQueryUserAccountName ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6145 of file samrpc.c.

6147{
6148 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6150
6151 *Buffer = NULL;
6152
6153 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6154 if (InfoBuffer == NULL)
6156
6157 /* Get the Name string */
6159 L"Name",
6160 &InfoBuffer->AccountName.UserName);
6161 if (!NT_SUCCESS(Status))
6162 {
6163 TRACE("Status 0x%08lx\n", Status);
6164 goto done;
6165 }
6166
6167 *Buffer = InfoBuffer;
6168
6169done:
6170 if (!NT_SUCCESS(Status))
6171 {
6172 if (InfoBuffer != NULL)
6173 {
6174 if (InfoBuffer->AccountName.UserName.Buffer != NULL)
6176
6177 midl_user_free(InfoBuffer);
6178 }
6179 }
6180
6181 return Status;
6182}
RPC_UNICODE_STRING UserName
Definition: sam.idl:586
SAMPR_USER_A_NAME_INFORMATION AccountName
Definition: sam.idl:727

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserAdminComment()

static NTSTATUS SampQueryUserAdminComment ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6405 of file samrpc.c.

6407{
6408 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6410
6411 *Buffer = NULL;
6412
6413 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6414 if (InfoBuffer == NULL)
6416
6417 /* Get the AdminComment string */
6419 L"AdminComment",
6420 &InfoBuffer->AdminComment.AdminComment);
6421 if (!NT_SUCCESS(Status))
6422 {
6423 TRACE("Status 0x%08lx\n", Status);
6424 goto done;
6425 }
6426
6427 *Buffer = InfoBuffer;
6428
6429done:
6430 if (!NT_SUCCESS(Status))
6431 {
6432 if (InfoBuffer != NULL)
6433 {
6434 if (InfoBuffer->AdminComment.AdminComment.Buffer != NULL)
6436
6437 midl_user_free(InfoBuffer);
6438 }
6439 }
6440
6441 return Status;
6442}
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:618
SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment
Definition: sam.idl:733

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserAll()

static NTSTATUS SampQueryUserAll ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6749 of file samrpc.c.

6751{
6752 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6753 SAM_DOMAIN_FIXED_DATA DomainFixedData;
6754 SAM_USER_FIXED_DATA FixedData;
6755 LARGE_INTEGER PasswordCanChange;
6756 LARGE_INTEGER PasswordMustChange;
6757 ULONG Length = 0;
6759
6760 *Buffer = NULL;
6761
6762 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6763 if (InfoBuffer == NULL)
6765
6766 /* Get the fixed size domain data */
6767 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
6769 L"F",
6770 NULL,
6771 (PVOID)&DomainFixedData,
6772 &Length);
6773 if (!NT_SUCCESS(Status))
6774 goto done;
6775
6776 /* Get the fixed size user data */
6777 Length = sizeof(SAM_USER_FIXED_DATA);
6778 Status = SampGetObjectAttribute(UserObject,
6779 L"F",
6780 NULL,
6781 (PVOID)&FixedData,
6782 &Length);
6783 if (!NT_SUCCESS(Status))
6784 goto done;
6785
6786 /* Set the fields to be returned */
6787 if (UserObject->Trusted)
6788 {
6794 }
6795 else
6796 {
6797 InfoBuffer->All.WhichFields = 0;
6798
6799 if (UserObject->Access & USER_READ_GENERAL)
6801
6802 if (UserObject->Access & USER_READ_LOGON)
6804
6805 if (UserObject->Access & USER_READ_ACCOUNT)
6807
6808 if (UserObject->Access & USER_READ_PREFERENCES)
6810 }
6811
6812 /* Fail, if no fields are to be returned */
6813 if (InfoBuffer->All.WhichFields == 0)
6814 {
6816 goto done;
6817 }
6818
6819 /* Get the UserName attribute */
6820 if (InfoBuffer->All.WhichFields & USER_ALL_USERNAME)
6821 {
6823 L"Name",
6824 &InfoBuffer->All.UserName);
6825 if (!NT_SUCCESS(Status))
6826 {
6827 TRACE("Status 0x%08lx\n", Status);
6828 goto done;
6829 }
6830 }
6831
6832 /* Get the FullName attribute */
6833 if (InfoBuffer->All.WhichFields & USER_ALL_FULLNAME)
6834 {
6836 L"FullName",
6837 &InfoBuffer->All.FullName);
6838 if (!NT_SUCCESS(Status))
6839 {
6840 TRACE("Status 0x%08lx\n", Status);
6841 goto done;
6842 }
6843 }
6844
6845 /* Get the UserId attribute */
6846 if (InfoBuffer->All.WhichFields & USER_ALL_USERID)
6847 {
6848 InfoBuffer->All.UserId = FixedData.UserId;
6849 }
6850
6851 /* Get the PrimaryGroupId attribute */
6852 if (InfoBuffer->All.WhichFields & USER_ALL_PRIMARYGROUPID)
6853 {
6854 InfoBuffer->All.PrimaryGroupId = FixedData.PrimaryGroupId;
6855 }
6856
6857 /* Get the AdminComment attribute */
6858 if (InfoBuffer->All.WhichFields & USER_ALL_ADMINCOMMENT)
6859 {
6861 L"AdminComment",
6862 &InfoBuffer->All.AdminComment);
6863 if (!NT_SUCCESS(Status))
6864 {
6865 TRACE("Status 0x%08lx\n", Status);
6866 goto done;
6867 }
6868 }
6869
6870 /* Get the UserComment attribute */
6871 if (InfoBuffer->All.WhichFields & USER_ALL_USERCOMMENT)
6872 {
6874 L"UserComment",
6875 &InfoBuffer->All.UserComment);
6876 if (!NT_SUCCESS(Status))
6877 {
6878 TRACE("Status 0x%08lx\n", Status);
6879 goto done;
6880 }
6881 }
6882
6883 /* Get the HomeDirectory attribute */
6884 if (InfoBuffer->All.WhichFields & USER_ALL_HOMEDIRECTORY)
6885 {
6887 L"HomeDirectory",
6888 &InfoBuffer->All.HomeDirectory);
6889 if (!NT_SUCCESS(Status))
6890 {
6891 TRACE("Status 0x%08lx\n", Status);
6892 goto done;
6893 }
6894 }
6895
6896 /* Get the HomeDirectoryDrive attribute */
6898 {
6900 L"HomeDirectoryDrive",
6901 &InfoBuffer->Home.HomeDirectoryDrive);
6902 if (!NT_SUCCESS(Status))
6903 {
6904 TRACE("Status 0x%08lx\n", Status);
6905 goto done;
6906 }
6907 }
6908
6909 /* Get the ScriptPath attribute */
6910 if (InfoBuffer->All.WhichFields & USER_ALL_SCRIPTPATH)
6911 {
6913 L"ScriptPath",
6914 &InfoBuffer->All.ScriptPath);
6915 if (!NT_SUCCESS(Status))
6916 {
6917 TRACE("Status 0x%08lx\n", Status);
6918 goto done;
6919 }
6920 }
6921
6922 /* Get the ProfilePath attribute */
6923 if (InfoBuffer->All.WhichFields & USER_ALL_PROFILEPATH)
6924 {
6926 L"ProfilePath",
6927 &InfoBuffer->All.ProfilePath);
6928 if (!NT_SUCCESS(Status))
6929 {
6930 TRACE("Status 0x%08lx\n", Status);
6931 goto done;
6932 }
6933 }
6934
6935 /* Get the WorkStations attribute */
6936 if (InfoBuffer->All.WhichFields & USER_ALL_WORKSTATIONS)
6937 {
6939 L"WorkStations",
6940 &InfoBuffer->All.WorkStations);
6941 if (!NT_SUCCESS(Status))
6942 {
6943 TRACE("Status 0x%08lx\n", Status);
6944 goto done;
6945 }
6946 }
6947
6948 /* Get the LastLogon attribute */
6949 if (InfoBuffer->All.WhichFields & USER_ALL_LASTLOGON)
6950 {
6951 InfoBuffer->All.LastLogon.LowPart = FixedData.LastLogon.LowPart;
6952 InfoBuffer->All.LastLogon.HighPart = FixedData.LastLogon.HighPart;
6953 }
6954
6955 /* Get the LastLogoff attribute */
6956 if (InfoBuffer->All.WhichFields & USER_ALL_LASTLOGOFF)
6957 {
6958 InfoBuffer->All.LastLogoff.LowPart = FixedData.LastLogoff.LowPart;
6959 InfoBuffer->All.LastLogoff.HighPart = FixedData.LastLogoff.HighPart;
6960 }
6961
6962 /* Get the LogonHours attribute */
6963 if (InfoBuffer->All.WhichFields & USER_ALL_LOGONHOURS)
6964 {
6966 &InfoBuffer->All.LogonHours);
6967 if (!NT_SUCCESS(Status))
6968 {
6969 TRACE("Status 0x%08lx\n", Status);
6970 goto done;
6971 }
6972 }
6973
6974 /* Get the BadPasswordCount attribute */
6975 if (InfoBuffer->All.WhichFields & USER_ALL_BADPASSWORDCOUNT)
6976 {
6977 InfoBuffer->All.BadPasswordCount = FixedData.BadPasswordCount;
6978 }
6979
6980 /* Get the LogonCount attribute */
6981 if (InfoBuffer->All.WhichFields & USER_ALL_LOGONCOUNT)
6982 {
6983 InfoBuffer->All.LogonCount = FixedData.LogonCount;
6984 }
6985
6986 /* Get the PasswordCanChange attribute */
6987 if (InfoBuffer->All.WhichFields & USER_ALL_PASSWORDCANCHANGE)
6988 {
6989 PasswordCanChange = SampAddRelativeTimeToTime(FixedData.PasswordLastSet,
6990 DomainFixedData.MinPasswordAge);
6991 InfoBuffer->All.PasswordCanChange.LowPart = PasswordCanChange.LowPart;
6992 InfoBuffer->All.PasswordCanChange.HighPart = PasswordCanChange.HighPart;
6993 }
6994
6995 /* Get the PasswordMustChange attribute */
6997 {
6998 PasswordMustChange = SampAddRelativeTimeToTime(FixedData.PasswordLastSet,
6999 DomainFixedData.MaxPasswordAge);
7000 InfoBuffer->All.PasswordMustChange.LowPart = PasswordMustChange.LowPart;
7001 InfoBuffer->All.PasswordMustChange.HighPart = PasswordMustChange.HighPart;
7002 }
7003
7004 /* Get the PasswordLastSet attribute */
7005 if (InfoBuffer->All.WhichFields & USER_ALL_PASSWORDLASTSET)
7006 {
7007 InfoBuffer->All.PasswordLastSet.LowPart = FixedData.PasswordLastSet.LowPart;
7008 InfoBuffer->All.PasswordLastSet.HighPart = FixedData.PasswordLastSet.HighPart;
7009 }
7010
7011 /* Get the AccountExpires attribute */
7012 if (InfoBuffer->All.WhichFields & USER_ALL_ACCOUNTEXPIRES)
7013 {
7014 InfoBuffer->All.AccountExpires.LowPart = FixedData.AccountExpires.LowPart;
7015 InfoBuffer->All.AccountExpires.HighPart = FixedData.AccountExpires.HighPart;
7016 }
7017
7018 /* Get the UserAccountControl attribute */
7020 {
7021 InfoBuffer->All.UserAccountControl = FixedData.UserAccountControl;
7022 }
7023
7024 /* Get the Parameters attribute */
7025 if (InfoBuffer->All.WhichFields & USER_ALL_PARAMETERS)
7026 {
7028 L"Parameters",
7029 &InfoBuffer->All.Parameters);
7030 if (!NT_SUCCESS(Status))
7031 {
7032 TRACE("Status 0x%08lx\n", Status);
7033 goto done;
7034 }
7035 }
7036
7037 /* Get the CountryCode attribute */
7038 if (InfoBuffer->All.WhichFields & USER_ALL_COUNTRYCODE)
7039 {
7040 InfoBuffer->All.CountryCode = FixedData.CountryCode;
7041 }
7042
7043 /* Get the CodePage attribute */
7044 if (InfoBuffer->All.WhichFields & USER_ALL_CODEPAGE)
7045 {
7046 InfoBuffer->All.CodePage = FixedData.CodePage;
7047 }
7048
7049 /* Get the LmPassword and NtPassword attributes */
7051 {
7052 InfoBuffer->All.LmPasswordPresent = FALSE;
7053 InfoBuffer->All.NtPasswordPresent = FALSE;
7054
7055 /* Get the NT password */
7056 Length = 0;
7057 SampGetObjectAttribute(UserObject,
7058 L"NTPwd",
7059 NULL,
7060 NULL,
7061 &Length);
7062
7063 if (Length == sizeof(ENCRYPTED_NT_OWF_PASSWORD))
7064 {
7066 if (InfoBuffer->All.NtOwfPassword.Buffer == NULL)
7067 {
7069 goto done;
7070 }
7071
7072 InfoBuffer->All.NtOwfPassword.Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
7074
7075 Status = SampGetObjectAttribute(UserObject,
7076 L"NTPwd",
7077 NULL,
7078 (PVOID)InfoBuffer->All.NtOwfPassword.Buffer,
7079 &Length);
7080 if (!NT_SUCCESS(Status))
7081 goto done;
7082
7083 if (memcmp(InfoBuffer->All.NtOwfPassword.Buffer,
7084 &EmptyNtHash,
7086 InfoBuffer->All.NtPasswordPresent = TRUE;
7087 }
7088
7089 /* Get the LM password */
7090 Length = 0;
7091 SampGetObjectAttribute(UserObject,
7092 L"LMPwd",
7093 NULL,
7094 NULL,
7095 &Length);
7096
7097 if (Length == sizeof(ENCRYPTED_LM_OWF_PASSWORD))
7098 {
7100 if (InfoBuffer->All.LmOwfPassword.Buffer == NULL)
7101 {
7103 goto done;
7104 }
7105
7106 InfoBuffer->All.LmOwfPassword.Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
7108
7109 Status = SampGetObjectAttribute(UserObject,
7110 L"LMPwd",
7111 NULL,
7112 (PVOID)InfoBuffer->All.LmOwfPassword.Buffer,
7113 &Length);
7114 if (!NT_SUCCESS(Status))
7115 goto done;
7116
7117 if (memcmp(InfoBuffer->All.LmOwfPassword.Buffer,
7118 &EmptyLmHash,
7120 InfoBuffer->All.LmPasswordPresent = TRUE;
7121 }
7122 }
7123
7124 if (InfoBuffer->All.WhichFields & USER_ALL_PRIVATEDATA)
7125 {
7127 L"PrivateData",
7128 &InfoBuffer->All.PrivateData);
7129 if (!NT_SUCCESS(Status))
7130 {
7131 TRACE("Status 0x%08lx\n", Status);
7132 goto done;
7133 }
7134 }
7135
7136 if (InfoBuffer->All.WhichFields & USER_ALL_PASSWORDEXPIRED)
7137 {
7138 /* FIXME */
7139 }
7140
7142 {
7143 Length = 0;
7144 SampGetObjectAttribute(UserObject,
7145 L"SecDesc",
7146 NULL,
7147 NULL,
7148 &Length);
7149
7150 if (Length > 0)
7151 {
7153 if (InfoBuffer->All.SecurityDescriptor.SecurityDescriptor == NULL)
7154 {
7156 goto done;
7157 }
7158
7159 InfoBuffer->All.SecurityDescriptor.Length = Length;
7160
7161 Status = SampGetObjectAttribute(UserObject,
7162 L"SecDesc",
7163 NULL,
7165 &Length);
7166 if (!NT_SUCCESS(Status))
7167 goto done;
7168 }
7169 }
7170
7171 *Buffer = InfoBuffer;
7172
7173done:
7174 if (!NT_SUCCESS(Status))
7175 {
7176 if (InfoBuffer != NULL)
7177 {
7178 if (InfoBuffer->All.UserName.Buffer != NULL)
7179 midl_user_free(InfoBuffer->All.UserName.Buffer);
7180
7181 if (InfoBuffer->All.FullName.Buffer != NULL)
7182 midl_user_free(InfoBuffer->All.FullName.Buffer);
7183
7184 if (InfoBuffer->All.AdminComment.Buffer != NULL)
7186
7187 if (InfoBuffer->All.UserComment.Buffer != NULL)
7188 midl_user_free(InfoBuffer->All.UserComment.Buffer);
7189
7190 if (InfoBuffer->All.HomeDirectory.Buffer != NULL)
7192
7193 if (InfoBuffer->All.HomeDirectoryDrive.Buffer != NULL)
7195
7196 if (InfoBuffer->All.ScriptPath.Buffer != NULL)
7197 midl_user_free(InfoBuffer->All.ScriptPath.Buffer);
7198
7199 if (InfoBuffer->All.ProfilePath.Buffer != NULL)
7200 midl_user_free(InfoBuffer->All.ProfilePath.Buffer);
7201
7202 if (InfoBuffer->All.WorkStations.Buffer != NULL)
7204
7205 if (InfoBuffer->All.LogonHours.LogonHours != NULL)
7207
7208 if (InfoBuffer->All.Parameters.Buffer != NULL)
7209 midl_user_free(InfoBuffer->All.Parameters.Buffer);
7210
7211 if (InfoBuffer->All.LmOwfPassword.Buffer != NULL)
7213
7214 if (InfoBuffer->All.NtOwfPassword.Buffer != NULL)
7216
7217 if (InfoBuffer->All.PrivateData.Buffer != NULL)
7218 midl_user_free(InfoBuffer->All.PrivateData.Buffer);
7219
7220 if (InfoBuffer->All.SecurityDescriptor.SecurityDescriptor != NULL)
7222
7223 midl_user_free(InfoBuffer);
7224 }
7225 }
7226
7227 return Status;
7228}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
#define USER_READ_GENERAL
Definition: ntsam.h:126
#define USER_ALL_READ_GENERAL_MASK
Definition: ntsam.h:228
#define USER_READ_LOGON
Definition: ntsam.h:129
#define USER_ALL_SCRIPTPATH
Definition: ntsam.h:204
#define USER_ALL_COUNTRYCODE
Definition: ntsam.h:218
#define USER_ALL_ADMINCOMMENT
Definition: ntsam.h:200
#define USER_ALL_PARAMETERS
Definition: ntsam.h:217
#define USER_ALL_WORKSTATIONS
Definition: ntsam.h:206
#define USER_READ_PREFERENCES
Definition: ntsam.h:127
#define USER_ALL_READ_LOGON_MASK
Definition: ntsam.h:229
#define USER_ALL_USERID
Definition: ntsam.h:198
#define USER_READ_ACCOUNT
Definition: ntsam.h:130
#define USER_ALL_HOMEDIRECTORY
Definition: ntsam.h:202
#define USER_ALL_USERNAME
Definition: ntsam.h:196
#define USER_ALL_PASSWORDCANCHANGE
Definition: ntsam.h:212
#define USER_ALL_PRIVATEDATA
Definition: ntsam.h:222
#define USER_ALL_LMPASSWORDPRESENT
Definition: ntsam.h:221
#define USER_ALL_HOMEDIRECTORYDRIVE
Definition: ntsam.h:203
#define USER_ALL_PASSWORDEXPIRED
Definition: ntsam.h:223
#define USER_ALL_USERCOMMENT
Definition: ntsam.h:201
#define USER_ALL_ACCOUNTEXPIRES
Definition: ntsam.h:215
#define USER_ALL_READ_PREFERENCES_MASK
Definition: ntsam.h:231
#define USER_ALL_READ_ACCOUNT_MASK
Definition: ntsam.h:230
#define USER_ALL_LASTLOGON
Definition: ntsam.h:207
#define USER_ALL_LOGONHOURS
Definition: ntsam.h:209
#define USER_ALL_PASSWORDLASTSET
Definition: ntsam.h:214
#define USER_ALL_PASSWORDMUSTCHANGE
Definition: ntsam.h:213
#define USER_ALL_PRIMARYGROUPID
Definition: ntsam.h:199
#define USER_ALL_USERACCOUNTCONTROL
Definition: ntsam.h:216
#define USER_ALL_FULLNAME
Definition: ntsam.h:197
#define USER_ALL_LASTLOGOFF
Definition: ntsam.h:208
#define USER_ALL_CODEPAGE
Definition: ntsam.h:219
#define USER_ALL_BADPASSWORDCOUNT
Definition: ntsam.h:210
#define USER_ALL_SECURITYDESCRIPTOR
Definition: ntsam.h:224
#define USER_ALL_LOGONCOUNT
Definition: ntsam.h:211
#define USER_ALL_PROFILEPATH
Definition: ntsam.h:205
#define USER_ALL_NTPASSWORDPRESENT
Definition: ntsam.h:220
#define USER_ALL_READ_TRUSTED_MASK
Definition: ntsam.h:232
static LARGE_INTEGER SampAddRelativeTimeToTime(IN LARGE_INTEGER AbsoluteTime, IN LARGE_INTEGER RelativeTime)
Definition: samrpc.c:63
ENCRYPTED_LM_OWF_PASSWORD EmptyLmHash
Definition: samsrv.c:27
ENCRYPTED_NT_OWF_PASSWORD EmptyNtHash
Definition: samsrv.c:26
unsigned short * Buffer
Definition: msv1_0.h:40
unsigned short MaximumLength
Definition: msv1_0.h:39
unsigned short Length
Definition: msv1_0.h:38
unsigned long Length
Definition: msv1_0.h:45
unsigned char * SecurityDescriptor
Definition: msv1_0.h:46
unsigned short BadPasswordCount
Definition: msv1_0.h:105
unsigned short LogonCount
Definition: msv1_0.h:106
OLD_LARGE_INTEGER PasswordMustChange
Definition: msv1_0.h:85
unsigned long PrimaryGroupId
Definition: msv1_0.h:101
OLD_LARGE_INTEGER PasswordLastSet
Definition: msv1_0.h:82
unsigned short CodePage
Definition: msv1_0.h:108
RPC_SHORT_BLOB NtOwfPassword
Definition: msv1_0.h:97
RPC_UNICODE_STRING UserName
Definition: msv1_0.h:86
OLD_LARGE_INTEGER PasswordCanChange
Definition: msv1_0.h:84
unsigned long WhichFields
Definition: msv1_0.h:103
OLD_LARGE_INTEGER LastLogon
Definition: msv1_0.h:80
RPC_UNICODE_STRING Parameters
Definition: msv1_0.h:95
RPC_UNICODE_STRING ProfilePath
Definition: msv1_0.h:91
RPC_UNICODE_STRING PrivateData
Definition: msv1_0.h:98
RPC_UNICODE_STRING FullName
Definition: msv1_0.h:87
RPC_UNICODE_STRING HomeDirectoryDrive
Definition: msv1_0.h:89
SAMPR_LOGON_HOURS LogonHours
Definition: msv1_0.h:104
unsigned short CountryCode
Definition: msv1_0.h:107
RPC_UNICODE_STRING UserComment
Definition: msv1_0.h:94
OLD_LARGE_INTEGER LastLogoff
Definition: msv1_0.h:81
RPC_UNICODE_STRING ScriptPath
Definition: msv1_0.h:90
RPC_UNICODE_STRING AdminComment
Definition: msv1_0.h:92
RPC_UNICODE_STRING HomeDirectory
Definition: msv1_0.h:88
unsigned long UserId
Definition: msv1_0.h:100
unsigned char LmPasswordPresent
Definition: msv1_0.h:109
SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor
Definition: msv1_0.h:99
OLD_LARGE_INTEGER AccountExpires
Definition: msv1_0.h:83
unsigned long UserAccountControl
Definition: msv1_0.h:102
RPC_SHORT_BLOB LmOwfPassword
Definition: msv1_0.h:96
unsigned char NtPasswordPresent
Definition: msv1_0.h:110
RPC_UNICODE_STRING WorkStations
Definition: msv1_0.h:93
RPC_UNICODE_STRING HomeDirectoryDrive
Definition: sam.idl:603
BOOLEAN Trusted
Definition: samsrv.h:55
ACCESS_MASK Access
Definition: samsrv.h:50
struct _SAM_DB_OBJECT * ParentObject
Definition: samsrv.h:56
USHORT CountryCode
Definition: samsrv.h:110
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
SAMPR_USER_HOME_INFORMATION Home
Definition: sam.idl:730
SAMPR_USER_ALL_INFORMATION All
Definition: msv1_0.h:141

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserControl()

static NTSTATUS SampQueryUserControl ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6488 of file samrpc.c.

6490{
6491 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6492 SAM_USER_FIXED_DATA FixedData;
6493 ULONG Length = 0;
6495
6496 *Buffer = NULL;
6497
6498 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6499 if (InfoBuffer == NULL)
6501
6502 Length = sizeof(SAM_USER_FIXED_DATA);
6503 Status = SampGetObjectAttribute(UserObject,
6504 L"F",
6505 NULL,
6506 (PVOID)&FixedData,
6507 &Length);
6508 if (!NT_SUCCESS(Status))
6509 goto done;
6510
6511 InfoBuffer->Control.UserAccountControl = FixedData.UserAccountControl;
6512
6513 *Buffer = InfoBuffer;
6514
6515done:
6516 if (!NT_SUCCESS(Status))
6517 {
6518 if (InfoBuffer != NULL)
6519 {
6520 midl_user_free(InfoBuffer);
6521 }
6522 }
6523
6524 return Status;
6525}
USER_CONTROL_INFORMATION Control
Definition: sam.idl:736

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserExpires()

static NTSTATUS SampQueryUserExpires ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6530 of file samrpc.c.

6532{
6533 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6534 SAM_USER_FIXED_DATA FixedData;
6535 ULONG Length = 0;
6537
6538 *Buffer = NULL;
6539
6540 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6541 if (InfoBuffer == NULL)
6543
6544 Length = sizeof(SAM_USER_FIXED_DATA);
6545 Status = SampGetObjectAttribute(UserObject,
6546 L"F",
6547 NULL,
6548 (PVOID)&FixedData,
6549 &Length);
6550 if (!NT_SUCCESS(Status))
6551 goto done;
6552
6553 InfoBuffer->Expires.AccountExpires.LowPart = FixedData.AccountExpires.LowPart;
6554 InfoBuffer->Expires.AccountExpires.HighPart = FixedData.AccountExpires.HighPart;
6555
6556 *Buffer = InfoBuffer;
6557
6558done:
6559 if (!NT_SUCCESS(Status))
6560 {
6561 if (InfoBuffer != NULL)
6562 {
6563 midl_user_free(InfoBuffer);
6564 }
6565 }
6566
6567 return Status;
6568}
LARGE_INTEGER AccountExpires
Definition: ntsam.h:675
USER_EXPIRES_INFORMATION Expires
Definition: sam.idl:737

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserFullName()

static NTSTATUS SampQueryUserFullName ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6186 of file samrpc.c.

6188{
6189 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6191
6192 *Buffer = NULL;
6193
6194 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6195 if (InfoBuffer == NULL)
6197
6198 /* Get the FullName string */
6200 L"FullName",
6201 &InfoBuffer->FullName.FullName);
6202 if (!NT_SUCCESS(Status))
6203 {
6204 TRACE("Status 0x%08lx\n", Status);
6205 goto done;
6206 }
6207
6208 *Buffer = InfoBuffer;
6209
6210done:
6211 if (!NT_SUCCESS(Status))
6212 {
6213 if (InfoBuffer != NULL)
6214 {
6215 if (InfoBuffer->FullName.FullName.Buffer != NULL)
6217
6218 midl_user_free(InfoBuffer);
6219 }
6220 }
6221
6222 return Status;
6223}
RPC_UNICODE_STRING FullName
Definition: sam.idl:591
SAMPR_USER_F_NAME_INFORMATION FullName
Definition: sam.idl:728

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserGeneral()

static NTSTATUS SampQueryUserGeneral ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 5547 of file samrpc.c.

5549{
5550 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
5551 SAM_USER_FIXED_DATA FixedData;
5552 ULONG Length = 0;
5554
5555 *Buffer = NULL;
5556
5557 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
5558 if (InfoBuffer == NULL)
5560
5561 Length = sizeof(SAM_USER_FIXED_DATA);
5562 Status = SampGetObjectAttribute(UserObject,
5563 L"F",
5564 NULL,
5565 (PVOID)&FixedData,
5566 &Length);
5567 if (!NT_SUCCESS(Status))
5568 goto done;
5569
5570 InfoBuffer->General.PrimaryGroupId = FixedData.PrimaryGroupId;
5571
5572 /* Get the Name string */
5574 L"Name",
5575 &InfoBuffer->General.UserName);
5576 if (!NT_SUCCESS(Status))
5577 {
5578 TRACE("Status 0x%08lx\n", Status);
5579 goto done;
5580 }
5581
5582 /* Get the FullName string */
5584 L"FullName",
5585 &InfoBuffer->General.FullName);
5586 if (!NT_SUCCESS(Status))
5587 {
5588 TRACE("Status 0x%08lx\n", Status);
5589 goto done;
5590 }
5591
5592 /* Get the AdminComment string */
5594 L"AdminComment",
5595 &InfoBuffer->General.AdminComment);
5596 if (!NT_SUCCESS(Status))
5597 {
5598 TRACE("Status 0x%08lx\n", Status);
5599 goto done;
5600 }
5601
5602 /* Get the UserComment string */
5604 L"UserComment",
5605 &InfoBuffer->General.UserComment);
5606 if (!NT_SUCCESS(Status))
5607 {
5608 TRACE("Status 0x%08lx\n", Status);
5609 goto done;
5610 }
5611
5612 *Buffer = InfoBuffer;
5613
5614done:
5615 if (!NT_SUCCESS(Status))
5616 {
5617 if (InfoBuffer != NULL)
5618 {
5619 if (InfoBuffer->General.UserName.Buffer != NULL)
5621
5622 if (InfoBuffer->General.FullName.Buffer != NULL)
5624
5625 if (InfoBuffer->General.AdminComment.Buffer != NULL)
5627
5628 if (InfoBuffer->General.UserComment.Buffer != NULL)
5630
5631 midl_user_free(InfoBuffer);
5632 }
5633 }
5634
5635 return Status;
5636}
RPC_UNICODE_STRING UserName
Definition: sam.idl:520
RPC_UNICODE_STRING AdminComment
Definition: sam.idl:523
unsigned long PrimaryGroupId
Definition: sam.idl:522
RPC_UNICODE_STRING UserComment
Definition: sam.idl:524
RPC_UNICODE_STRING FullName
Definition: sam.idl:521
SAMPR_USER_GENERAL_INFORMATION General
Definition: sam.idl:721

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserHome()

static NTSTATUS SampQueryUserHome ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6269 of file samrpc.c.

6271{
6272 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6274
6275 *Buffer = NULL;
6276
6277 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6278 if (InfoBuffer == NULL)
6280
6281 /* Get the HomeDirectory string */
6283 L"HomeDirectory",
6284 &InfoBuffer->Home.HomeDirectory);
6285 if (!NT_SUCCESS(Status))
6286 {
6287 TRACE("Status 0x%08lx\n", Status);
6288 goto done;
6289 }
6290
6291 /* Get the HomeDirectoryDrive string */
6293 L"HomeDirectoryDrive",
6294 &InfoBuffer->Home.HomeDirectoryDrive);
6295 if (!NT_SUCCESS(Status))
6296 {
6297 TRACE("Status 0x%08lx\n", Status);
6298 goto done;
6299 }
6300
6301 *Buffer = InfoBuffer;
6302
6303done:
6304 if (!NT_SUCCESS(Status))
6305 {
6306 if (InfoBuffer != NULL)
6307 {
6308 if (InfoBuffer->Home.HomeDirectory.Buffer != NULL)
6310
6311 if (InfoBuffer->Home.HomeDirectoryDrive.Buffer != NULL)
6313
6314 midl_user_free(InfoBuffer);
6315 }
6316 }
6317
6318 return Status;
6319}
RPC_UNICODE_STRING HomeDirectory
Definition: sam.idl:602

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserInternal1()

static NTSTATUS SampQueryUserInternal1 ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6573 of file samrpc.c.

6575{
6576 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6577 ULONG Length = 0;
6579
6580 /* Fail, if the caller is not a trusted caller */
6581 if (UserObject->Trusted == FALSE)
6583
6584 *Buffer = NULL;
6585
6586 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6587 if (InfoBuffer == NULL)
6589
6590 InfoBuffer->Internal1.LmPasswordPresent = FALSE;
6591 InfoBuffer->Internal1.NtPasswordPresent = FALSE;
6592
6593 /* Get the NT password */
6594 Length = 0;
6595 SampGetObjectAttribute(UserObject,
6596 L"NTPwd",
6597 NULL,
6598 NULL,
6599 &Length);
6600
6601 if (Length == sizeof(ENCRYPTED_NT_OWF_PASSWORD))
6602 {
6603 Status = SampGetObjectAttribute(UserObject,
6604 L"NTPwd",
6605 NULL,
6607 &Length);
6608 if (!NT_SUCCESS(Status))
6609 goto done;
6610
6611 if (memcmp(&InfoBuffer->Internal1.EncryptedNtOwfPassword,
6612 &EmptyNtHash,
6614 InfoBuffer->Internal1.NtPasswordPresent = TRUE;
6615 }
6616
6617
6618 /* Get the LM password */
6619 Length = 0;
6620 SampGetObjectAttribute(UserObject,
6621 L"LMPwd",
6622 NULL,
6623 NULL,
6624 &Length);
6625
6626 if (Length == sizeof(ENCRYPTED_LM_OWF_PASSWORD))
6627 {
6628 Status = SampGetObjectAttribute(UserObject,
6629 L"LMPwd",
6630 NULL,
6632 &Length);
6633 if (!NT_SUCCESS(Status))
6634 goto done;
6635
6636 if (memcmp(&InfoBuffer->Internal1.EncryptedLmOwfPassword,
6637 &EmptyLmHash,
6639 InfoBuffer->Internal1.LmPasswordPresent = TRUE;
6640 }
6641
6642 InfoBuffer->Internal1.PasswordExpired = FALSE;
6643
6644 *Buffer = InfoBuffer;
6645
6646done:
6647 if (!NT_SUCCESS(Status))
6648 {
6649 if (InfoBuffer != NULL)
6650 {
6651 midl_user_free(InfoBuffer);
6652 }
6653 }
6654
6655 return Status;
6656}
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240
ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword
Definition: sam.idl:640
ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword
Definition: sam.idl:641
SAMPR_USER_INTERNAL1_INFORMATION Internal1
Definition: sam.idl:738

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserInternal2()

static NTSTATUS SampQueryUserInternal2 ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6661 of file samrpc.c.

6663{
6664 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6665 SAM_USER_FIXED_DATA FixedData;
6666 ULONG Length = 0;
6668
6669 *Buffer = NULL;
6670
6671 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6672 if (InfoBuffer == NULL)
6674
6675 Length = sizeof(SAM_USER_FIXED_DATA);
6676 Status = SampGetObjectAttribute(UserObject,
6677 L"F",
6678 NULL,
6679 (PVOID)&FixedData,
6680 &Length);
6681 if (!NT_SUCCESS(Status))
6682 goto done;
6683
6684 InfoBuffer->Internal2.Flags = 0;
6685 InfoBuffer->Internal2.LastLogon.LowPart = FixedData.LastLogon.LowPart;
6686 InfoBuffer->Internal2.LastLogon.HighPart = FixedData.LastLogon.HighPart;
6687 InfoBuffer->Internal2.LastLogoff.LowPart = FixedData.LastLogoff.LowPart;
6688 InfoBuffer->Internal2.LastLogoff.HighPart = FixedData.LastLogoff.HighPart;
6689 InfoBuffer->Internal2.BadPasswordCount = FixedData.BadPasswordCount;
6690 InfoBuffer->Internal2.LogonCount = FixedData.LogonCount;
6691
6692 *Buffer = InfoBuffer;
6693
6694done:
6695 if (!NT_SUCCESS(Status))
6696 {
6697 if (InfoBuffer != NULL)
6698 {
6699 midl_user_free(InfoBuffer);
6700 }
6701 }
6702
6703 return Status;
6704}
OLD_LARGE_INTEGER LastLogon
Definition: msv1_0.h:72
unsigned short BadPasswordCount
Definition: msv1_0.h:74
OLD_LARGE_INTEGER LastLogoff
Definition: msv1_0.h:73
SAMPR_USER_INTERNAL2_INFORMATION Internal2
Definition: msv1_0.h:137

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserLogon()

static NTSTATUS SampQueryUserLogon ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 5697 of file samrpc.c.

5699{
5700 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
5701 SAM_DOMAIN_FIXED_DATA DomainFixedData;
5702 SAM_USER_FIXED_DATA FixedData;
5703 LARGE_INTEGER PasswordCanChange;
5704 LARGE_INTEGER PasswordMustChange;
5705 ULONG Length = 0;
5707
5708 *Buffer = NULL;
5709
5710 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
5711 if (InfoBuffer == NULL)
5713
5714 /* Get the fixed size domain data */
5715 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
5717 L"F",
5718 NULL,
5719 (PVOID)&DomainFixedData,
5720 &Length);
5721 if (!NT_SUCCESS(Status))
5722 goto done;
5723
5724 /* Get the fixed size user data */
5725 Length = sizeof(SAM_USER_FIXED_DATA);
5726 Status = SampGetObjectAttribute(UserObject,
5727 L"F",
5728 NULL,
5729 (PVOID)&FixedData,
5730 &Length);
5731 if (!NT_SUCCESS(Status))
5732 goto done;
5733
5734 InfoBuffer->Logon.UserId = FixedData.UserId;
5735 InfoBuffer->Logon.PrimaryGroupId = FixedData.PrimaryGroupId;
5736 InfoBuffer->Logon.LastLogon.LowPart = FixedData.LastLogon.LowPart;
5737 InfoBuffer->Logon.LastLogon.HighPart = FixedData.LastLogon.HighPart;
5738 InfoBuffer->Logon.LastLogoff.LowPart = FixedData.LastLogoff.LowPart;
5739 InfoBuffer->Logon.LastLogoff.HighPart = FixedData.LastLogoff.HighPart;
5740 InfoBuffer->Logon.PasswordLastSet.LowPart = FixedData.PasswordLastSet.LowPart;
5741 InfoBuffer->Logon.PasswordLastSet.HighPart = FixedData.PasswordLastSet.HighPart;
5742 InfoBuffer->Logon.BadPasswordCount = FixedData.BadPasswordCount;
5743 InfoBuffer->Logon.LogonCount = FixedData.LogonCount;
5744 InfoBuffer->Logon.UserAccountControl = FixedData.UserAccountControl;
5745
5746 PasswordCanChange = SampAddRelativeTimeToTime(FixedData.PasswordLastSet,
5747 DomainFixedData.MinPasswordAge);
5748 InfoBuffer->Logon.PasswordCanChange.LowPart = PasswordCanChange.LowPart;
5749 InfoBuffer->Logon.PasswordCanChange.HighPart = PasswordCanChange.HighPart;
5750
5751 PasswordMustChange = SampAddRelativeTimeToTime(FixedData.PasswordLastSet,
5752 DomainFixedData.MaxPasswordAge);
5753 InfoBuffer->Logon.PasswordMustChange.LowPart = PasswordMustChange.LowPart;
5754 InfoBuffer->Logon.PasswordMustChange.HighPart = PasswordMustChange.HighPart;
5755
5756 /* Get the Name string */
5758 L"Name",
5759 &InfoBuffer->Logon.UserName);
5760 if (!NT_SUCCESS(Status))
5761 {
5762 TRACE("Status 0x%08lx\n", Status);
5763 goto done;
5764 }
5765
5766 /* Get the FullName string */
5768 L"FullName",
5769 &InfoBuffer->Logon.FullName);
5770 if (!NT_SUCCESS(Status))
5771 {
5772 TRACE("Status 0x%08lx\n", Status);
5773 goto done;
5774 }
5775
5776 /* Get the HomeDirectory string */
5778 L"HomeDirectory",
5779 &InfoBuffer->Logon.HomeDirectory);
5780 if (!NT_SUCCESS(Status))
5781 {
5782 TRACE("Status 0x%08lx\n", Status);
5783 goto done;
5784 }
5785
5786 /* Get the HomeDirectoryDrive string */
5788 L"HomeDirectoryDrive",
5789 &InfoBuffer->Logon.HomeDirectoryDrive);
5790 if (!NT_SUCCESS(Status))
5791 {
5792 TRACE("Status 0x%08lx\n", Status);
5793 goto done;
5794 }
5795
5796 /* Get the ScriptPath string */
5798 L"ScriptPath",
5799 &InfoBuffer->Logon.ScriptPath);
5800 if (!NT_SUCCESS(Status))
5801 {
5802 TRACE("Status 0x%08lx\n", Status);
5803 goto done;
5804 }
5805
5806 /* Get the ProfilePath string */
5808 L"ProfilePath",
5809 &InfoBuffer->Logon.ProfilePath);
5810 if (!NT_SUCCESS(Status))
5811 {
5812 TRACE("Status 0x%08lx\n", Status);
5813 goto done;
5814 }
5815
5816 /* Get the WorkStations string */
5818 L"WorkStations",
5819 &InfoBuffer->Logon.WorkStations);
5820 if (!NT_SUCCESS(Status))
5821 {
5822 TRACE("Status 0x%08lx\n", Status);
5823 goto done;
5824 }
5825
5826 /* Get the LogonHours attribute */
5828 &InfoBuffer->Logon.LogonHours);
5829 if (!NT_SUCCESS(Status))
5830 {
5831 TRACE("Status 0x%08lx\n", Status);
5832 goto done;
5833 }
5834
5835 *Buffer = InfoBuffer;
5836
5837done:
5838 if (!NT_SUCCESS(Status))
5839 {
5840 if (InfoBuffer != NULL)
5841 {
5842 if (InfoBuffer->Logon.UserName.Buffer != NULL)
5843 midl_user_free(InfoBuffer->Logon.UserName.Buffer);
5844
5845 if (InfoBuffer->Logon.FullName.Buffer != NULL)
5846 midl_user_free(InfoBuffer->Logon.FullName.Buffer);
5847
5848 if (InfoBuffer->Logon.HomeDirectory.Buffer != NULL)
5850
5851 if (InfoBuffer->Logon.HomeDirectoryDrive.Buffer != NULL)
5853
5854 if (InfoBuffer->Logon.ScriptPath.Buffer != NULL)
5856
5857 if (InfoBuffer->Logon.ProfilePath.Buffer != NULL)
5859
5860 if (InfoBuffer->Logon.WorkStations.Buffer != NULL)
5862
5863 if (InfoBuffer->Logon.LogonHours.LogonHours != NULL)
5865
5866 midl_user_free(InfoBuffer);
5867 }
5868 }
5869
5870 return Status;
5871}
RPC_UNICODE_STRING HomeDirectory
Definition: sam.idl:546
unsigned long PrimaryGroupId
Definition: sam.idl:545
RPC_UNICODE_STRING ProfilePath
Definition: sam.idl:549
unsigned long UserAccountControl
Definition: sam.idl:559
OLD_LARGE_INTEGER PasswordLastSet
Definition: sam.idl:553
unsigned short BadPasswordCount
Definition: sam.idl:557
OLD_LARGE_INTEGER LastLogon
Definition: sam.idl:551
SAMPR_LOGON_HOURS LogonHours
Definition: sam.idl:556
RPC_UNICODE_STRING UserName
Definition: sam.idl:542
RPC_UNICODE_STRING ScriptPath
Definition: sam.idl:548
OLD_LARGE_INTEGER PasswordMustChange
Definition: sam.idl:555
OLD_LARGE_INTEGER PasswordCanChange
Definition: sam.idl:554
unsigned short LogonCount
Definition: sam.idl:558
RPC_UNICODE_STRING FullName
Definition: sam.idl:543
OLD_LARGE_INTEGER LastLogoff
Definition: sam.idl:552
RPC_UNICODE_STRING WorkStations
Definition: sam.idl:550
unsigned long UserId
Definition: sam.idl:544
RPC_UNICODE_STRING HomeDirectoryDrive
Definition: sam.idl:547
SAMPR_USER_LOGON_INFORMATION Logon
Definition: sam.idl:723

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserLogonHours()

static NTSTATUS SampQueryUserLogonHours ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6046 of file samrpc.c.

6048{
6049 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6051
6052 TRACE("(%p %p)\n", UserObject, Buffer);
6053
6054 *Buffer = NULL;
6055
6056 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6057 if (InfoBuffer == NULL)
6058 {
6059 TRACE("Failed to allocate InfoBuffer!\n");
6061 }
6062
6064 &InfoBuffer->LogonHours.LogonHours);
6065 if (!NT_SUCCESS(Status))
6066 {
6067 TRACE("SampGetLogonHoursAttribute failed (Status 0x%08lx)\n", Status);
6068 goto done;
6069 }
6070
6071 *Buffer = InfoBuffer;
6072
6073done:
6074 if (!NT_SUCCESS(Status))
6075 {
6076 if (InfoBuffer != NULL)
6077 {
6078 if (InfoBuffer->LogonHours.LogonHours.LogonHours != NULL)
6080
6081 midl_user_free(InfoBuffer);
6082 }
6083 }
6084
6085 return Status;
6086}
SAMPR_LOGON_HOURS LogonHours
Definition: sam.idl:635
SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours
Definition: sam.idl:724

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserName()

static NTSTATUS SampQueryUserName ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6091 of file samrpc.c.

6093{
6094 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6096
6097 *Buffer = NULL;
6098
6099 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6100 if (InfoBuffer == NULL)
6102
6103 /* Get the Name string */
6105 L"Name",
6106 &InfoBuffer->Name.UserName);
6107 if (!NT_SUCCESS(Status))
6108 {
6109 TRACE("Status 0x%08lx\n", Status);
6110 goto done;
6111 }
6112
6113 /* Get the FullName string */
6115 L"FullName",
6116 &InfoBuffer->Name.FullName);
6117 if (!NT_SUCCESS(Status))
6118 {
6119 TRACE("Status 0x%08lx\n", Status);
6120 goto done;
6121 }
6122
6123 *Buffer = InfoBuffer;
6124
6125done:
6126 if (!NT_SUCCESS(Status))
6127 {
6128 if (InfoBuffer != NULL)
6129 {
6130 if (InfoBuffer->Name.UserName.Buffer != NULL)
6131 midl_user_free(InfoBuffer->Name.UserName.Buffer);
6132
6133 if (InfoBuffer->Name.FullName.Buffer != NULL)
6134 midl_user_free(InfoBuffer->Name.FullName.Buffer);
6135
6136 midl_user_free(InfoBuffer);
6137 }
6138 }
6139
6140 return Status;
6141}
RPC_UNICODE_STRING FullName
Definition: sam.idl:597
RPC_UNICODE_STRING UserName
Definition: sam.idl:596
SAMPR_USER_NAME_INFORMATION Name
Definition: sam.idl:726

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserParameters()

static NTSTATUS SampQueryUserParameters ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6708 of file samrpc.c.

6710{
6711 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6713
6714 *Buffer = NULL;
6715
6716 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6717 if (InfoBuffer == NULL)
6719
6720 /* Get the Parameters string */
6722 L"Parameters",
6723 &InfoBuffer->Parameters.Parameters);
6724 if (!NT_SUCCESS(Status))
6725 {
6726 TRACE("Status 0x%08lx\n", Status);
6727 goto done;
6728 }
6729
6730 *Buffer = InfoBuffer;
6731
6732done:
6733 if (!NT_SUCCESS(Status))
6734 {
6735 if (InfoBuffer != NULL)
6736 {
6737 if (InfoBuffer->Parameters.Parameters.Buffer != NULL)
6739
6740 midl_user_free(InfoBuffer);
6741 }
6742 }
6743
6744 return Status;
6745}
RPC_UNICODE_STRING Parameters
Definition: sam.idl:537
SAMPR_USER_PARAMETERS_INFORMATION Parameters
Definition: sam.idl:740

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserPreferences()

static NTSTATUS SampQueryUserPreferences ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 5641 of file samrpc.c.

5643{
5644 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
5645 SAM_USER_FIXED_DATA FixedData;
5646 ULONG Length = 0;
5648
5649 *Buffer = NULL;
5650
5651 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
5652 if (InfoBuffer == NULL)
5654
5655 Length = sizeof(SAM_USER_FIXED_DATA);
5656 Status = SampGetObjectAttribute(UserObject,
5657 L"F",
5658 NULL,
5659 (PVOID)&FixedData,
5660 &Length);
5661 if (!NT_SUCCESS(Status))
5662 goto done;
5663
5664 InfoBuffer->Preferences.CountryCode = FixedData.CountryCode;
5665 InfoBuffer->Preferences.CodePage = FixedData.CodePage;
5666
5667 /* Get the UserComment string */
5669 L"UserComment",
5670 &InfoBuffer->Preferences.UserComment);
5671 if (!NT_SUCCESS(Status))
5672 {
5673 TRACE("Status 0x%08lx\n", Status);
5674 goto done;
5675 }
5676
5677 *Buffer = InfoBuffer;
5678
5679done:
5680 if (!NT_SUCCESS(Status))
5681 {
5682 if (InfoBuffer != NULL)
5683 {
5684 if (InfoBuffer->Preferences.UserComment.Buffer != NULL)
5686
5687 midl_user_free(InfoBuffer);
5688 }
5689 }
5690
5691 return Status;
5692}
RPC_UNICODE_STRING UserComment
Definition: sam.idl:529
SAMPR_USER_PREFERENCES_INFORMATION Preferences
Definition: sam.idl:722

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserPrimaryGroup()

static NTSTATUS SampQueryUserPrimaryGroup ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6228 of file samrpc.c.

6230{
6231 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6232 SAM_USER_FIXED_DATA FixedData;
6233 ULONG Length = 0;
6235
6236 *Buffer = NULL;
6237
6238 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6239 if (InfoBuffer == NULL)
6241
6242 Length = sizeof(SAM_USER_FIXED_DATA);
6243 Status = SampGetObjectAttribute(UserObject,
6244 L"F",
6245 NULL,
6246 (PVOID)&FixedData,
6247 &Length);
6248 if (!NT_SUCCESS(Status))
6249 goto done;
6250
6251 InfoBuffer->PrimaryGroup.PrimaryGroupId = FixedData.PrimaryGroupId;
6252
6253 *Buffer = InfoBuffer;
6254
6255done:
6256 if (!NT_SUCCESS(Status))
6257 {
6258 if (InfoBuffer != NULL)
6259 {
6260 midl_user_free(InfoBuffer);
6261 }
6262 }
6263
6264 return Status;
6265}
USER_PRIMARY_GROUP_INFORMATION PrimaryGroup
Definition: sam.idl:729

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserProfile()

static NTSTATUS SampQueryUserProfile ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6364 of file samrpc.c.

6366{
6367 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6369
6370 *Buffer = NULL;
6371
6372 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6373 if (InfoBuffer == NULL)
6375
6376 /* Get the ProfilePath string */
6378 L"ProfilePath",
6379 &InfoBuffer->Profile.ProfilePath);
6380 if (!NT_SUCCESS(Status))
6381 {
6382 TRACE("Status 0x%08lx\n", Status);
6383 goto done;
6384 }
6385
6386 *Buffer = InfoBuffer;
6387
6388done:
6389 if (!NT_SUCCESS(Status))
6390 {
6391 if (InfoBuffer != NULL)
6392 {
6393 if (InfoBuffer->Profile.ProfilePath.Buffer != NULL)
6395
6396 midl_user_free(InfoBuffer);
6397 }
6398 }
6399
6400 return Status;
6401}
RPC_UNICODE_STRING ProfilePath
Definition: sam.idl:613
SAMPR_USER_PROFILE_INFORMATION Profile
Definition: sam.idl:732

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserScript()

static NTSTATUS SampQueryUserScript ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6323 of file samrpc.c.

6325{
6326 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6328
6329 *Buffer = NULL;
6330
6331 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6332 if (InfoBuffer == NULL)
6334
6335 /* Get the ScriptPath string */
6337 L"ScriptPath",
6338 &InfoBuffer->Script.ScriptPath);
6339 if (!NT_SUCCESS(Status))
6340 {
6341 TRACE("Status 0x%08lx\n", Status);
6342 goto done;
6343 }
6344
6345 *Buffer = InfoBuffer;
6346
6347done:
6348 if (!NT_SUCCESS(Status))
6349 {
6350 if (InfoBuffer != NULL)
6351 {
6352 if (InfoBuffer->Script.ScriptPath.Buffer != NULL)
6354
6355 midl_user_free(InfoBuffer);
6356 }
6357 }
6358
6359 return Status;
6360}
RPC_UNICODE_STRING ScriptPath
Definition: sam.idl:608
SAMPR_USER_SCRIPT_INFORMATION Script
Definition: sam.idl:731

Referenced by SamrQueryInformationUser2().

◆ SampQueryUserWorkStations()

static NTSTATUS SampQueryUserWorkStations ( PSAM_DB_OBJECT  UserObject,
PSAMPR_USER_INFO_BUFFER Buffer 
)
static

Definition at line 6446 of file samrpc.c.

6448{
6449 PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
6451
6452 *Buffer = NULL;
6453
6454 InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
6455 if (InfoBuffer == NULL)
6457
6458 /* Get the WorkStations string */
6460 L"WorkStations",
6461 &InfoBuffer->WorkStations.WorkStations);
6462 if (!NT_SUCCESS(Status))
6463 {
6464 TRACE("Status 0x%08lx\n", Status);
6465 goto done;
6466 }
6467
6468 *Buffer = InfoBuffer;
6469
6470done:
6471 if (!NT_SUCCESS(Status))
6472 {
6473 if (InfoBuffer != NULL)
6474 {
6475 if (InfoBuffer->WorkStations.WorkStations.Buffer != NULL)
6477
6478 midl_user_free(InfoBuffer);
6479 }
6480 }
6481
6482 return Status;
6483}
RPC_UNICODE_STRING WorkStations
Definition: sam.idl:623
SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations
Definition: sam.idl:734

Referenced by SamrQueryInformationUser2().

◆ SAMPR_HANDLE_rundown()

void __RPC_USER SAMPR_HANDLE_rundown ( SAMPR_HANDLE  hHandle)

Definition at line 126 of file samrpc.c.

127{
128 FIXME("SAMPR_HANDLE_rundown(%p)\n", hHandle);
129}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ SampSetAliasName()

static NTSTATUS SampSetAliasName ( PSAM_DB_OBJECT  AliasObject,
PSAMPR_ALIAS_INFO_BUFFER  Buffer 
)
static

Definition at line 5095 of file samrpc.c.

5097{
5098 UNICODE_STRING OldAliasName = {0, 0, NULL};
5099 UNICODE_STRING NewAliasName;
5101
5103 L"Name",
5104 (PRPC_UNICODE_STRING)&OldAliasName);
5105 if (!NT_SUCCESS(Status))
5106 {
5107 TRACE("SampGetObjectAttributeString failed (Status 0x%08lx)\n", Status);
5108 goto done;
5109 }
5110
5111 /* Check the new account name */
5112 Status = SampCheckAccountName(&Buffer->Name.Name, 256);
5113 if (!NT_SUCCESS(Status))
5114 {
5115 TRACE("SampCheckAccountName failed (Status 0x%08lx)\n", Status);
5116 return Status;
5117 }
5118
5119 NewAliasName.Length = Buffer->Name.Name.Length;
5120 NewAliasName.MaximumLength = Buffer->Name.Name.MaximumLength;
5121 NewAliasName.Buffer = Buffer->Name.Name.Buffer;
5122
5123 if (!RtlEqualUnicodeString(&OldAliasName, &NewAliasName, TRUE))
5124 {
5126 NewAliasName.Buffer);
5127 if (!NT_SUCCESS(Status))
5128 {
5129 TRACE("Alias name \'%S\' already exists in domain (Status 0x%08lx)\n",
5130 NewAliasName.Buffer, Status);
5131 goto done;
5132 }
5133 }
5134
5136 L"Aliases",
5137 NewAliasName.Buffer,
5138 AliasObject->RelativeId);
5139 if (!NT_SUCCESS(Status))
5140 {
5141 TRACE("SampSetAccountNameInDomain failed (Status 0x%08lx)\n", Status);
5142 goto done;
5143 }
5144
5146 L"Aliases",
5147 OldAliasName.Buffer);
5148 if (!NT_SUCCESS(Status))
5149 {
5150 TRACE("SampRemoveAccountNameFromDomain failed (Status 0x%08lx)\n", Status);
5151 goto done;
5152 }
5153
5155 L"Name",
5156 (PRPC_UNICODE_STRING)&NewAliasName);
5157 if (!NT_SUCCESS(Status))
5158 {
5159 TRACE("SampSetObjectAttribute failed (Status 0x%08lx)\n", Status);
5160 }
5161
5162done:
5163 if (OldAliasName.Buffer != NULL)
5164 midl_user_free(OldAliasName.Buffer);
5165
5166 return Status;
5167}
NTSTATUS SampSetObjectAttributeString(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PRPC_UNICODE_STRING String)
Definition: database.c:595
NTSTATUS SampSetAccountNameInDomain(IN PSAM_DB_OBJECT DomainObject, IN LPCWSTR lpContainerName, IN LPCWSTR lpAccountName, IN ULONG ulRelativeId)
Definition: domain.c:14
NTSTATUS SampRemoveAccountNameFromDomain(IN PSAM_DB_OBJECT DomainObject, IN LPCWSTR lpContainerName, IN LPCWSTR lpAccountName)
Definition: domain.c:57
NTSTATUS SampCheckAccountNameInDomain(IN PSAM_DB_OBJECT DomainObject, IN LPCWSTR lpAccountName)
Definition: domain.c:96
NTSTATUS SampCheckAccountName(IN PRPC_UNICODE_STRING AccountName, IN USHORT MaxLength)
Definition: utils.c:154
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
ULONG RelativeId
Definition: samsrv.h:54
USHORT MaximumLength
Definition: env_spec_w32.h:370

Referenced by SamrSetInformationAlias().

◆ SampSetDomainLockout()

static NTSTATUS SampSetDomainLockout ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER  Buffer 
)
static

Definition at line 1756 of file samrpc.c.

1758{
1759 SAM_DOMAIN_FIXED_DATA FixedData;
1760 ULONG Length = 0;
1762
1763 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1764 Status = SampGetObjectAttribute(DomainObject,
1765 L"F",
1766 NULL,
1767 (PVOID)&FixedData,
1768 &Length);
1769 if (!NT_SUCCESS(Status))
1770 goto done;
1771
1772 FixedData.LockoutDuration = Buffer->Lockout.LockoutDuration;
1773 FixedData.LockoutObservationWindow = Buffer->Lockout.LockoutObservationWindow;
1774 FixedData.LockoutThreshold = Buffer->Lockout.LockoutThreshold;
1775
1776 Status = SampSetObjectAttribute(DomainObject,
1777 L"F",
1778 REG_BINARY,
1779 &FixedData,
1780 Length);
1781
1782done:
1783 return Status;
1784}
NTSTATUS SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, ULONG AttributeType, LPVOID AttributeData, ULONG AttributeSize)
Definition: database.c:501
#define REG_BINARY
Definition: nt_native.h:1496

Referenced by SamrSetInformationDomain().

◆ SampSetDomainLogoff()

static NTSTATUS SampSetDomainLogoff ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER  Buffer 
)
static

Definition at line 1665 of file samrpc.c.

1667{
1668 SAM_DOMAIN_FIXED_DATA FixedData;
1669 ULONG Length = 0;
1671
1672 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1673 Status = SampGetObjectAttribute(DomainObject,
1674 L"F",
1675 NULL,
1676 (PVOID)&FixedData,
1677 &Length);
1678 if (!NT_SUCCESS(Status))
1679 goto done;
1680
1681 FixedData.ForceLogoff.LowPart = Buffer->Logoff.ForceLogoff.LowPart;
1682 FixedData.ForceLogoff.HighPart = Buffer->Logoff.ForceLogoff.HighPart;
1683
1684 Status = SampSetObjectAttribute(DomainObject,
1685 L"F",
1686 REG_BINARY,
1687 &FixedData,
1688 Length);
1689
1690done:
1691 return Status;
1692}

Referenced by SamrSetInformationDomain().

◆ SampSetDomainPassword()

static NTSTATUS SampSetDomainPassword ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER  Buffer 
)
static

Definition at line 1629 of file samrpc.c.

1631{
1632 SAM_DOMAIN_FIXED_DATA FixedData;
1633 ULONG Length = 0;
1635
1636 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1637 Status = SampGetObjectAttribute(DomainObject,
1638 L"F",
1639 NULL,
1640 (PVOID)&FixedData,
1641 &Length);
1642 if (!NT_SUCCESS(Status))
1643 goto done;
1644
1645 FixedData.MinPasswordLength = Buffer->Password.MinPasswordLength;
1646 FixedData.PasswordHistoryLength = Buffer->Password.PasswordHistoryLength;
1647 FixedData.PasswordProperties = Buffer->Password.PasswordProperties;
1648 FixedData.MaxPasswordAge.LowPart = Buffer->Password.MaxPasswordAge.LowPart;
1649 FixedData.MaxPasswordAge.HighPart = Buffer->Password.MaxPasswordAge.HighPart;
1650 FixedData.MinPasswordAge.LowPart = Buffer->Password.MinPasswordAge.LowPart;
1651 FixedData.MinPasswordAge.HighPart = Buffer->Password.MinPasswordAge.HighPart;
1652
1653 Status = SampSetObjectAttribute(DomainObject,
1654 L"F",
1655 REG_BINARY,
1656 &FixedData,
1657 Length);
1658
1659done:
1660 return Status;
1661}

Referenced by SamrSetInformationDomain().

◆ SampSetDomainServerRole()

static NTSTATUS SampSetDomainServerRole ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER  Buffer 
)
static

Definition at line 1696 of file samrpc.c.

1698{
1699 SAM_DOMAIN_FIXED_DATA FixedData;
1700 ULONG Length = 0;
1702
1703 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1704 Status = SampGetObjectAttribute(DomainObject,
1705 L"F",
1706 NULL,
1707 (PVOID)&FixedData,
1708 &Length);
1709 if (!NT_SUCCESS(Status))
1710 goto done;
1711
1712 FixedData.DomainServerRole = Buffer->Role.DomainServerRole;
1713
1714 Status = SampSetObjectAttribute(DomainObject,
1715 L"F",
1716 REG_BINARY,
1717 &FixedData,
1718 Length);
1719
1720done:
1721 return Status;
1722}

Referenced by SamrSetInformationDomain().

◆ SampSetDomainState()

static NTSTATUS SampSetDomainState ( PSAM_DB_OBJECT  DomainObject,
PSAMPR_DOMAIN_INFO_BUFFER  Buffer 
)
static

Definition at line 1726 of file samrpc.c.

1728{
1729 SAM_DOMAIN_FIXED_DATA FixedData;
1730 ULONG Length = 0;
1732
1733 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
1734 Status = SampGetObjectAttribute(DomainObject,
1735 L"F",
1736 NULL,
1737 (PVOID)&FixedData,
1738 &Length);
1739 if (!NT_SUCCESS(Status))
1740 goto done;
1741
1742 FixedData.DomainServerState = Buffer->State.DomainServerState;
1743
1744 Status = SampSetObjectAttribute(DomainObject,
1745 L"F",
1746 REG_BINARY,
1747 &FixedData,
1748 Length);
1749
1750done:
1751 return Status;
1752}

Referenced by SamrSetInformationDomain().

◆ SampSetGroupAttribute()

static NTSTATUS SampSetGroupAttribute ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER  Buffer 
)
static

Definition at line 4384 of file samrpc.c.

4386{
4387 SAM_GROUP_FIXED_DATA FixedData;
4388 ULONG Length = 0;
4390
4391 Length = sizeof(SAM_GROUP_FIXED_DATA);
4392 Status = SampGetObjectAttribute(GroupObject,
4393 L"F",
4394 NULL,
4395 (PVOID)&FixedData,
4396 &Length);
4397 if (!NT_SUCCESS(Status))
4398 goto done;
4399
4400 FixedData.Attributes = Buffer->Attribute.Attributes;
4401
4402 Status = SampSetObjectAttribute(GroupObject,
4403 L"F",
4404 REG_BINARY,
4405 &FixedData,
4406 Length);
4407
4408done:
4409 return Status;
4410}

Referenced by SamrSetInformationGroup().

◆ SampSetGroupName()

static NTSTATUS SampSetGroupName ( PSAM_DB_OBJECT  GroupObject,
PSAMPR_GROUP_INFO_BUFFER  Buffer 
)
stati