ReactOS 0.4.16-dev-319-g6cf4263
msv1_0.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RPC_SID
 
struct  _RPC_UNICODE_STRING
 
struct  _OLD_LARGE_INTEGER
 
struct  RPC_SHORT_BLOB
 
struct  _SAMPR_SR_SECURITY_DESCRIPTOR
 
struct  _ENCRYPTED_LM_OWF_PASSWORD
 
struct  _SAMPR_ULONG_ARRAY
 
struct  _SAMPR_LOGON_HOURS
 
struct  _SAMPR_USER_INTERNAL2_INFORMATION
 
struct  _SAMPR_USER_ALL_INFORMATION
 
union  _SAMPR_USER_INFO_BUFFER
 
struct  _LSAPR_POLICY_AUDIT_EVENTS_INFO
 
struct  _LSAPR_POLICY_PRIMARY_DOM_INFO
 
struct  _LSAPR_POLICY_ACCOUNT_DOM_INFO
 
struct  _LSAPR_POLICY_PD_ACCOUNT_INFO
 
struct  _POLICY_LSA_REPLICA_SRCE_INFO
 
struct  _LSAPR_POLICY_DNS_DOMAIN_INFO
 
union  _LSAPR_POLICY_INFORMATION
 

Macros

#define FIXUP_POINTER(Pointer, Offset)   ((Pointer != NULL) ? ((PWSTR)((ULONG_PTR)Pointer + Offset)) : NULL)
 
#define USER_LOGON_BAD_PASSWORD   0x08000000
 
#define USER_LOGON_SUCCESS   0x10000000
 

Typedefs

typedef struct _RPC_SID RPC_SID
 
typedef struct _RPC_SIDPRPC_SID
 
typedef struct _RPC_UNICODE_STRING RPC_UNICODE_STRING
 
typedef struct _RPC_UNICODE_STRINGPRPC_UNICODE_STRING
 
typedef wchar_tPSAMPR_SERVER_NAME
 
typedef voidSAMPR_HANDLE
 
typedef struct _OLD_LARGE_INTEGER OLD_LARGE_INTEGER
 
typedef struct _OLD_LARGE_INTEGERPOLD_LARGE_INTEGER
 
typedef struct RPC_SHORT_BLOB RPC_SHORT_BLOB
 
typedef struct RPC_SHORT_BLOBPRPC_SHORT_BLOB
 
typedef struct _SAMPR_SR_SECURITY_DESCRIPTOR SAMPR_SR_SECURITY_DESCRIPTOR
 
typedef struct _SAMPR_SR_SECURITY_DESCRIPTORPSAMPR_SR_SECURITY_DESCRIPTOR
 
typedef struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
 
typedef struct _ENCRYPTED_LM_OWF_PASSWORDPENCRYPTED_LM_OWF_PASSWORD
 
typedef struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
 
typedef struct _ENCRYPTED_LM_OWF_PASSWORDPENCRYPTED_NT_OWF_PASSWORD
 
typedef struct _SAMPR_ULONG_ARRAY SAMPR_ULONG_ARRAY
 
typedef struct _SAMPR_ULONG_ARRAYPSAMPR_ULONG_ARRAY
 
typedef struct _SAMPR_LOGON_HOURS SAMPR_LOGON_HOURS
 
typedef struct _SAMPR_LOGON_HOURSPSAMPR_LOGON_HOURS
 
typedef struct _SAMPR_USER_INTERNAL2_INFORMATION SAMPR_USER_INTERNAL2_INFORMATION
 
typedef struct _SAMPR_USER_INTERNAL2_INFORMATIONPSAMPR_USER_INTERNAL2_INFORMATION
 
typedef struct _SAMPR_USER_ALL_INFORMATION SAMPR_USER_ALL_INFORMATION
 
typedef struct _SAMPR_USER_ALL_INFORMATIONPSAMPR_USER_ALL_INFORMATION
 
typedef union _SAMPR_USER_INFO_BUFFER SAMPR_USER_INFO_BUFFER
 
typedef union _SAMPR_USER_INFO_BUFFERPSAMPR_USER_INFO_BUFFER
 
typedef PVOID LSAPR_HANDLE
 
typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO LSAPR_POLICY_AUDIT_EVENTS_INFO
 
typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFOPLSAPR_POLICY_AUDIT_EVENTS_INFO
 
typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFO LSAPR_POLICY_PRIMARY_DOM_INFO
 
typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFOPLSAPR_POLICY_PRIMARY_DOM_INFO
 
typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFO LSAPR_POLICY_ACCOUNT_DOM_INFO
 
typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFOPLSAPR_POLICY_ACCOUNT_DOM_INFO
 
typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFO LSAPR_POLICY_PD_ACCOUNT_INFO
 
typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFOPLSAPR_POLICY_PD_ACCOUNT_INFO
 
typedef struct _POLICY_LSA_REPLICA_SRCE_INFO POLICY_LSA_REPLICA_SRCE_INFO
 
typedef struct _POLICY_LSA_REPLICA_SRCE_INFOPPOLICY_LSA_REPLICA_SRCE_INFO
 
typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFO LSAPR_POLICY_DNS_DOMAIN_INFO
 
typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFOPLSAPR_POLICY_DNS_DOMAIN_INFO
 
typedef union _LSAPR_POLICY_INFORMATION LSAPR_POLICY_INFORMATION
 
typedef union _LSAPR_POLICY_INFORMATIONPLSAPR_POLICY_INFORMATION
 

Functions

NTSTATUS NTAPI SamIConnect (IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN ACCESS_MASK DesiredAccess, IN BOOLEAN Trusted)
 
VOID NTAPI SamIFreeVoid (PVOID Ptr)
 
VOID NTAPI SamIFree_SAMPR_ULONG_ARRAY (PSAMPR_ULONG_ARRAY Ptr)
 
VOID NTAPI SamIFree_SAMPR_USER_INFO_BUFFER (PSAMPR_USER_INFO_BUFFER Ptr, USER_INFORMATION_CLASS InformationClass)
 
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 SamrCloseHandle (IN OUT SAMPR_HANDLE *SamHandle)
 
