48 if (UIntPtrToUShort(
wcslen(ComputerName), &ComputerNameLength) !=
S_OK)
54 UserInfo->All.FullName.Length +
sizeof(
WCHAR) +
55 UserInfo->All.HomeDirectory.Length +
sizeof(
WCHAR) +
56 UserInfo->All.HomeDirectoryDrive.Length +
sizeof(
WCHAR) +
57 UserInfo->All.ScriptPath.Length +
sizeof(
WCHAR) +
58 UserInfo->All.ProfilePath.Length +
sizeof(
WCHAR) +
59 ((ComputerNameLength + 3) *
sizeof(
WCHAR));
62 if (LocalBuffer ==
NULL)
64 TRACE(
"Failed to allocate the local buffer!\n");
74 TRACE(
"DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n",
Status);
78 TRACE(
"ClientBaseAddress: %p\n", ClientBaseAddress);
83 LocalBuffer->
LogonCount = UserInfo->All.LogonCount;
108 UserInfo->All.ScriptPath.Buffer,
109 UserInfo->All.ScriptPath.Length);
117 UserInfo->All.HomeDirectory.Buffer,
118 UserInfo->All.HomeDirectory.Length);
126 UserInfo->All.FullName.Buffer,
127 UserInfo->All.FullName.Length);
136 UserInfo->All.ProfilePath.Buffer,
137 UserInfo->All.ProfilePath.Length);
145 UserInfo->All.HomeDirectoryDrive.Buffer,
146 UserInfo->All.HomeDirectoryDrive.Length);
164 TRACE(
"DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n",
Status);
172 if (LocalBuffer !=
NULL)
177 if (ClientBaseAddress !=
NULL)
213 ERR(
"RtlAppendUnicodeToString failed 0x%lx\n",
Status);
219 ERR(
"RtlAppendUnicodeStringToString failed 0x%lx\n",
Status);
228 TRACE(
"DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n",
Status);
232 TRACE(
"ClientBaseAddress: %p\n",
Buffer.ClientBaseAddress);
244 &LogonPwdData->UserSessionKey,
252 &LogonPwdData->LanmanSessionKey,
262 ERR(
"NtlmStructWriteUCS failed.\n");
277 TRACE(
"DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n",
Status);
325 if (User->User.Sid ==
NULL)
327 ERR(
"Could not create the user SID\n");
331 User->User.Attributes = 0;
347 ERR(
"Could not create the primary group SID\n");
364 DWORD GroupCount = 0;
465 WARN(
"Failed to allocate the local buffer!\n");
478 WARN(
"BuildTokenUser() failed (Status 0x%08lx)\n",
Status);
487 WARN(
"BuildTokenPrimaryGroup() failed (Status 0x%08lx)\n",
Status);
497 WARN(
"BuildTokenGroups() failed (Status 0x%08lx)\n",
Status);
501 *TokenInformation =
Buffer;
513 for (
i = 0;
i <
Buffer->Groups->GroupCount;
i++)
522 if (
Buffer->PrimaryGroup.PrimaryGroup !=
NULL)
563 CHAR LmPwdBuffer[15];
574 TRACE(
"MsvpChangePassword()\n");
580 ERR(
"Invalid SubmitBufferLength %lu\n", SubmitBufferLength);
629 TRACE(
"SamIConnect() failed (Status 0x%08lx)\n",
Status);
639 TRACE(
"SamrLookupDomainInSamServer failed (Status %08lx)\n",
Status);
650 TRACE(
"SamrOpenDomain failed (Status %08lx)\n",
Status);
666 TRACE(
"SamrLookupNamesInDomain failed (Status %08lx)\n",
Status);
674 TRACE(
"Account is not a user account!\n");
686 TRACE(
"SamrOpenUser failed (Status %08lx)\n",
Status);
696 TRACE(
"SystemFunction007 failed (Status 0x%08lx)\n",
Status);
705 TRACE(
"SystemFunction007 failed (Status 0x%08lx)\n",
Status);
710 LmPwdString.Length = 15;
711 LmPwdString.MaximumLength = 15;
712 LmPwdString.Buffer = LmPwdBuffer;
713 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
722 (
LPSTR)&OldLmPassword);
725 OldLmPasswordPresent =
TRUE;
730 LmPwdString.Length = 15;
731 LmPwdString.MaximumLength = 15;
732 LmPwdString.Buffer = LmPwdBuffer;
733 ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
742 (
LPSTR)&NewLmPassword);
745 NewLmPasswordPresent =
TRUE;
750 if (OldLmPasswordPresent && NewLmPasswordPresent)
754 (
const BYTE *)&NewLmPassword,
755 (
LPBYTE)&OldLmEncryptedWithNewLm);
758 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
764 (
const BYTE *)&OldLmPassword,
765 (
LPBYTE)&NewLmEncryptedWithOldLm);
768 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
772 pOldLmEncryptedWithNewLm = &OldLmEncryptedWithNewLm;
773 pNewLmEncryptedWithOldLm = &NewLmEncryptedWithOldLm;
778 (
const BYTE *)&NewNtPassword,
779 (
LPBYTE)&OldNtEncryptedWithNewNt);
782 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
788 (
const BYTE *)&OldNtPassword,
789 (
LPBYTE)&NewNtEncryptedWithOldNt);
792 TRACE(
"SystemFunction012 failed (Status 0x%08lx)\n",
Status);
798 OldLmPasswordPresent && NewLmPasswordPresent,
799 pOldLmEncryptedWithNewLm,
800 pNewLmEncryptedWithOldLm,
802 &OldNtEncryptedWithNewNt,
803 &NewNtEncryptedWithOldNt,
810 TRACE(
"SamrChangePasswordUser failed (Status %08lx)\n",
Status);
815 if (UserHandle !=
NULL)
821 if (DomainHandle !=
NULL)
824 if (DomainSid !=
NULL)
827 if (ServerHandle !=
NULL)
850 ULONG LogonCount = 0;
855 TRACE(
"MsvpEnumerateUsers()\n");
868 CurrentEntry = CurrentEntry->
Flink;
871 TRACE(
"LogonCount %lu\n", LogonCount);
874 (LogonCount *
sizeof(
LUID)) +
875 (LogonCount *
sizeof(
ULONG));
878 if (LocalBuffer ==
NULL)
880 ERR(
"Failed to allocate the local buffer!\n");
890 ERR(
"DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n",
Status);
894 TRACE(
"ClientBaseAddress: %p\n", ClientBaseAddress);
921 CurrentEntry = CurrentEntry->
Flink;
930 ERR(
"DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n",
Status);
939 if (LocalBuffer !=
NULL)
944 if (ClientBaseAddress !=
NULL)
969 TRACE(
"LsaApCallPackage()\n");
976 *ProtocolReturnBuffer =
NULL;
977 *ReturnBufferLength = 0;
988 ProtocolSubmitBuffer,
991 ProtocolReturnBuffer,
1003 ProtocolSubmitBuffer,
1006 ProtocolReturnBuffer,
1034 IN PVOID ProtocolSubmitBuffer,
1041 TRACE(
"LsaApCallPackagePassthrough()\n");
1052 IN PVOID ProtocolSubmitBuffer,
1062 TRACE(
"LsaApCallPackageUntrusted()\n");
1069 *ProtocolReturnBuffer =
NULL;
1070 *ReturnBufferLength = 0;
1074 ProtocolSubmitBuffer,
1077 ProtocolReturnBuffer,
1101 TRACE(
"LsaApInitializePackage(%lu %p %p %p %p)\n",
1102 AuthenticationPackageId, LsaDispatchTable,
Database,
1103 Confidentiality, AuthenticationPackageName);
1113 DispatchTable.CreateLogonSession = LsaDispatchTable->CreateLogonSession;
1114 DispatchTable.DeleteLogonSession = LsaDispatchTable->DeleteLogonSession;
1115 DispatchTable.AddCredential = LsaDispatchTable->AddCredential;
1116 DispatchTable.GetCredentials = LsaDispatchTable->GetCredentials;
1117 DispatchTable.DeleteCredential = LsaDispatchTable->DeleteCredential;
1118 DispatchTable.AllocateLsaHeap = LsaDispatchTable->AllocateLsaHeap;
1120 DispatchTable.AllocateClientBuffer = LsaDispatchTable->AllocateClientBuffer;
1121 DispatchTable.FreeClientBuffer = LsaDispatchTable->FreeClientBuffer;
1122 DispatchTable.CopyToClientBuffer = LsaDispatchTable->CopyToClientBuffer;
1123 DispatchTable.CopyFromClientBuffer = LsaDispatchTable->CopyFromClientBuffer;
1127 if (NameString ==
NULL)
1131 if (NameBuffer ==
NULL)
1141 *AuthenticationPackageName = (
PLSA_STRING)NameString;
1154 TRACE(
"LsaApLogonTerminated()\n");
1184 *LogonProfile =
NULL;
1185 *LogonProfileSize = 0;
1186 *UserInfoPtr =
NULL;
1187 *AccountDomainSidPtr =
NULL;
1188 *SpecialAccount =
FALSE;
1189 LogonInfo = ProtocolSubmitBuffer;
1193 ERR(
"Invalid SubmitBufferSize %lu\n", SubmitBufferSize);
1209 LogonPwdData->IsNetwork =
TRUE;
1210 LogonPwdData->LogonInfo = LogonInfo;
1211 LogonPwdData->ComputerName = ComputerName;
1218 AccountDomainSidPtr,
1224 ERR(
"SamValidateUser failed with 0x%lx\n",
Status);
1237 ERR(
"BuildLm20LogonProfileBuffer failed with 0x%lx\n",
Status);
1242 *LogonUserRef = &LogonInfo->
UserName;
1255 IN PVOID ProtocolSubmitBuffer,
1280 DWORD ComputerNameSize;
1282 UCHAR LogonPassHash;
1286 TRACE(
"LsaApLogonUserEx2()\n");
1289 TRACE(
"ProtocolSubmitBuffer: %p\n", ProtocolSubmitBuffer);
1290 TRACE(
"SubmitBufferSize: %lu\n", SubmitBufferSize);
1293 *ProfileBufferSize = 0;
1295 *AccountName =
NULL;
1296 *AuthenticatingAuthority =
NULL;
1299 ComputerNameSize =
ARRAYSIZE(ComputerNameData);
1302 ERR(
"Failed to get Computername.\n");
1317 ERR(
"Invalid SubmitBufferSize %lu\n", SubmitBufferSize);
1396 if (LogonPassHash > 0)
1402 ErasePassword = &LogonInfo->
Password;
1408 LogonUserName = &LogonInfo->
UserName;
1423 ProtocolSubmitBuffer,
1466 TRACE(
"NtAllocateLocallyUniqueId failed (Status %08lx)\n",
Status);
1474 TRACE(
"CreateLogonSession failed (Status %08lx)\n",
Status);
1478 SessionCreated =
TRUE;
1500 TRACE(
"BuildInteractiveProfileBuffer failed (Status %08lx)\n",
Status);
1519 TRACE(
"BuildTokenInformationBuffer failed (Status %08lx)\n",
Status);
1531 if ((UserHandle !=
NULL) &&
1552 if ((LogonUserName !=
NULL) &&
1553 (*AccountName !=
NULL))
1557 if ((*AccountName)->Buffer !=
NULL)
1559 (*AccountName)->MaximumLength = LogonUserName->
Length +
1567 if ((LogonDomain !=
NULL) &&
1568 (*AuthenticatingAuthority !=
NULL))
1572 if ((*AuthenticatingAuthority)->Buffer !=
NULL)
1574 (*AuthenticatingAuthority)->MaximumLength = LogonDomain->
Length +
1585 if ((*MachineName)->Buffer !=
NULL)
1588 (*MachineName)->Length = ComputerName.
Length;
1598 if (SessionCreated !=
FALSE)
1609 if (UserHandle !=
NULL)
1642 TRACE(
"SpLsaModeInitialize(0x%lx %p %p %p)\n",
1643 LsaVersion, PackageVersion, ppTables, pcTables);
1667 TRACE(
"SpUserModeInitialize(0x%lx %p %p %p)\n",
1668 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)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define PtrOffset(BASE, OFFSET)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
#define STATUS_NOT_IMPLEMENTED
#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)
#define InsertTailList(ListHead, Entry)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
#define InitializeListHead(ListHead)
_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)
struct _LOGON_LIST_ENTRY * PLOGON_LIST_ENTRY
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)
struct _LOGON_LIST_ENTRY LOGON_LIST_ENTRY
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 MsvpEnumerateUsers(_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 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
struct _MSV1_0_ENUMUSERS_RESPONSE MSV1_0_ENUMUSERS_RESPONSE
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_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
struct _LIST_ENTRY * Flink
PUNICODE_STRING ComputerName
UNICODE_STRING AccountName
UNICODE_STRING NewPassword
UNICODE_STRING OldPassword
UNICODE_STRING DomainName
ULONG NumberOfLoggedOnUsers
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType
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 CONTAINING_RECORD(address, type, field)
#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