From dbca423cf889a2efd18b3e1108c3cf5fe4c7570f Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Mon, 22 Jun 2020 19:25:47 +0200 Subject: [PATCH] [MSV1_0] Stub LsaApLogonUserEx2_Network (4/5) This is a part of the Partial Network Login Implementation PR. --- dll/win32/msv1_0/msv1_0.c | 70 ++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index c60453f1745..eefddf3d0e0 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -909,6 +909,31 @@ LsaApLogonTerminated(IN PLUID LogonId) } +/* + * Handle Network logon + */ +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) +{ + return STATUS_NOT_IMPLEMENTED; +} + /* * @implemented */ @@ -1080,6 +1105,26 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, // TODO: If LogonType == Service, do some extra work using LogonInfo->Password. } + else if (LogonType == Network) + { + Status = LsaApLogonUserEx2_Network(ClientRequest, + ProtocolSubmitBuffer, + ClientBufferBase, + SubmitBufferSize, + &ComputerName, + &LogonUserName, + &LogonDomain, + &LogonPwdData, + &UserHandle, + &UserInfo, + &AccountDomainSid, + &SpecialAccount, + (PMSV1_0_LM20_LOGON_PROFILE*)ProfileBuffer, + ProfileBufferSize, + SubStatus); + if (!NT_SUCCESS(Status)) + goto done; + } else { FIXME("LogonType %lu is not supported yet!\n", LogonType); @@ -1120,16 +1165,23 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, SessionCreated = TRUE; - /* Build and fill the interactive profile buffer */ - Status = BuildInteractiveProfileBuffer(ClientRequest, - UserInfo, - ComputerNameData, - (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer, - ProfileBufferSize); - if (!NT_SUCCESS(Status)) + if (LogonType == Interactive || LogonType == Batch || LogonType == Service) { - TRACE("BuildInteractiveProfileBuffer failed (Status %08lx)\n", Status); - goto done; + /* Build and fill the interactive profile buffer */ + Status = BuildInteractiveProfileBuffer(ClientRequest, + UserInfo, + ComputerName.Buffer, + (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer, + ProfileBufferSize); + if (!NT_SUCCESS(Status)) + { + TRACE("BuildInteractiveProfileBuffer failed (Status %08lx)\n", Status); + goto done; + } + } + else if (LogonType == Network) + { + //FIXME: no need to do anything, its already done ... } /* Return the token information type */