NTSTATUS NTAPI SamrLookupDomainInSamServer (IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
 
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 SamrOpenDomain (IN SAMPR_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PRPC_SID DomainId, OUT SAMPR_HANDLE *DomainHandle)
 
NTSTATUS NTAPI SamrOpenUser (IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT SAMPR_HANDLE *UserHandle)
 
NTSTATUS NTAPI SamrQueryInformationUser (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
 
NTSTATUS NTAPI SamrSetInformationUser (IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
 
VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION (IN POLICY_INFORMATION_CLASS InformationClass, IN PLSAPR_POLICY_INFORMATION PolicyInformation)
 
NTSTATUS WINAPI LsaIOpenPolicyTrusted (OUT LSAPR_HANDLE *PolicyHandle)
 
NTSTATUS WINAPI LsarClose (IN OUT LSAPR_HANDLE *ObjectHandle)
 
NTSTATUS WINAPI LsarLookupPrivilegeValue (IN LSAPR_HANDLE PolicyHandle, IN PRPC_UNICODE_STRING Name, OUT PLUID Value)
 
NTSTATUS WINAPI LsarQueryInformationPolicy (IN LSAPR_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PLSAPR_POLICY_INFORMATION *PolicyInformation)
 
NTSTATUS WINAPI SystemFunction006 (LPCSTR password, LPSTR hash)
 
NTSTATUS WINAPI SystemFunction007 (PUNICODE_STRING string, LPBYTE hash)
 
NTSTATUS WINAPI SystemFunction012 (const BYTE *in, const BYTE *key, LPBYTE out)
 
NTSTATUS NTAPI LsaApCallPackage (_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ PVOID ProtocolSubmitBuffer, _In_ PVOID ClientBufferBase, _In_ ULONG SubmitBufferLength, _Out_ PVOID *ProtocolReturnBuffer, _Out_ PULONG ReturnBufferLength, _Out_ PNTSTATUS ProtocolStatus)
 
NTSTATUS NTAPI LsaApCallPackagePassthrough (_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ PVOID ProtocolSubmitBuffer, _In_ PVOID ClientBufferBase, _In_ ULONG SubmitBufferLength, _Out_ PVOID *ProtocolReturnBuffer, _Out_ PULONG ReturnBufferLength, _Out_ PNTSTATUS ProtocolStatus)
 
NTSTATUS NTAPI LsaApCallPackageUntrusted (_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ PVOID ProtocolSubmitBuffer, _In_ PVOID ClientBufferBase, _In_ ULONG SubmitBufferLength, _Out_ PVOID *ProtocolReturnBuffer, _Out_ PULONG ReturnBufferLength, _Out_ PNTSTATUS ProtocolStatus)
 
VOID NTAPI LsaApLogonTerminated (_In_ PLUID LogonId)
 
NTSTATUS NTAPI LsaApLogonUserEx2 (_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ SECURITY_LOGON_TYPE LogonType, _In_ PVOID ProtocolSubmitBuffer, _In_ PVOID ClientBufferBase, _In_ ULONG SubmitBufferSize, _Out_ PVOID *ProfileBuffer, _Out_ PULONG ProfileBufferSize, _Out_ PLUID LogonId, _Out_ PNTSTATUS SubStatus, _Out_ PLSA_TOKEN_INFORMATION_TYPE TokenInformationType, _Out_ PVOID *TokenInformation, _Out_ PUNICODE_STRING *AccountName, _Out_ PUNICODE_STRING *AuthenticatingAuthority, _Out_ PUNICODE_STRING *MachineName, _Out_ PSECPKG_PRIMARY_CRED PrimaryCredentials, _Out_ PSECPKG_SUPPLEMENTAL_CRED_ARRAY *SupplementalCredentials)
 

Macro Definition Documentation

◆ FIXUP_POINTER

#define FIXUP_POINTER (   Pointer,
  Offset 
)    ((Pointer != NULL) ? ((PWSTR)((ULONG_PTR)Pointer + Offset)) : NULL)

Definition at line 9 of file msv1_0.h.

◆ USER_LOGON_BAD_PASSWORD

#define USER_LOGON_BAD_PASSWORD   0x08000000

Definition at line 648 of file sam.idl.

◆ USER_LOGON_SUCCESS

#define USER_LOGON_SUCCESS   0x10000000

Definition at line 649 of file sam.idl.

Typedef Documentation

◆ ENCRYPTED_LM_OWF_PASSWORD

◆ ENCRYPTED_NT_OWF_PASSWORD

◆ LSAPR_HANDLE

Definition at line 229 of file msv1_0.h.

◆ LSAPR_POLICY_ACCOUNT_DOM_INFO

◆ LSAPR_POLICY_AUDIT_EVENTS_INFO

◆ LSAPR_POLICY_DNS_DOMAIN_INFO

◆ LSAPR_POLICY_INFORMATION

◆ LSAPR_POLICY_PD_ACCOUNT_INFO

◆ LSAPR_POLICY_PRIMARY_DOM_INFO

◆ OLD_LARGE_INTEGER

◆ PENCRYPTED_LM_OWF_PASSWORD

◆ PENCRYPTED_NT_OWF_PASSWORD

◆ PLSAPR_POLICY_ACCOUNT_DOM_INFO

◆ PLSAPR_POLICY_AUDIT_EVENTS_INFO

◆ PLSAPR_POLICY_DNS_DOMAIN_INFO

◆ PLSAPR_POLICY_INFORMATION

◆ PLSAPR_POLICY_PD_ACCOUNT_INFO

◆ PLSAPR_POLICY_PRIMARY_DOM_INFO

◆ POLD_LARGE_INTEGER

◆ POLICY_LSA_REPLICA_SRCE_INFO

◆ PPOLICY_LSA_REPLICA_SRCE_INFO

◆ PRPC_SHORT_BLOB

◆ PRPC_SID

◆ PRPC_UNICODE_STRING

◆ PSAMPR_LOGON_HOURS

◆ PSAMPR_SERVER_NAME

Definition at line 27 of file msv1_0.h.

◆ PSAMPR_SR_SECURITY_DESCRIPTOR

◆ PSAMPR_ULONG_ARRAY

◆ PSAMPR_USER_ALL_INFORMATION

◆ PSAMPR_USER_INFO_BUFFER

◆ PSAMPR_USER_INTERNAL2_INFORMATION

◆ RPC_SHORT_BLOB

◆ RPC_SID

◆ RPC_UNICODE_STRING

◆ SAMPR_HANDLE

typedef void* SAMPR_HANDLE

Definition at line 28 of file msv1_0.h.

◆ SAMPR_LOGON_HOURS

◆ SAMPR_SR_SECURITY_DESCRIPTOR

◆ SAMPR_ULONG_ARRAY

◆ SAMPR_USER_ALL_INFORMATION

◆ SAMPR_USER_INFO_BUFFER

◆ SAMPR_USER_INTERNAL2_INFORMATION

Function Documentation

◆ LsaApCallPackage()

NTSTATUS NTAPI LsaApCallPackage ( _In_ PLSA_CLIENT_REQUEST  ClientRequest,
_In_ PVOID  ProtocolSubmitBuffer,
_In_ PVOID  ClientBufferBase,
_In_ ULONG  SubmitBufferLength,
_Out_ PVOID ProtocolReturnBuffer,
_Out_ PULONG  ReturnBufferLength,
_Out_ PNTSTATUS  ProtocolStatus 
)

◆ LsaApCallPackagePassthrough()

NTSTATUS NTAPI LsaApCallPackagePassthrough ( _In_ PLSA_CLIENT_REQUEST  ClientRequest,
_In_ PVOID  ProtocolSubmitBuffer,
_In_ PVOID  ClientBufferBase,
_In_ ULONG  SubmitBufferLength,
_Out_ PVOID ProtocolReturnBuffer,
_Out_ PULONG  ReturnBufferLength,
_Out_ PNTSTATUS  ProtocolStatus 
)

◆ LsaApCallPackageUntrusted()

NTSTATUS NTAPI LsaApCallPackageUntrusted ( _In_ PLSA_CLIENT_REQUEST  ClientRequest,
_In_ PVOID  ProtocolSubmitBuffer,
_In_ PVOID  ClientBufferBase,
_In_ ULONG  SubmitBufferLength,
_Out_ PVOID ProtocolReturnBuffer,
_Out_ PULONG  ReturnBufferLength,
_Out_ PNTSTATUS  ProtocolStatus 
)

◆ LsaApLogonTerminated()

VOID NTAPI LsaApLogonTerminated ( _In_ PLUID  LogonId)

◆ LsaApLogonUserEx2()

NTSTATUS NTAPI LsaApLogonUserEx2 ( _In_ PLSA_CLIENT_REQUEST  ClientRequest,
_In_ SECURITY_LOGON_TYPE  LogonType,
_In_ PVOID  ProtocolSubmitBuffer,
_In_ PVOID  ClientBufferBase,
_In_ ULONG  SubmitBufferSize,
_Out_ PVOID ProfileBuffer,
_Out_ PULONG  ProfileBufferSize,
_Out_ PLUID  LogonId,
_Out_ PNTSTATUS  SubStatus,
_Out_ PLSA_TOKEN_INFORMATION_TYPE  TokenInformationType,
_Out_ PVOID TokenInformation,
_Out_ PUNICODE_STRING AccountName,
_Out_ PUNICODE_STRING AuthenticatingAuthority,
_Out_ PUNICODE_STRING MachineName,
_Out_ PSECPKG_PRIMARY_CRED  PrimaryCredentials,
_Out_ PSECPKG_SUPPLEMENTAL_CRED_ARRAY SupplementalCredentials 
)

◆ LsaIFree_LSAPR_POLICY_INFORMATION()

VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION ( IN POLICY_INFORMATION_CLASS  InformationClass,
IN PLSAPR_POLICY_INFORMATION  PolicyInformation 
)

Definition at line 51 of file lsasrv.c.

53{
54 if (PolicyInformation != NULL)
55 {
56 switch (InformationClass)
57 {
58 case PolicyAuditLogInformation: /* 1 */
59 break;
60
62 if (PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions != NULL)
63 midl_user_free(PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions);
64 break;
65
67 if (PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer != NULL)
68 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer);
69
70 if (PolicyInformation->PolicyPrimaryDomInfo.Sid != NULL)
71 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Sid);
72 break;
73
74 case PolicyPdAccountInformation: /* 4 */
75 if (PolicyInformation->PolicyPdAccountInfo.Name.Buffer != NULL)
76 midl_user_free(PolicyInformation->PolicyPdAccountInfo.Name.Buffer);
77 break;
78
80 if (PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer != NULL)
81 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer);
82
83 if (PolicyInformation->PolicyAccountDomainInfo.Sid != NULL)
84 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.Sid);
85 break;
86
88 break;
89
91 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer != NULL)
92 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer);
93
94 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer != NULL)
95 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer);
96 break;
97
99 break;
100
102 break;
103
104 case PolicyAuditFullSetInformation: /* 10 (0xA) */
105 break;
106
107 case PolicyAuditFullQueryInformation: /* 11 (0xB) */
108 break;
109
110 case PolicyDnsDomainInformation: /* 12 (0xC) */
111 if (PolicyInformation->PolicyDnsDomainInfo.Name.Buffer != NULL)
112 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Name.Buffer);
113
114 if (PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer != NULL)
115 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer);
116
117 if (PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer != NULL)
118 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer);
119
120 if (PolicyInformation->PolicyDnsDomainInfo.Sid != NULL)
121 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Sid);
122 break;
123
124 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
125 if (PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer != NULL)
126 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer);
127
128 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer != NULL)
129 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer);
130
131 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer != NULL)
132 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer);
133
134 if (PolicyInformation->PolicyDnsDomainInfoInt.Sid != NULL)
135 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Sid);
136 break;
137
138 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
139 if (PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer != NULL)
140 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer);
141
142 if (PolicyInformation->PolicyLocalAccountDomainInfo.Sid != NULL)
143 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.Sid);
144 break;
145
146 default:
147 ERR("Invalid InformationClass: %lu\n", InformationClass);
148 break;
149 }
150
151 midl_user_free(PolicyInformation);
152 }
153}
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1713
@ PolicyModificationInformation
Definition: ntsecapi.h:251
@ PolicyAuditEventsInformation
Definition: ntsecapi.h:244
@ PolicyDnsDomainInformationInt
Definition: ntsecapi.h:255
@ PolicyDefaultQuotaInformation
Definition: ntsecapi.h:250
@ PolicyReplicaSourceInformation
Definition: ntsecapi.h:249
@ PolicyLsaServerRoleInformation
Definition: ntsecapi.h:248
@ PolicyAuditFullSetInformation
Definition: ntsecapi.h:252
@ PolicyDnsDomainInformation
Definition: ntsecapi.h:254
@ PolicyPrimaryDomainInformation
Definition: ntsecapi.h:245
@ PolicyAuditLogInformation
Definition: ntsecapi.h:243
@ PolicyAuditFullQueryInformation
Definition: ntsecapi.h:253
@ PolicyLocalAccountDomainInformation
Definition: ntsecapi.h:256
@ PolicyPdAccountInformation
Definition: ntsecapi.h:246
@ PolicyAccountDomainInformation
Definition: ntsecapi.h:247
#define midl_user_free
Definition: rpc.h:45

