36 if (UIntPtrToUShort(
wcslen(ComputerName), &ComputerNameLength) !=
S_OK)
42 UserInfo->All.FullName.Length +
sizeof(
WCHAR) +
43 UserInfo->All.HomeDirectory.Length +
sizeof(
WCHAR) +
44 UserInfo->All.HomeDirectoryDrive.Length +
sizeof(
WCHAR) +
45 UserInfo->All.ScriptPath.Length +
sizeof(
WCHAR) +
46 UserInfo->All.ProfilePath.Length +
sizeof(
WCHAR) +
47 ((ComputerNameLength + 3) *
sizeof(
WCHAR));
50 if (LocalBuffer ==
NULL)
52 TRACE(
"Failed to allocate the local buffer!\n");
62 TRACE(
"DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n",
Status);
66 TRACE(
"ClientBaseAddress: %p\n", ClientBaseAddress);
71 LocalBuffer->
LogonCount = UserInfo->All.LogonCount;
96 UserInfo->All.ScriptPath.Buffer,
97 UserInfo->All.ScriptPath.Length);
105 UserInfo->All.HomeDirectory.Buffer,
106 UserInfo->All.HomeDirectory.Length);
114 UserInfo->All.FullName.Buffer,
115 UserInfo->All.FullName.Length);
124 UserInfo->All.ProfilePath.Buffer,
125 UserInfo->All.ProfilePath.Length);
133 UserInfo->All.HomeDirectoryDrive.Buffer,
134 UserInfo->All.HomeDirectoryDrive.Length);
152 TRACE(
"DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n",
Status);
160 if (LocalBuffer !=
NULL)
165 if (ClientBaseAddress !=
NULL)
201 ERR(
"RtlAppendUnicodeToString failed 0x%lx\n",
Status);
207 ERR(
"RtlAppendUnicodeStringToString failed 0x%lx\n",
Status);
216 TRACE(
"DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n",
Status);
220 TRACE(
"ClientBaseAddress: %p\n",
Buffer.ClientBaseAddress);
232 &LogonPwdData->UserSessionKey,
240 &LogonPwdData->LanmanSessionKey,
250 ERR(
"NtlmStructWriteUCS failed.\n");
265 TRACE(
"DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n",
Status);
313 if (User->User.Sid ==
NULL)
315 ERR(
"Could not create the user SID\n");
319 User->User.Attributes = 0;
335 ERR(
"Could not create the primary group SID\n");
352 DWORD GroupCount = 0;
453 WARN(
"Failed to allocate the local buffer!\n");
466 WARN(
"BuildTokenUser() failed (Status 0x%08lx)\n",
Status);
475 WARN(
"BuildTokenPrimaryGroup() failed (Status 0x%08lx)\n",
Status);
485 WARN(
"BuildTokenGroups() failed (Status 0x%08lx)\n",
Status);
489 *TokenInformation =
Buffer;
501 for (
i = 0;
i <
Buffer->Groups->GroupCount;
i++)
510 if (
Buffer->PrimaryGroup.PrimaryGroup !=
NULL)
551 CHAR LmPwdBuffer[15];
562 TRACE(
"MsvpChangePassword()\n");
568 ERR(
"Invalid SubmitBufferLength %lu\n", SubmitBufferLength);
617 TRACE(
"SamIConnect() failed (Status 0x%08lx)\n",
Status);
627 TRACE(
"SamrLookupDomainInSamServer failed (Status %08lx)\n",
Status);
638 TRACE(
"SamrOpenDomain failed (Status %08lx)\n",
Status);
654 TRACE(
"SamrLookupNamesInDomain failed (Status %08lx)\n",
Status);
662 TRACE(
"Account is not a user account!\n");
674 TRACE(
"SamrOpenUser failed (Status %08lx)\n",
Status);
684 TRACE(
"SystemFunction007 failed (Status 0x%08lx)\n",
Status);
693 TRACE(
"SystemFunction007 failed (Status 0x%08lx)\n",
Status);
698 LmPwdString.Length = 15;
699 LmPwdString.MaximumLength = 15;
700 LmPwdString.Buffer = LmPwdBuffer;
701 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
710 (
LPSTR)&OldLmPassword);
713 OldLmPasswordPresent =
TRUE;
718 LmPwdString.Length = 15;
719 LmPwdString.MaximumLength = 15;
720 LmPwdString.Buffer = LmPwdBuffer;
721 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
730 (
LPSTR)&NewLmPassword);
733 NewLmPasswordPresent =
TRUE;
738 if (OldLmPasswordPresent && NewLmPasswordPresent)
742 (
const BYTE *)&NewLmPassword,
743 (
LPBYTE)&OldLmEncryptedWithNewLm);
746 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
752 (
const BYTE *)&OldLmPassword,
753 (
LPBYTE)&NewLmEncryptedWithOldLm);
756 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
760 pOldLmEncryptedWithNewLm = &OldLmEncryptedWithNewLm;
761 pNewLmEncryptedWithOldLm = &NewLmEncryptedWithOldLm;
766 (
const BYTE *)&NewNtPassword,
767 (
LPBYTE)&OldNtEncryptedWithNewNt);
770 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
776 (
const BYTE *)&OldNtPassword,
777 (
LPBYTE)&NewNtEncryptedWithOldNt);
780 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
786 OldLmPasswordPresent && NewLmPasswordPresent,
787 pOldLmEncryptedWithNewLm,
788 pNewLmEncryptedWithOldLm,
790 &OldNtEncryptedWithNewNt,
791 &NewNtEncryptedWithOldNt,
798 TRACE(
"SamrChangePasswordUser failed (Status %08lx)\n",
Status);
803 if (UserHandle !=
NULL)
809 if (DomainHandle !=
NULL)
812 if (DomainSid !=
NULL)
815 if (ServerHandle !=
NULL)
838 TRACE(
"LsaApCallPackage()\n");
845 *ProtocolReturnBuffer =
NULL;
846 *ReturnBufferLength = 0;
863 ProtocolSubmitBuffer,
866 ProtocolReturnBuffer,
901 TRACE(
"LsaApCallPackagePassthrough()\n");
922 TRACE(
"LsaApCallPackageUntrusted()\n");
929 *ProtocolReturnBuffer =
NULL;
930 *ReturnBufferLength = 0;
934 ProtocolSubmitBuffer,
937 ProtocolReturnBuffer,
961 TRACE(
"LsaApInitializePackage(%lu %p %p %p %p)\n",
962 AuthenticationPackageId, LsaDispatchTable,
Database,
963 Confidentiality, AuthenticationPackageName);
966 DispatchTable.CreateLogonSession = LsaDispatchTable->CreateLogonSession;
967 DispatchTable.DeleteLogonSession = LsaDispatchTable->DeleteLogonSession;
968 DispatchTable.AddCredential = LsaDispatchTable->AddCredential;
969 DispatchTable.GetCredentials = LsaDispatchTable->GetCredentials;
970 DispatchTable.DeleteCredential = LsaDispatchTable->DeleteCredential;
971 DispatchTable.AllocateLsaHeap = LsaDispatchTable->AllocateLsaHeap;
973 DispatchTable.AllocateClientBuffer = LsaDispatchTable->AllocateClientBuffer;
974 DispatchTable.FreeClientBuffer = LsaDispatchTable->FreeClientBuffer;
975 DispatchTable.CopyToClientBuffer = LsaDispatchTable->CopyToClientBuffer;
976 DispatchTable.CopyFromClientBuffer = LsaDispatchTable->CopyFromClientBuffer;
980 if (NameString ==
NULL)
984 if (NameBuffer ==
NULL)
994 *AuthenticationPackageName = (
PLSA_STRING)NameString;
1007 TRACE(
"LsaApLogonTerminated()\n");
1037 *LogonProfile =
NULL;
1038 *LogonProfileSize = 0;
1039 *UserInfoPtr =
NULL;
1040 *AccountDomainSidPtr =
NULL;
1041 *SpecialAccount =
FALSE;
1042 LogonInfo = ProtocolSubmitBuffer;
1046 ERR(
"Invalid SubmitBufferSize %lu\n", SubmitBufferSize);
1062 LogonPwdData->IsNetwork =
TRUE;
1063 LogonPwdData->LogonInfo = LogonInfo;
1064 LogonPwdData->ComputerName = ComputerName;
1071 AccountDomainSidPtr,
1077 ERR(
"SamValidateUser failed with 0x%lx\n",
Status);
1090 ERR(
"BuildLm20LogonProfileBuffer failed with 0x%lx\n",
Status);
1095 *LogonUserRef = &LogonInfo->
UserName;
1108 IN PVOID ProtocolSubmitBuffer,
1133 DWORD ComputerNameSize;
1135 UCHAR LogonPassHash;
1138 TRACE(
"LsaApLogonUserEx2()\n");
1141 TRACE(
"ProtocolSubmitBuffer: %p\n", ProtocolSubmitBuffer);
1142 TRACE(
"SubmitBufferSize: %lu\n", SubmitBufferSize);
1145 *ProfileBufferSize = 0;
1147 *AccountName =
NULL;
1148 *AuthenticatingAuthority =
NULL;
1151 ComputerNameSize =
ARRAYSIZE(ComputerNameData);
1154 ERR(
"Failed to get Computername.\n");
1169 ERR(
"Invalid SubmitBufferSize %lu\n", SubmitBufferSize);
1248 if (LogonPassHash > 0)
1254 ErasePassword = &LogonInfo->
Password;
1260 LogonUserName = &LogonInfo->
UserName;
1275 ProtocolSubmitBuffer,
1318 TRACE(
"NtAllocateLocallyUniqueId failed (Status %08lx)\n",
Status);
1326 TRACE(
"CreateLogonSession failed (Status %08lx)\n",
Status);
1330 SessionCreated =
TRUE;
1342 TRACE(
"BuildInteractiveProfileBuffer failed (Status %08lx)\n",
Status);
1361 TRACE(
"BuildTokenInformationBuffer failed (Status %08lx)\n",
Status);
1373 if ((UserHandle !=
NULL) &&
1394 if ((LogonUserName !=
NULL) &&
1395 (*AccountName !=
NULL))
1399 if ((*AccountName)->Buffer !=
NULL)
1401 (*AccountName)->MaximumLength = LogonUserName->
Length +
1409 if ((LogonDomain !=
NULL) &&
1410 (*AuthenticatingAuthority !=
NULL))
1414 if ((*AuthenticatingAuthority)->Buffer !=
NULL)
1416 (*AuthenticatingAuthority)->MaximumLength = LogonDomain->
Length +
1427 if ((*MachineName)->Buffer !=
NULL)
1430 (*MachineName)->Length = ComputerName.
Length;
1440 if (SessionCreated !=
FALSE)
1451 if (UserHandle !=
NULL)
1484 TRACE(
"SpLsaModeInitialize(0x%lx %p %p %p)\n",
1485 LsaVersion, PackageVersion, ppTables, pcTables);
1509 TRACE(
"SpUserModeInitialize(0x%lx %p %p %p)\n",
1510 LsaVersion, PackageVersion, ppTables, pcTables);
char * strcpy(char *DstString, const char *SrcString)
NTSTATUS __stdcall SamrOpenDomain(SAMPR_HANDLE ServerHandle, ACCESS_MASK DesiredAccess, PRPC_SID DomainId, SAMPR_HANDLE *DomainHandle)
VOID NTAPI SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr)
NTSTATUS __stdcall SamrCloseHandle(SAMPR_HANDLE *SamHandle)
enum _LSA_TOKEN_INFORMATION_TYPE * PLSA_TOKEN_INFORMATION_TYPE
NTSTATUS NTAPI SamIConnect(PSAMPR_SERVER_NAME ServerName, SAMPR_HANDLE *ServerHandle, ACCESS_MASK DesiredAccess, BOOLEAN Trusted)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define PtrOffset(BASE, OFFSET)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
#define NT_SUCCESS(StatCode)
NTSTATUS WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
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)
bool NtlmUStrWriteToStruct(_In_ PVOID DataStart, _In_ ULONG DataSize, _Out_ PUNICODE_STRING DstData, _In_ const PUNICODE_STRING SrcData, _Inout_ PBYTE *AbsoluteOffsetPtr, _In_ bool TerminateWith0)
VOID NtlmUStrFree(_In_ PUNICODE_STRING String)
bool NtlmFixupAndValidateUStr(_Inout_ PUNICODE_STRING String, _In_ ULONG_PTR FixupOffset)
NTSTATUS NtlmCopyToClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ ULONG BufferLength, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
bool NtlmFixupAStr(_Inout_ PSTRING String, _In_ ULONG_PTR FixupOffset)
bool NtlmUStrAlloc(_Inout_ PUNICODE_STRING Dst, _In_ UINT16 SizeInBytes, _In_ UINT16 InitLength)
NTSTATUS NtlmAllocateClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ ULONG BufferLength, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
VOID NtlmFreeClientBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ bool FreeClientBuffer, _Inout_ PNTLM_CLIENT_BUFFER Buffer)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
VOID NTAPI ProtocolStatus(NDIS_HANDLE BindingContext, NDIS_STATUS GenerelStatus, PVOID StatusBuffer, UINT StatusBufferSize)
Called by NDIS when the underlying driver has changed state.
#define memcpy(s1, s2, n)
static SID_IDENTIFIER_AUTHORITY SystemAuthority
SECPKG_USER_FUNCTION_TABLE NtlmUsrFn[1]
SECPKG_FUNCTION_TABLE NtlmLsaFn[1]
static NTSTATUS BuildTokenGroups(OUT PTOKEN_GROUPS *Groups, IN PSID AccountDomainSid, IN ULONG RelativeId, IN BOOL SpecialAccount)
NTSTATUS WINAPI SpUserModeInitialize(_In_ ULONG LsaVersion, _Out_ PULONG PackageVersion, _Out_ PSECPKG_USER_FUNCTION_TABLE *ppTables, _Out_ PULONG pcTables)
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)
static NTSTATUS BuildTokenPrimaryGroup(OUT PTOKEN_PRIMARY_GROUP PrimaryGroup, IN PSID AccountDomainSid, IN ULONG RelativeId)
static NTSTATUS BuildLm20LogonProfileBuffer(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ PSAMPR_USER_INFO_BUFFER UserInfo, _In_ PLSA_SAM_PWD_DATA LogonPwdData, _Out_ PMSV1_0_LM20_LOGON_PROFILE *ProfileBuffer, _Out_ PULONG ProfileBufferLength)
NTSTATUS NTAPI LsaApInitializePackage(IN ULONG AuthenticationPackageId, IN PLSA_DISPATCH_TABLE LsaDispatchTable, IN PLSA_STRING Database OPTIONAL, IN PLSA_STRING Confidentiality OPTIONAL, OUT PLSA_STRING *AuthenticationPackageName)
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 SpLsaModeInitialize(_In_ ULONG LsaVersion, _Out_ PULONG PackageVersion, _Out_ PSECPKG_FUNCTION_TABLE *ppTables, _Out_ PULONG pcTables)
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)
static PSID AppendRidToSid(PSID SrcSid, ULONG Rid)
static NTSTATUS LsaApLogonUserEx2_Network(_In_ PLSA_CLIENT_REQUEST ClientRequest, _In_ PVOID ProtocolSubmitBuffer, _In_ PVOID ClientBufferBase, _In_ ULONG SubmitBufferSize, _In_ PUNICODE_STRING ComputerName, _Out_ PUNICODE_STRING *LogonUserRef, _Out_ PUNICODE_STRING *LogonDomainRef, _Inout_ PLSA_SAM_PWD_DATA LogonPwdData, _Out_ SAMPR_HANDLE *UserHandlePtr, _Out_ PSAMPR_USER_INFO_BUFFER *UserInfoPtr, _Out_ PRPC_SID *AccountDomainSidPtr, _Out_ PBOOL SpecialAccount, _Out_ PMSV1_0_LM20_LOGON_PROFILE *LogonProfile, _Out_ PULONG LogonProfileSize, _Out_ PNTSTATUS SubStatus)
static NTSTATUS BuildTokenInformationBuffer(PLSA_TOKEN_INFORMATION_V1 *TokenInformation, PRPC_SID AccountDomainSid, PSAMPR_USER_INFO_BUFFER UserInfo, BOOL SpecialAccount)
static NTSTATUS MsvpChangePassword(IN PLSA_CLIENT_REQUEST ClientRequest, IN PVOID ProtocolSubmitBuffer, IN PVOID ClientBufferBase, IN ULONG SubmitBufferLength, OUT PVOID *ProtocolReturnBuffer, OUT PULONG ReturnBufferLength, OUT PNTSTATUS ProtocolStatus)
static NTSTATUS BuildInteractiveProfileBuffer(IN PLSA_CLIENT_REQUEST ClientRequest, IN PSAMPR_USER_INFO_BUFFER UserInfo, IN PWSTR ComputerName, OUT PMSV1_0_INTERACTIVE_PROFILE *ProfileBuffer, OUT PULONG ProfileBufferLength)
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)
static NTSTATUS BuildTokenUser(OUT PTOKEN_USER User, IN PSID AccountDomainSid, IN ULONG RelativeId)
VOID NTAPI LsaApLogonTerminated(IN PLUID LogonId)
VOID NTAPI SamIFree_SAMPR_USER_INFO_BUFFER(PSAMPR_USER_INFO_BUFFER Ptr, USER_INFORMATION_CLASS InformationClass)
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 SamrLookupDomainInSamServer(IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
NTSTATUS NTAPI SamrOpenUser(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT SAMPR_HANDLE *UserHandle)
#define USER_LOGON_SUCCESS
VOID NTAPI SamIFreeVoid(PVOID Ptr)
#define FIXUP_POINTER(Pointer, Offset)
#define USER_LOGON_BAD_PASSWORD
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI PULONG NTAPI RtlSubAuthoritySid(_In_ PSID Sid, _In_ ULONG SubAuthority)
NTSYSAPI ULONG NTAPI RtlLengthRequiredSid(IN ULONG SubAuthorityCount)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID _Inout_ PULONG _Out_writes_bytes_to_opt_ PrimaryGroupSize PSID PrimaryGroup
NTSYSAPI VOID NTAPI RtlEraseUnicodeString(_Inout_ PUNICODE_STRING String)
NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
#define SE_GROUP_MANDATORY
#define SE_GROUP_ENABLED_BY_DEFAULT
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE LogonType
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE _Out_ PQUOTA_LIMITS _Out_ PNTSTATUS SubStatus
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID * ProfileBuffer
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG ProfileBufferLength
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId
NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid(IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, IN ULONG SubAuthority1, IN ULONG SubAuthority2, IN ULONG SubAuthority3, IN ULONG SubAuthority4, IN ULONG SubAuthority5, IN ULONG SubAuthority6, IN ULONG SubAuthority7, OUT PSID *Sid)
NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid(IN PSID Sid)
NTSTATUS NTAPI NtAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId)
#define SAM_SERVER_LOOKUP_DOMAIN
@ UserInternal2Information
#define SAM_SERVER_CONNECT
#define USER_CHANGE_PASSWORD
struct _MSV1_0_CHANGEPASSWORD_REQUEST * PMSV1_0_CHANGEPASSWORD_REQUEST
struct _MSV1_0_INTERACTIVE_PROFILE * PMSV1_0_INTERACTIVE_PROFILE
@ MsV1_0ChangeCachedPassword
@ MsV1_0GenericPassthrough
@ MsV1_0Lm20GetChallengeResponse
@ MsV1_0Lm20ChallengeRequest
#define MSV1_0_USER_SESSION_KEY_LENGTH
#define MSV1_0_RETURN_PROFILE_PATH
struct _MSV1_0_LM20_LOGON_PROFILE MSV1_0_LM20_LOGON_PROFILE
struct _LSA_STRING * PLSA_STRING
struct _MSV1_0_INTERACTIVE_PROFILE MSV1_0_INTERACTIVE_PROFILE
#define MSV1_0_PACKAGE_NAME
enum _SECURITY_LOGON_TYPE SECURITY_LOGON_TYPE
enum _MSV1_0_PROTOCOL_MESSAGE_TYPE * PMSV1_0_PROTOCOL_MESSAGE_TYPE
@ MsV1_0InteractiveProfile
struct _MSV1_0_LM20_LOGON_PROFILE * PMSV1_0_LM20_LOGON_PROFILE
#define MSV1_0_LANMAN_SESSION_KEY_LENGTH
struct _MSV1_0_INTERACTIVE_LOGON * PMSV1_0_INTERACTIVE_LOGON
enum _MSV1_0_PROTOCOL_MESSAGE_TYPE MSV1_0_PROTOCOL_MESSAGE_TYPE
#define LOGON_USED_LM_PASSWORD
@ MsV1_0WorkstationUnlockLogon
#define SECPKG_INTERFACE_VERSION
#define STATUS_INTERNAL_ERROR
#define STATUS_WRONG_PASSWORD
#define STATUS_BAD_VALIDATION_CLASS
#define STATUS_NO_SUCH_USER
#define STATUS_NOT_IMPLEMENTED
#define STATUS_LOGON_FAILURE
#define STATUS_NAME_TOO_LONG
NTSTATUS SamValidateUser(_In_ SECURITY_LOGON_TYPE LogonType, _In_ PUNICODE_STRING LogonUserName, _In_ PUNICODE_STRING LogonDomain, _In_ PLSA_SAM_PWD_DATA LogonPwdData, _In_ PUNICODE_STRING ComputerName, _Out_ PBOOL SpecialAccount, _Out_ PRPC_SID *AccountDomainSidPtr, _Out_ SAMPR_HANDLE *UserHandlePtr, _Out_ PSAMPR_USER_INFO_BUFFER *UserInfoPtr, _Out_ PNTSTATUS SubStatus)
Validates a user by checking if it exists in the sam database. Some other checks are done further.
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
VOID NTAPI RtlRunDecodeUnicodeString(IN UCHAR Hash, IN OUT PUNICODE_STRING String)
_In_ DWORD _Out_ PDWORD _In_opt_ PCSTR MachineName
PULONG MinorVersion OPTIONAL
PUNICODE_STRING ComputerName
UNICODE_STRING AccountName
UNICODE_STRING NewPassword
UNICODE_STRING OldPassword
UNICODE_STRING DomainName
MSV1_0_LOGON_SUBMIT_TYPE MessageType
UNICODE_STRING LogonDomainName
MSV1_0_PROFILE_BUFFER_TYPE MessageType
LARGE_INTEGER KickOffTime
LARGE_INTEGER PasswordMustChange
UNICODE_STRING LogonScript
LARGE_INTEGER PasswordCanChange
LARGE_INTEGER PasswordLastSet
UNICODE_STRING ProfilePath
UNICODE_STRING LogonServer
UNICODE_STRING HomeDirectory
UNICODE_STRING HomeDirectoryDrive
MSV1_0_PROFILE_BUFFER_TYPE MessageType
UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]
UNICODE_STRING LogonServer
UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH]
UNICODE_STRING LogonDomainName
UNICODE_STRING UserParameters
LARGE_INTEGER KickOffTime
STRING CaseInsensitiveChallengeResponse
UNICODE_STRING LogonDomainName
UNICODE_STRING Workstation
STRING CaseSensitiveChallengeResponse
NTSTATUS WINAPI SystemFunction012(const BYTE *in, const BYTE *key, LPBYTE out)
NTSTATUS WINAPI SystemFunction007(const UNICODE_STRING *string, LPBYTE hash)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
SAMPR_USER_ALL_INFORMATION All
SAMPR_USER_INTERNAL2_INFORMATION Internal2
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
#define MAX_COMPUTERNAME_LENGTH
#define ERROR_INTERNAL_ERROR
#define DOMAIN_ALIAS_RID_USERS
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_AUTHENTICATED_USER_RID
#define SECURITY_NULL_RID
#define SECURITY_NT_AUTHORITY
#define DOMAIN_GROUP_RID_USERS