◆ LsaIOpenPolicyTrusted()

NTSTATUS WINAPI LsaIOpenPolicyTrusted ( OUT LSAPR_HANDLE PolicyHandle)

Definition at line 15 of file policy.c.

16{
17 PLSA_DB_OBJECT PolicyObject;
19
20 TRACE("(%p)\n", PolicyHandle);
21
23 NULL,
24 L"Policy",
27 TRUE,
28 &PolicyObject);
29
30 if (NT_SUCCESS(Status))
31 *PolicyHandle = (LSAPR_HANDLE)PolicyObject;
32
33 return Status;
34}
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS LsapOpenDbObject(IN PLSA_DB_OBJECT ParentObject, IN LPWSTR ContainerName, IN LPWSTR ObjectName, IN LSA_DB_OBJECT_TYPE ObjectType, IN ACCESS_MASK DesiredAccess, IN BOOLEAN Trusted, OUT PLSA_DB_OBJECT *DbObject)
Definition: database.c:712
@ LsaDbPolicyObject
Definition: lsasrv.h:50
Status
Definition: gdiplustypes.h:25
PVOID LSAPR_HANDLE
Definition: msv1_0.h:229
#define POLICY_ALL_ACCESS
Definition: ntsecapi.h:77
#define L(x)
Definition: ntvdm.h:50
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by GetAccountDomainSid().

◆ LsarClose()

NTSTATUS WINAPI LsarClose ( IN OUT LSAPR_HANDLE ObjectHandle)

◆ LsarLookupPrivilegeValue()

NTSTATUS WINAPI LsarLookupPrivilegeValue ( IN LSAPR_HANDLE  PolicyHandle,
IN PRPC_UNICODE_STRING  Name,
OUT PLUID  Value 
)

◆ LsarQueryInformationPolicy()

NTSTATUS WINAPI LsarQueryInformationPolicy ( IN LSAPR_HANDLE  PolicyHandle,
IN POLICY_INFORMATION_CLASS  InformationClass,
OUT PLSAPR_POLICY_INFORMATION PolicyInformation 
)

◆ SamIConnect()

NTSTATUS NTAPI SamIConnect ( IN PSAMPR_SERVER_NAME  ServerName,
OUT SAMPR_HANDLE ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN BOOLEAN  Trusted 
)

Definition at line 65 of file samsrv.c.

69{
70 PSAM_DB_OBJECT ServerObject;
72
73 TRACE("SamIConnect(%p %p %lx %ld)\n",
74 ServerName, ServerHandle, DesiredAccess, Trusted);
75
76 /* Map generic access rights */
79
80 /* Open the Server Object */
82 NULL,
83 L"SAM",
84 0,
87 &ServerObject);
88 if (NT_SUCCESS(Status))
89 {
90 ServerObject->Trusted = Trusted;
91 *ServerHandle = (SAMPR_HANDLE)ServerObject;
92 }
93
94 TRACE("SamIConnect done (Status 0x%08lx)\n", Status);
95
96 return Status;
97}
void * SAMPR_HANDLE
Definition: authpackage.c:113
NTSTATUS SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject, IN LPWSTR ContainerName, IN LPWSTR ObjectName, IN ULONG RelativeId, IN SAM_DB_OBJECT_TYPE ObjectType, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject)
Definition: database.c:173
@ SamDbServerObject
Definition: samsrv.h:38
NTSYSAPI VOID NTAPI RtlMapGenericMask(PACCESS_MASK AccessMask, PGENERIC_MAPPING GenericMapping)
PGENERIC_MAPPING pServerMapping
Definition: samrpc.c:56
BOOLEAN Trusted
Definition: samsrv.h:55
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658

◆ SamIFree_SAMPR_ULONG_ARRAY()

VOID NTAPI SamIFree_SAMPR_ULONG_ARRAY ( PSAMPR_ULONG_ARRAY  Ptr)

Definition at line 524 of file samsrv.c.

525{
526 if (Ptr == NULL)
527 return;
528
529 if (Ptr->Element != NULL)
530 {
531 MIDL_user_free(Ptr->Element);
532 Ptr->Element = NULL;
533 Ptr->Count = 0;
534 }
535}
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376

◆ SamIFree_SAMPR_USER_INFO_BUFFER()

VOID NTAPI SamIFree_SAMPR_USER_INFO_BUFFER ( PSAMPR_USER_INFO_BUFFER  Ptr,
USER_INFORMATION_CLASS  InformationClass 
)

Definition at line 540 of file samsrv.c.

542{
543 if (Ptr == NULL)
544 return;
545
546 switch (InformationClass)
547 {
549 if (Ptr->General.UserName.Buffer != NULL)
550 MIDL_user_free(Ptr->General.UserName.Buffer);
551
552 if (Ptr->General.FullName.Buffer != NULL)
553 MIDL_user_free(Ptr->General.FullName.Buffer);
554
555 if (Ptr->General.AdminComment.Buffer != NULL)
556 MIDL_user_free(Ptr->General.AdminComment.Buffer);
557
558 if (Ptr->General.UserComment.Buffer != NULL)
559 MIDL_user_free(Ptr->General.UserComment.Buffer);
560 break;
561
563 if (Ptr->Preferences.UserComment.Buffer != NULL)
564 MIDL_user_free(Ptr->Preferences.UserComment.Buffer);
565
566 if (Ptr->Preferences.Reserved1.Buffer != NULL)
567 MIDL_user_free(Ptr->Preferences.Reserved1.Buffer);
568 break;
569
571 if (Ptr->Logon.UserName.Buffer != NULL)
572 MIDL_user_free(Ptr->Logon.UserName.Buffer);
573
574 if (Ptr->Logon.FullName.Buffer != NULL)
575 MIDL_user_free(Ptr->Logon.FullName.Buffer);
576
577 if (Ptr->Logon.HomeDirectory.Buffer != NULL)
578 MIDL_user_free(Ptr->Logon.HomeDirectory.Buffer);
579
580 if (Ptr->Logon.HomeDirectoryDrive.Buffer != NULL)
581 MIDL_user_free(Ptr->Logon.HomeDirectoryDrive.Buffer);
582
583 if (Ptr->Logon.ScriptPath.Buffer != NULL)
584 MIDL_user_free(Ptr->Logon.ScriptPath.Buffer);
585
586 if (Ptr->Logon.ProfilePath.Buffer != NULL)
587 MIDL_user_free(Ptr->Logon.ProfilePath.Buffer);
588
589 if (Ptr->Logon.WorkStations.Buffer != NULL)
590 MIDL_user_free(Ptr->Logon.WorkStations.Buffer);
591
592 if (Ptr->Logon.LogonHours.LogonHours != NULL)
593 MIDL_user_free(Ptr->Logon.LogonHours.LogonHours);
594 break;
595
597 if (Ptr->LogonHours.LogonHours.LogonHours != NULL)
598 MIDL_user_free(Ptr->LogonHours.LogonHours.LogonHours);
599 break;
600
602 if (Ptr->Account.UserName.Buffer != NULL)
603 MIDL_user_free(Ptr->Account.UserName.Buffer);
604
605 if (Ptr->Account.FullName.Buffer != NULL)
606 MIDL_user_free(Ptr->Account.FullName.Buffer);
607
608 if (Ptr->Account.HomeDirectory.Buffer != NULL)
609 MIDL_user_free(Ptr->Account.HomeDirectory.Buffer);
610
611 if (Ptr->Account.HomeDirectoryDrive.Buffer != NULL)
612 MIDL_user_free(Ptr->Account.HomeDirectoryDrive.Buffer);
613
614 if (Ptr->Account.ScriptPath.Buffer != NULL)
615 MIDL_user_free(Ptr->Account.ScriptPath.Buffer);
616
617 if (Ptr->Account.ProfilePath.Buffer != NULL)
618 MIDL_user_free(Ptr->Account.ProfilePath.Buffer);
619
620 if (Ptr->Account.AdminComment.Buffer != NULL)
621 MIDL_user_free(Ptr->Account.AdminComment.Buffer);
622
623 if (Ptr->Account.WorkStations.Buffer != NULL)
624 MIDL_user_free(Ptr->Account.WorkStations.Buffer);
625
626 if (Ptr->Account.LogonHours.LogonHours != NULL)
627 MIDL_user_free(Ptr->Account.LogonHours.LogonHours);
628 break;
629
631 if (Ptr->Name.UserName.Buffer != NULL)
632 MIDL_user_free(Ptr->Name.UserName.Buffer);
633
634 if (Ptr->Name.FullName.Buffer != NULL)
635 MIDL_user_free(Ptr->Name.FullName.Buffer);
636 break;
637
639 if (Ptr->AccountName.UserName.Buffer != NULL)
640 MIDL_user_free(Ptr->AccountName.UserName.Buffer);
641 break;
642
644 if (Ptr->FullName.FullName.Buffer != NULL)
645 MIDL_user_free(Ptr->FullName.FullName.Buffer);
646 break;
647
649 break;
650
652 if (Ptr->Home.HomeDirectory.Buffer != NULL)
653 MIDL_user_free(Ptr->Home.HomeDirectory.Buffer);
654
655 if (Ptr->Home.HomeDirectoryDrive.Buffer != NULL)
656 MIDL_user_free(Ptr->Home.HomeDirectoryDrive.Buffer);
657 break;
658
660 if (Ptr->Script.ScriptPath.Buffer != NULL)
661 MIDL_user_free(Ptr->Script.ScriptPath.Buffer);
662 break;
663
665 if (Ptr->Profile.ProfilePath.Buffer != NULL)
666 MIDL_user_free(Ptr->Profile.ProfilePath.Buffer);
667 break;
668
670 if (Ptr->AdminComment.AdminComment.Buffer != NULL)
671 MIDL_user_free(Ptr->AdminComment.AdminComment.Buffer);
672 break;
673
675 if (Ptr->WorkStations.WorkStations.Buffer != NULL)
676 MIDL_user_free(Ptr->WorkStations.WorkStations.Buffer);
677 break;
678
680 ERR("Information class UserSetPasswordInformation cannot be queried!\n");
681 break;
682
684 break;
685
687 break;
688
690 break;
691
693 break;
694
696 if (Ptr->Parameters.Parameters.Buffer != NULL)
697 MIDL_user_free(Ptr->Parameters.Parameters.Buffer);
698 break;
699
701 if (Ptr->All.UserName.Buffer != NULL)
702 MIDL_user_free(Ptr->All.UserName.Buffer);
703
704 if (Ptr->All.FullName.Buffer != NULL)
705 MIDL_user_free(Ptr->All.FullName.Buffer);
706
707 if (Ptr->All.HomeDirectory.Buffer != NULL)
708 MIDL_user_free(Ptr->All.HomeDirectory.Buffer);
709
710 if (Ptr->All.HomeDirectoryDrive.Buffer != NULL)
711 MIDL_user_free(Ptr->All.HomeDirectoryDrive.Buffer);
712
713 if (Ptr->All.ScriptPath.Buffer != NULL)
714 MIDL_user_free(Ptr->All.ScriptPath.Buffer);
715
716 if (Ptr->All.ProfilePath.Buffer != NULL)
717 MIDL_user_free(Ptr->All.ProfilePath.Buffer);
718
719 if (Ptr->All.AdminComment.Buffer != NULL)
720 MIDL_user_free(Ptr->All.AdminComment.Buffer);
721
722 if (Ptr->All.WorkStations.Buffer != NULL)
723 MIDL_user_free(Ptr->All.WorkStations.Buffer);
724
725 if (Ptr->All.UserComment.Buffer != NULL)
726 MIDL_user_free(Ptr->All.UserComment.Buffer);
727
728 if (Ptr->All.Parameters.Buffer != NULL)
729 MIDL_user_free(Ptr->All.Parameters.Buffer);
730
731 if (Ptr->All.LmOwfPassword.Buffer != NULL)
732 MIDL_user_free(Ptr->All.LmOwfPassword.Buffer);
733
734 if (Ptr->All.NtOwfPassword.Buffer != NULL)
735 MIDL_user_free(Ptr->All.NtOwfPassword.Buffer);
736
737 if (Ptr->All.PrivateData.Buffer != NULL)
738 MIDL_user_free(Ptr->All.PrivateData.Buffer);
739
740 if (Ptr->All.SecurityDescriptor.SecurityDescriptor != NULL)
741 MIDL_user_free(Ptr->All.SecurityDescriptor.SecurityDescriptor);
742
743 if (Ptr->All.LogonHours.LogonHours != NULL)
744 MIDL_user_free(Ptr->All.LogonHours.LogonHours);
745 break;
746
747 default:
748 FIXME("Unsupported information class: %lu\n", InformationClass);
749 break;
750 }
751
753}
#define FIXME(fmt,...)
Definition: precomp.h:53
@ UserScriptInformation
Definition: ntsam.h:524
@ UserAccountNameInformation
Definition: ntsam.h:520
@ UserPrimaryGroupInformation
Definition: ntsam.h:522
@ UserAccountInformation
Definition: ntsam.h:518
@ UserInternal1Information
Definition: ntsam.h:531
@ UserParametersInformation
Definition: ntsam.h:533
@ UserWorkStationsInformation
Definition: ntsam.h:527
@ UserNameInformation
Definition: ntsam.h:519
@ UserLogonHoursInformation
Definition: ntsam.h:517
@ UserLogonInformation
Definition: ntsam.h:516
@ UserSetPasswordInformation
Definition: ntsam.h:528
@ UserGeneralInformation
Definition: ntsam.h:514
@ UserFullNameInformation
Definition: ntsam.h:521
@ UserInternal2Information
Definition: ntsam.h:532
@ UserControlInformation
Definition: ntsam.h:529
@ UserAdminCommentInformation
Definition: ntsam.h:526
@ UserProfileInformation
Definition: ntsam.h:525
@ UserAllInformation
Definition: ntsam.h:534
@ UserExpiresInformation
Definition: ntsam.h:530
@ UserPreferencesInformation
Definition: ntsam.h:515
@ UserHomeInformation
Definition: ntsam.h:523

Referenced by LsaApLogonUserEx2(), and SamValidateNormalUser().

◆ SamIFreeVoid()

VOID NTAPI SamIFreeVoid ( PVOID  Ptr)

Definition at line 155 of file samsrv.c.

156{
158}

Referenced by MsvpChangePassword().

◆ SamrChangePasswordUser()

NTSTATUS NTAPI SamrChangePasswordUser ( IN SAMPR_HANDLE  UserHandle,
IN unsigned char  LmPresent,
IN PENCRYPTED_LM_OWF_PASSWORD  OldLmEncryptedWithNewLm,
IN PENCRYPTED_LM_OWF_PASSWORD  NewLmEncryptedWithOldLm,
IN unsigned char  NtPresent,
IN PENCRYPTED_NT_OWF_PASSWORD  OldNtEncryptedWithNewNt,
IN PENCRYPTED_NT_OWF_PASSWORD  NewNtEncryptedWithOldNt,
IN unsigned char  NtCrossEncryptionPresent,
IN PENCRYPTED_NT_OWF_PASSWORD  NewNtEncryptedWithNewLm,
IN unsigned char  LmCrossEncryptionPresent,
IN PENCRYPTED_LM_OWF_PASSWORD  NewLmEncryptedWithNewNt 
)

Definition at line 7864 of file samrpc.c.

7875{
7876 ENCRYPTED_LM_OWF_PASSWORD StoredLmPassword;
7877 ENCRYPTED_NT_OWF_PASSWORD StoredNtPassword;
7878 LM_OWF_PASSWORD OldLmPassword;
7879 LM_OWF_PASSWORD NewLmPassword;
7880 NT_OWF_PASSWORD OldNtPassword;
7881 NT_OWF_PASSWORD NewNtPassword;
7882 BOOLEAN StoredLmPresent = FALSE;
7883 BOOLEAN StoredNtPresent = FALSE;
7884 BOOLEAN StoredLmEmpty = TRUE;
7885 BOOLEAN StoredNtEmpty = TRUE;
7886 PSAM_DB_OBJECT UserObject;
7887 ULONG Length;
7888 SAM_USER_FIXED_DATA UserFixedData;
7889 SAM_DOMAIN_FIXED_DATA DomainFixedData;
7890 LARGE_INTEGER SystemTime;
7892
7893 DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmPresent);
7894 DBG_UNREFERENCED_LOCAL_VARIABLE(StoredNtPresent);
7895 DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmEmpty);
7896
7897 TRACE("SamrChangePasswordUser(%p %u %p %p %u %p %p %u %p %u %p)\n",
7898 UserHandle, LmPresent, OldLmEncryptedWithNewLm, NewLmEncryptedWithOldLm,
7899 NtPresent, OldNtEncryptedWithNewNt, NewNtEncryptedWithOldNt, NtCrossEncryptionPresent,
7900 NewNtEncryptedWithNewLm, LmCrossEncryptionPresent, NewLmEncryptedWithNewNt);
7901
7903 TRUE);
7904
7905 /* Validate the user handle */
7906 Status = SampValidateDbObject(UserHandle,
7909 &UserObject);
7910 if (!NT_SUCCESS(Status))
7911 {
7912 TRACE("SampValidateDbObject failed with status 0x%08lx\n", Status);
7913 goto done;
7914 }
7915
7916 /* Get the current time */
7917 Status = NtQuerySystemTime(&SystemTime);
7918 if (!NT_SUCCESS(Status))
7919 {
7920 TRACE("NtQuerySystemTime failed (Status 0x%08lx)\n", Status);
7921 goto done;
7922 }
7923
7924 /* Retrieve the LM password */
7926 Status = SampGetObjectAttribute(UserObject,
7927 L"LMPwd",
7928 NULL,
7929 &StoredLmPassword,
7930 &Length);
7931 if (NT_SUCCESS(Status))
7932 {
7933 if (Length == sizeof(ENCRYPTED_LM_OWF_PASSWORD))
7934 {
7935 StoredLmPresent = TRUE;
7936 if (!RtlEqualMemory(&StoredLmPassword,
7937 &EmptyLmHash,
7939 StoredLmEmpty = FALSE;
7940 }
7941 }
7942
7943 /* Retrieve the NT password */
7945 Status = SampGetObjectAttribute(UserObject,
7946 L"NTPwd",
7947 NULL,
7948 &StoredNtPassword,
7949 &Length);
7950 if (NT_SUCCESS(Status))
7951 {
7952 if (Length == sizeof(ENCRYPTED_NT_OWF_PASSWORD))
7953 {
7954 StoredNtPresent = TRUE;
7955 if (!RtlEqualMemory(&StoredNtPassword,
7956 &EmptyNtHash,
7958 StoredNtEmpty = FALSE;
7959 }
7960 }
7961
7962 /* Retrieve the fixed size user data */
7963 Length = sizeof(SAM_USER_FIXED_DATA);
7964 Status = SampGetObjectAttribute(UserObject,
7965 L"F",
7966 NULL,
7967 &UserFixedData,
7968 &Length);
7969 if (!NT_SUCCESS(Status))
7970 {
7971 TRACE("SampGetObjectAttribute failed to retrieve the fixed user data (Status 0x%08lx)\n", Status);
7972 goto done;
7973 }
7974
7975 /* Check if we can change the password at this time */
7976 if ((StoredLmEmpty == FALSE) || (StoredNtEmpty == FALSE))
7977 {
7978 /* Get fixed domain data */
7979 Length = sizeof(SAM_DOMAIN_FIXED_DATA);
7981 L"F",
7982 NULL,
7983 &DomainFixedData,
7984 &Length);
7985 if (!NT_SUCCESS(Status))
7986 {
7987 TRACE("SampGetObjectAttribute failed to retrieve the fixed domain data (Status 0x%08lx)\n", Status);
7988 goto done;
7989 }
7990
7991 if (DomainFixedData.MinPasswordAge.QuadPart > 0)
7992 {
7993 if (SystemTime.QuadPart < (UserFixedData.PasswordLastSet.QuadPart + DomainFixedData.MinPasswordAge.QuadPart))
7994 {
7996 goto done;
7997 }
7998 }
7999 }
8000
8001 /* Decrypt the LM passwords, if present */
8002 if (LmPresent)
8003 {
8004 Status = SystemFunction013((const BYTE *)NewLmEncryptedWithOldLm,
8005 (const BYTE *)&StoredLmPassword,
8006 (LPBYTE)&NewLmPassword);
8007 if (!NT_SUCCESS(Status))
8008 {
8009 TRACE("SystemFunction013 failed (Status 0x%08lx)\n", Status);
8010 goto done;
8011 }
8012
8013 Status = SystemFunction013((const BYTE *)OldLmEncryptedWithNewLm,
8014 (const BYTE *)&NewLmPassword,
8015 (LPBYTE)&OldLmPassword);
8016 if (!NT_SUCCESS(Status))
8017 {
8018 TRACE("SystemFunction013 failed (Status 0x%08lx)\n", Status);
8019 goto done;
8020 }
8021 }
8022
8023 /* Decrypt the NT passwords, if present */
8024 if (NtPresent)
8025 {
8026 Status = SystemFunction013((const BYTE *)NewNtEncryptedWithOldNt,
8027 (const BYTE *)&StoredNtPassword,
8028 (LPBYTE)&NewNtPassword);
8029 if (!NT_SUCCESS(Status))
8030 {
8031 TRACE("SystemFunction013 failed (Status 0x%08lx)\n", Status);
8032 goto done;
8033 }
8034
8035 Status = SystemFunction013((const BYTE *)OldNtEncryptedWithNewNt,
8036 (const BYTE *)&NewNtPassword,
8037 (LPBYTE)&OldNtPassword);
8038 if (!NT_SUCCESS(Status))
8039 {
8040 TRACE("SystemFunction013 failed (Status 0x%08lx)\n", Status);
8041 goto done;
8042 }
8043 }
8044
8045 /* Check if the old passwords match the stored ones */
8046 if (NtPresent)
8047 {
8048 if (LmPresent)
8049 {
8050 if (!RtlEqualMemory(&StoredLmPassword,
8051 &OldLmPassword,
8053 {
8054 TRACE("Old LM Password does not match!\n");
8056 }
8057 else
8058 {
8059 if (!RtlEqualMemory(&StoredNtPassword,
8060 &OldNtPassword,
8062 {
8063 TRACE("Old NT Password does not match!\n");
8065 }
8066 }
8067 }
8068 else
8069 {
8070 if (!RtlEqualMemory(&StoredNtPassword,
8071 &OldNtPassword,
8073 {
8074 TRACE("Old NT Password does not match!\n");
8076 }
8077 }
8078 }
8079 else
8080 {
8081 if (LmPresent)
8082 {
8083 if (!RtlEqualMemory(&StoredLmPassword,
8084 &OldLmPassword,
8086 {
8087 TRACE("Old LM Password does not match!\n");
8089 }
8090 }
8091 else
8092 {
8094 }
8095 }
8096
8097 /* Store the new password hashes */
8098 if (NT_SUCCESS(Status))
8099 {
8100 Status = SampSetUserPassword(UserObject,
8101 &NewNtPassword,
8102 NtPresent,
8103 &NewLmPassword,
8104 LmPresent);
8105 if (NT_SUCCESS(Status))
8106 {
8107 /* Update PasswordLastSet */
8108 UserFixedData.PasswordLastSet.QuadPart = SystemTime.QuadPart;
8109
8110 /* Set the fixed size user data */
8111 Length = sizeof(SAM_USER_FIXED_DATA);
8112 Status = SampSetObjectAttribute(UserObject,
8113 L"F",
8114 REG_BINARY,
8115 &UserFixedData,
8116 Length);
8117 }
8118 }
8119
8121 {
8122 /* Update BadPasswordCount and LastBadPasswordTime */
8123 UserFixedData.BadPasswordCount++;
8124 UserFixedData.LastBadPasswordTime.QuadPart = SystemTime.QuadPart;
8125
8126 /* Set the fixed size user data */
8127 Length = sizeof(SAM_USER_FIXED_DATA);
8128 Status = SampSetObjectAttribute(UserObject,
8129 L"F",
8130 REG_BINARY,
8131 &UserFixedData,
8132 Length);
8133 }
8134
8135done:
8137
8138 return Status;
8139}
unsigned char BOOLEAN
#define FALSE
Definition: types.h:117
NTSTATUS SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PULONG AttributeType, LPVOID AttributeData, PULONG AttributeSize)
Definition: database.c:516
NTSTATUS SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, ULONG AttributeType, LPVOID AttributeData, ULONG AttributeSize)
Definition: database.c:501
NTSTATUS SampValidateDbObject(SAMPR_HANDLE Handle, SAM_DB_OBJECT_TYPE ObjectType, ACCESS_MASK DesiredAccess, PSAM_DB_OBJECT *DbObject)
Definition: database.c:301
struct _SAM_DOMAIN_FIXED_DATA SAM_DOMAIN_FIXED_DATA
struct _SAM_USER_FIXED_DATA SAM_USER_FIXED_DATA
NTSTATUS SampSetUserPassword(IN PSAM_DB_OBJECT UserObject, IN PENCRYPTED_NT_OWF_PASSWORD NtPassword, IN BOOLEAN NtPasswordPresent, IN PENCRYPTED_LM_OWF_PASSWORD LmPassword, IN BOOLEAN LmPasswordPresent)
Definition: user.c:399
@ SamDbUserObject
Definition: samsrv.h:42
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceExclusive(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
NTSYSAPI VOID NTAPI RtlReleaseResource(_In_ PRTL_RESOURCE Resource)
#define REG_BINARY
Definition: nt_native.h:1496
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
Definition: ntbasedef.h:327
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:569
#define USER_CHANGE_PASSWORD
Definition: ntsam.h:132
#define STATUS_WRONG_PASSWORD
Definition: ntstatus.h:342
#define STATUS_ACCOUNT_RESTRICTION
Definition: ntstatus.h:346
RTL_RESOURCE SampResource
Definition: samsrv.c:28
ENCRYPTED_LM_OWF_PASSWORD EmptyLmHash
Definition: samsrv.c:27
ENCRYPTED_NT_OWF_PASSWORD EmptyNtHash
Definition: samsrv.c:26
struct _SAM_DB_OBJECT * ParentObject
Definition: samsrv.h:56
LARGE_INTEGER MinPasswordAge
Definition: samsrv.h:75
LARGE_INTEGER LastBadPasswordTime
Definition: samsrv.h:106
LARGE_INTEGER PasswordLastSet
Definition: samsrv.h:104
USHORT BadPasswordCount
Definition: samsrv.h:112
NTSTATUS WINAPI SystemFunction013(const BYTE *in, const BYTE *key, LPBYTE out)
Definition: sysfunc.c:383
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONGLONG QuadPart
Definition: typedefs.h:114
unsigned char BYTE
Definition: xxhash.c:193

Referenced by MsvpChangePassword(), and SamChangePasswordUser().

◆ SamrCloseHandle()

NTSTATUS NTAPI SamrCloseHandle ( IN OUT SAMPR_HANDLE SamHandle)

Definition at line 161 of file samrpc.c.

162{
163 PSAM_DB_OBJECT DbObject;
165
166 TRACE("SamrCloseHandle(%p)\n", SamHandle);
167
169 TRUE);
170
171 Status = SampValidateDbObject(*SamHandle,
173 0,
174 &DbObject);
175 if (Status == STATUS_SUCCESS)
176 {
177 Status = SampCloseDbObject(DbObject);
178 *SamHandle = NULL;
179 }
180
182
183 TRACE("SamrCloseHandle done (Status 0x%08lx)\n", Status);
184
185 return Status;
186}
NTSTATUS SampCloseDbObject(PSAM_DB_OBJECT DbObject)
Definition: database.c:346
@ SamDbIgnoreObject
Definition: samsrv.h:37
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceShared(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by SamrGetDomainPasswordInformation().

◆ SamrLookupDomainInSamServer()

NTSTATUS NTAPI SamrLookupDomainInSamServer ( IN SAMPR_HANDLE  ServerHandle,
IN PRPC_UNICODE_STRING  Name,
OUT PRPC_SID DomainId 
)

Definition at line 504 of file samrpc.c.

507{
508 PSAM_DB_OBJECT ServerObject;
509 HANDLE DomainsKeyHandle = NULL;
510 HANDLE DomainKeyHandle = NULL;
511 WCHAR DomainKeyName[64];
512 ULONG Index;
513 WCHAR DomainNameString[MAX_COMPUTERNAME_LENGTH + 1];
514 UNICODE_STRING DomainName;
516 BOOL Found = FALSE;
518
519 TRACE("SamrLookupDomainInSamServer(%p %p %p)\n",
520 ServerHandle, Name, DomainId);
521
523 TRUE);
524
525 /* Validate the server handle */
526 Status = SampValidateDbObject(ServerHandle,
529 &ServerObject);
530 if (!NT_SUCCESS(Status))
531 goto done;
532
533 *DomainId = NULL;
534
535 Status = SampRegOpenKey(ServerObject->KeyHandle,
536 L"Domains",
537 KEY_READ,
538 &DomainsKeyHandle);
539 if (!NT_SUCCESS(Status))
540 goto done;
541
542 Index = 0;
543 while (Found == FALSE)
544 {
545 Status = SampRegEnumerateSubKey(DomainsKeyHandle,
546 Index,
547 64,
548 DomainKeyName);
549 if (!NT_SUCCESS(Status))
550 {
553 break;
554 }
555
556 TRACE("Domain key name: %S\n", DomainKeyName);
557
558 Status = SampRegOpenKey(DomainsKeyHandle,
559 DomainKeyName,
560 KEY_READ,
561 &DomainKeyHandle);
562 if (NT_SUCCESS(Status))
563 {
564 Length = (MAX_COMPUTERNAME_LENGTH + 1) * sizeof(WCHAR);
565 Status = SampRegQueryValue(DomainKeyHandle,
566 L"Name",
567 NULL,
568 (PVOID)&DomainNameString,
569 &Length);
570 if (NT_SUCCESS(Status))
571 {
572 TRACE("Domain name: %S\n", DomainNameString);
573
574 RtlInitUnicodeString(&DomainName,
575 DomainNameString);
577 {
578 TRACE("Found it!\n");
579 Found = TRUE;
580
581 Status = SampRegQueryValue(DomainKeyHandle,
582 L"SID",
583 NULL,
584 NULL,
585 &Length);
586 if (NT_SUCCESS(Status))
587 {
588 *DomainId = midl_user_allocate(Length);
589
590 SampRegQueryValue(DomainKeyHandle,
591 L"SID",
592 NULL,
593 (PVOID)*DomainId,
594 &Length);
595
597 break;
598 }
599 }
600 }
601
602 SampRegCloseKey(&DomainKeyHandle);
603 }
604
605 Index++;
606 }
607
608done:
609 SampRegCloseKey(&DomainKeyHandle);
610 SampRegCloseKey(&DomainsKeyHandle);
611
613
614 return Status;
615}
return Found
Definition: dirsup.c:1270
NTSTATUS SampRegQueryValue(IN HANDLE KeyHandle, IN LPCWSTR ValueName, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL)
Definition: registry.c:332
NTSTATUS SampRegCloseKey(IN OUT PHANDLE KeyHandle)
Definition: registry.c:26
NTSTATUS SampRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
Definition: registry.c:158
NTSTATUS SampRegEnumerateSubKey(IN HANDLE KeyHandle, IN ULONG Index, IN ULONG Length, OUT LPWSTR Buffer)
Definition: registry.c:101
unsigned int BOOL
Definition: ntddk_ex.h:94
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define SAM_SERVER_LOOKUP_DOMAIN
Definition: ntsam.h:104
#define STATUS_NO_SUCH_DOMAIN
Definition: ntstatus.h:459
#define STATUS_NO_MORE_ENTRIES
Definition: ntstatus.h:205
#define midl_user_allocate
Definition: rpc.h:44
HANDLE KeyHandle
Definition: samsrv.h:52
_In_ WDFCOLLECTION _In_ ULONG Index
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:269
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by MsvpChangePassword(), and SamLookupDomainInSamServer().

◆ SamrLookupNamesInDomain()

NTSTATUS NTAPI SamrLookupNamesInDomain ( IN SAMPR_HANDLE  DomainHandle,
IN ULONG  Count,
IN RPC_UNICODE_STRING  Names[],
OUT PSAMPR_ULONG_ARRAY  RelativeIds,
OUT PSAMPR_ULONG_ARRAY  Use 
)

Definition at line 3464 of file samrpc.c.

3469{
3470 PSAM_DB_OBJECT DomainObject;
3471 HANDLE AccountsKeyHandle = NULL;
3472 HANDLE NamesKeyHandle = NULL;
3473 ULONG MappedCount = 0;
3475 ULONG i;
3476 ULONG RelativeId;
3478
3479 TRACE("SamrLookupNamesInDomain(%p %lu %p %p %p)\n",
3480 DomainHandle, Count, Names, RelativeIds, Use);
3481
3483 TRUE);
3484
3485 /* Validate the domain handle */
3486 Status = SampValidateDbObject(DomainHandle,
3489 &DomainObject);
3490 if (!NT_SUCCESS(Status))
3491 {
3492 TRACE("failed with status 0x%08lx\n", Status);
3493 goto done;
3494 }
3495
3496 RelativeIds->Count = 0;
3497 Use->Count = 0;
3498
3499 if (Count == 0)
3500 {
3502 goto done;
3503 }
3504
3505 /* Allocate the relative IDs array */
3506 RelativeIds->Element = midl_user_allocate(Count * sizeof(ULONG));
3507 if (RelativeIds->Element == NULL)
3508 {
3510 goto done;
3511 }
3512
3513 /* Allocate the use array */
3514 Use->Element = midl_user_allocate(Count * sizeof(ULONG));
3515 if (Use->Element == NULL)
3516 {
3518 goto done;
3519 }
3520
3521 RelativeIds->Count = Count;
3522 Use->Count = Count;
3523
3524 for (i = 0; i < Count; i++)
3525 {
3526 TRACE("Name: %S\n", Names[i].Buffer);
3527
3528 RelativeId = 0;
3529
3530 /* Lookup aliases */
3531 Status = SampRegOpenKey(DomainObject->KeyHandle,
3532 L"Aliases",
3533 KEY_READ,
3534 &AccountsKeyHandle);
3535 if (NT_SUCCESS(Status))
3536 {
3537 Status = SampRegOpenKey(AccountsKeyHandle,
3538 L"Names",
3539 KEY_READ,
3540 &NamesKeyHandle);
3541 if (NT_SUCCESS(Status))
3542 {
3543 DataLength = sizeof(ULONG);
3544 Status = SampRegQueryValue(NamesKeyHandle,
3545 Names[i].Buffer,
3546 NULL,
3547 &RelativeId,
3548 &DataLength);
3549
3550 SampRegCloseKey(&NamesKeyHandle);
3551 }
3552
3553 SampRegCloseKey(&AccountsKeyHandle);
3554 }
3555
3557 break;
3558
3559 /* Return alias account */
3560 if (NT_SUCCESS(Status) && RelativeId != 0)
3561 {
3562 TRACE("Rid: %lu\n", RelativeId);
3563 RelativeIds->Element[i] = RelativeId;
3564 Use->Element[i] = SidTypeAlias;
3565 MappedCount++;
3566 continue;
3567 }
3568
3569 /* Lookup groups */
3570 Status = SampRegOpenKey(DomainObject->KeyHandle,
3571 L"Groups",
3572 KEY_READ,
3573 &AccountsKeyHandle);
3574 if (NT_SUCCESS(Status))
3575 {
3576 Status = SampRegOpenKey(AccountsKeyHandle,
3577 L"Names",
3578 KEY_READ,
3579 &NamesKeyHandle);
3580 if (NT_SUCCESS(Status))
3581 {
3582 DataLength = sizeof(ULONG);
3583 Status = SampRegQueryValue(NamesKeyHandle,
3584 Names[i].Buffer,
3585 NULL,
3586 &RelativeId,
3587 &DataLength);
3588
3589 SampRegCloseKey(&NamesKeyHandle);
3590 }
3591
3592 SampRegCloseKey(&AccountsKeyHandle);
3593 }
3594
3596 break;
3597
3598 /* Return group account */
3599 if (NT_SUCCESS(Status) && RelativeId != 0)
3600 {
3601 TRACE("Rid: %lu\n", RelativeId);
3602 RelativeIds->Element[i] = RelativeId;
3603 Use->Element[i] = SidTypeGroup;
3604 MappedCount++;
3605 continue;
3606 }
3607
3608 /* Lookup users */
3609 Status = SampRegOpenKey(DomainObject->KeyHandle,
3610 L"Users",
3611 KEY_READ,
3612 &AccountsKeyHandle);
3613 if (NT_SUCCESS(Status))
3614 {
3615 Status = SampRegOpenKey(AccountsKeyHandle,
3616 L"Names",
3617 KEY_READ,
3618 &NamesKeyHandle);
3619 if (NT_SUCCESS(Status))
3620 {
3621 DataLength = sizeof(ULONG);
3622 Status = SampRegQueryValue(NamesKeyHandle,
3623 Names[i].Buffer,
3624 NULL,
3625 &RelativeId,
3626 &DataLength);
3627
3628 SampRegCloseKey(&NamesKeyHandle);
3629 }
3630
3631 SampRegCloseKey(&AccountsKeyHandle);
3632 }
3633
3635 break;
3636
3637 /* Return user account */
3638 if (NT_SUCCESS(Status) && RelativeId != 0)
3639 {
3640 TRACE("Rid: %lu\n", RelativeId);
3641 RelativeIds->Element[i] = RelativeId;
3642 Use->Element[i] = SidTypeUser;
3643 MappedCount++;
3644 continue;
3645 }
3646
3647 /* Return unknown account */
3648 RelativeIds->Element[i] = 0;
3649 Use->Element[i] = SidTypeUnknown;
3650 }
3651
3652done:
3655
3656 if (NT_SUCCESS(Status))
3657 {
3658 if (MappedCount == 0)
3660 else if (MappedCount < Count)
3662 }
3663 else
3664 {
3665 if (RelativeIds->Element != NULL)
3666 {
3667 midl_user_free(RelativeIds->Element);
3668 RelativeIds->Element = NULL;
3669 }
3670
3671 RelativeIds->Count = 0;
3672
3673 if (Use->Element != NULL)
3674 {
3675 midl_user_free(Use->Element);
3676 Use->Element = NULL;
3677 }
3678
3679 Use->Count = 0;
3680 }
3681
3683
3684 TRACE("Returned Status %lx\n", Status);
3685
3686 return Status;
3687}
PWSTR Names[]
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1444
Definition: bufpool.h:45
@ SamDbDomainObject
Definition: samsrv.h:39
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ SidTypeUnknown
Definition: lsa.idl:125
@ SidTypeAlias
Definition: lsa.idl:121
@ SidTypeGroup
Definition: lsa.idl:119
@ SidTypeUser
Definition: lsa.idl:118
int Count
Definition: noreturn.cpp:7
#define DOMAIN_LOOKUP
Definition: ntsam.h:42
#define STATUS_NONE_MAPPED
Definition: ntstatus.h:351
#define STATUS_SOME_NOT_MAPPED
Definition: ntstatus.h:86
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149

◆ SamrOpenDomain()

NTSTATUS NTAPI SamrOpenDomain ( IN SAMPR_HANDLE  ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN PRPC_SID  DomainId,
OUT SAMPR_HANDLE DomainHandle 
)

Definition at line 831 of file samrpc.c.

835{
836 PSAM_DB_OBJECT ServerObject;
837 PSAM_DB_OBJECT DomainObject;
839
840 TRACE("SamrOpenDomain(%p %lx %p %p)\n",
841 ServerHandle, DesiredAccess, DomainId, DomainHandle);
842
843 /* Map generic access rights */
846
848 TRUE);
849
850 /* Validate the server handle */
851 Status = SampValidateDbObject(ServerHandle,
854 &ServerObject);
855 if (!NT_SUCCESS(Status))
856 return Status;
857
858 /* Validate the Domain SID */
859 if ((DomainId->Revision != SID_REVISION) ||
860 (DomainId->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES) ||
861 (memcmp(&DomainId->IdentifierAuthority, &NtSidAuthority, sizeof(SID_IDENTIFIER_AUTHORITY)) != 0))
863
864 /* Open the domain object */
865 if ((DomainId->SubAuthorityCount == 1) &&
866 (DomainId->SubAuthority[0] == SECURITY_BUILTIN_DOMAIN_RID))
867 {
868 /* Builtin domain object */
869 TRACE("Opening the builtin domain object.\n");
870
871 Status = SampOpenDbObject(ServerObject,
872 L"Domains",
873 L"Builtin",
874 0,
877 &DomainObject);
878 }
879 else if ((DomainId->SubAuthorityCount == 4) &&
880 (DomainId->SubAuthority[0] == SECURITY_NT_NON_UNIQUE))
881 {
882 /* Account domain object */
883 TRACE("Opening the account domain object.\n");
884
885 /* FIXME: Check the account domain sub authorities!!! */
886
887 Status = SampOpenDbObject(ServerObject,
888 L"Domains",
889 L"Account",
890 0,
893 &DomainObject);
894 }
895 else
896 {
897 /* No valid domain SID */
899 }
900
901 if (NT_SUCCESS(Status))
902 *DomainHandle = (SAMPR_HANDLE)DomainObject;
903
905
906 TRACE("SamrOpenDomain done (Status 0x%08lx)\n", Status);
907
908 return Status;
909}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static SID_IDENTIFIER_AUTHORITY NtSidAuthority
Definition: samrpc.c:14
static GENERIC_MAPPING DomainMapping
Definition: samrpc.c:24
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define SID_MAX_SUB_AUTHORITIES
Definition: setypes.h:482
#define SID_REVISION
Definition: setypes.h:481
#define SECURITY_NT_NON_UNIQUE
Definition: setypes.h:577

◆ SamrOpenUser()

NTSTATUS NTAPI SamrOpenUser ( IN SAMPR_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  UserId,
OUT SAMPR_HANDLE UserHandle 
)

◆ SamrQueryInformationUser()

NTSTATUS NTAPI SamrQueryInformationUser ( IN SAMPR_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
OUT PSAMPR_USER_INFO_BUFFER Buffer 
)

Definition at line 7234 of file samrpc.c.

7237{
7238 TRACE("SamrQueryInformationUser(%p %lu %p)\n",
7239 UserHandle, UserInformationClass, Buffer);
7240
7241 return SamrQueryInformationUser2(UserHandle,
7242 UserInformationClass,
7243 Buffer);
7244}
NTSTATUS NTAPI SamrQueryInformationUser2(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
Definition: samrpc.c:8587

Referenced by SamQueryInformationUser(), and SamValidateNormalUser().

◆ SamrSetInformationUser()

NTSTATUS NTAPI SamrSetInformationUser ( IN SAMPR_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
IN PSAMPR_USER_INFO_BUFFER  Buffer 
)

Definition at line 7848 of file samrpc.c.

7851{
7852 TRACE("SamrSetInformationUser(%p %lu %p)\n",
7853 UserHandle, UserInformationClass, Buffer);
7854
7855 return SamrSetInformationUser2(UserHandle,
7856 UserInformationClass,
7857 Buffer);
7858}
NTSTATUS NTAPI SamrSetInformationUser2(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
Definition: samrpc.c:9468

Referenced by LsaApLogonUserEx2(), and SamSetInformationUser().

◆ SystemFunction006()

NTSTATUS WINAPI SystemFunction006 ( LPCSTR  password,
LPSTR  hash 
)

Definition at line 53 of file crypt_lmhash.c.

54{
55 CRYPT_LMhash( (unsigned char*)hash, (const unsigned char*)password, strlen(password) );
56
57 return STATUS_SUCCESS;
58}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void CRYPT_LMhash(unsigned char *dst, const unsigned char *pwd, const int len)
Definition: crypt_lmhash.c:39
static WCHAR password[]
Definition: url.c:33
Definition: _hash_fun.h:40

◆ SystemFunction007()

NTSTATUS WINAPI SystemFunction007 ( PUNICODE_STRING  string,
LPBYTE  hash 
)

◆ SystemFunction012()

NTSTATUS WINAPI SystemFunction012 ( const BYTE in,
const BYTE key,
LPBYTE  out 
)

Definition at line 353 of file sysfunc.c.

354{
355 if (!in || !out)
356 return STATUS_UNSUCCESSFUL;
357
359 CRYPT_DEShash(out+8, key+7, in+8);
360 return STATUS_SUCCESS;
361}
unsigned char * CRYPT_DEShash(unsigned char *dst, const unsigned char *key, const unsigned char *src) DECLSPEC_HIDDEN
Definition: crypt_des.c:259
GLuint in
Definition: glext.h:9616
static FILE * out
Definition: regtests2xml.c:44
Definition: copy.c:22
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132