mirror of
https://github.com/reactos/reactos.git
synced 2025-07-01 06:21:21 +00:00
[LSALIB]
- Implement LsaConnectUntrusted. - Remove dead code. - LsaRegisterLogonProcess: Fix ConnectInfo.Status check. svn path=/trunk/; revision=59369
This commit is contained in:
parent
d9ba33534f
commit
aef959eff2
1 changed files with 41 additions and 139 deletions
|
@ -66,13 +66,50 @@ LsaDeregisterLogonProcess(HANDLE LsaHandle)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI
|
NTSTATUS WINAPI
|
||||||
LsaConnectUntrusted(PHANDLE LsaHandle)
|
LsaConnectUntrusted(PHANDLE LsaHandle)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort");
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||||
|
LSA_CONNECTION_INFO ConnectInfo;
|
||||||
|
ULONG ConnectInfoLength = sizeof(ConnectInfo);
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
DPRINT1("LsaConnectUntrusted(%p)\n", LsaHandle);
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&PortName,
|
||||||
|
L"\\LsaAuthenticationPort");
|
||||||
|
|
||||||
|
SecurityQos.Length = sizeof(SecurityQos);
|
||||||
|
SecurityQos.ImpersonationLevel = SecurityIdentification;
|
||||||
|
SecurityQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
|
||||||
|
SecurityQos.EffectiveOnly = TRUE;
|
||||||
|
|
||||||
|
RtlZeroMemory(&ConnectInfo,
|
||||||
|
ConnectInfoLength);
|
||||||
|
|
||||||
|
Status = ZwConnectPort(LsaHandle,
|
||||||
|
&PortName,
|
||||||
|
&SecurityQos,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ConnectInfo,
|
||||||
|
&ConnectInfoLength);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("ZwConnectPort failed (Status 0x%08lx)\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(ConnectInfo.Status))
|
||||||
|
{
|
||||||
|
DPRINT1("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ConnectInfo.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,56 +159,6 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle,
|
||||||
*ProtocolStatus = ApiMessage.CallAuthenticationPackage.Reply.ProtocolStatus;
|
*ProtocolStatus = ApiMessage.CallAuthenticationPackage.Reply.ProtocolStatus;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
PLSASS_REQUEST Request;
|
|
||||||
PLSASS_REPLY Reply;
|
|
||||||
LSASS_REQUEST RawRequest;
|
|
||||||
LSASS_REPLY RawReply;
|
|
||||||
NTSTATUS Status;
|
|
||||||
ULONG OutBufferSize;
|
|
||||||
|
|
||||||
Request = (PLSASS_REQUEST)&RawRequest;
|
|
||||||
Reply = (PLSASS_REPLY)&RawReply;
|
|
||||||
|
|
||||||
Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + SubmitBufferLength -
|
|
||||||
sizeof(PORT_MESSAGE);
|
|
||||||
Request->Header.u1.s1.TotalLength =
|
|
||||||
Request->Header.u1.s1.DataLength + sizeof(PORT_MESSAGE);
|
|
||||||
Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE;
|
|
||||||
Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
|
|
||||||
AuthenticationPackage;
|
|
||||||
Request->d.CallAuthenticationPackageRequest.InBufferLength =
|
|
||||||
SubmitBufferLength;
|
|
||||||
memcpy(Request->d.CallAuthenticationPackageRequest.InBuffer,
|
|
||||||
ProtocolSubmitBuffer,
|
|
||||||
SubmitBufferLength);
|
|
||||||
|
|
||||||
Status = ZwRequestWaitReplyPort(LsaHandle,
|
|
||||||
&Request->Header,
|
|
||||||
&Reply->Header);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Reply->Status))
|
|
||||||
{
|
|
||||||
return Reply->Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
OutBufferSize = Reply->d.CallAuthenticationPackageReply.OutBufferLength;
|
|
||||||
*ProtocolReturnBuffer = RtlAllocateHeap(Secur32Heap,
|
|
||||||
0,
|
|
||||||
OutBufferSize);
|
|
||||||
*ReturnBufferLength = OutBufferSize;
|
|
||||||
memcpy(*ProtocolReturnBuffer,
|
|
||||||
Reply->d.CallAuthenticationPackageReply.OutBuffer,
|
|
||||||
*ReturnBufferLength);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -297,91 +284,6 @@ LsaLogonUser(HANDLE LsaHandle,
|
||||||
*SubStatus = ApiMessage.LogonUser.Reply.SubStatus;
|
*SubStatus = ApiMessage.LogonUser.Reply.SubStatus;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
#if 0
|
|
||||||
ULONG RequestLength;
|
|
||||||
ULONG CurrentLength;
|
|
||||||
PLSASS_REQUEST Request;
|
|
||||||
LSASS_REQUEST RawMessage;
|
|
||||||
PLSASS_REPLY Reply;
|
|
||||||
LSASS_REPLY RawReply;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
RequestLength = sizeof(LSASS_REQUEST) - sizeof(PORT_MESSAGE);
|
|
||||||
RequestLength = RequestLength + (OriginName->Length * sizeof(WCHAR));
|
|
||||||
RequestLength = RequestLength + AuthenticationInformationLength;
|
|
||||||
RequestLength = RequestLength +
|
|
||||||
(LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
|
||||||
|
|
||||||
CurrentLength = 0;
|
|
||||||
Request = (PLSASS_REQUEST)&RawMessage;
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.OriginNameLength = OriginName->Length;
|
|
||||||
Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage + CurrentLength;
|
|
||||||
memcpy((PWSTR)&RawMessage + CurrentLength,
|
|
||||||
OriginName->Buffer,
|
|
||||||
OriginName->Length * sizeof(WCHAR));
|
|
||||||
CurrentLength = CurrentLength + (OriginName->Length * sizeof(WCHAR));
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.LogonType = LogonType;
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.AuthenticationPackage =
|
|
||||||
AuthenticationPackage;
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.AuthenticationInformation =
|
|
||||||
(PVOID)((ULONG_PTR)&RawMessage + CurrentLength);
|
|
||||||
Request->d.LogonUserRequest.AuthenticationInformationLength =
|
|
||||||
AuthenticationInformationLength;
|
|
||||||
memcpy((PVOID)((ULONG_PTR)&RawMessage + CurrentLength),
|
|
||||||
AuthenticationInformation,
|
|
||||||
AuthenticationInformationLength);
|
|
||||||
CurrentLength = CurrentLength + AuthenticationInformationLength;
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.LocalGroupsCount = LocalGroups->GroupCount;
|
|
||||||
Request->d.LogonUserRequest.LocalGroups =
|
|
||||||
(PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength;
|
|
||||||
memcpy((PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength,
|
|
||||||
LocalGroups->Groups,
|
|
||||||
LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES));
|
|
||||||
|
|
||||||
Request->d.LogonUserRequest.SourceContext = *SourceContext;
|
|
||||||
|
|
||||||
Request->Type = LSASS_REQUEST_LOGON_USER;
|
|
||||||
Request->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
|
|
||||||
Request->Header.u1.s1.TotalLength = RequestLength + sizeof(PORT_MESSAGE);
|
|
||||||
|
|
||||||
Reply = (PLSASS_REPLY)&RawReply;
|
|
||||||
|
|
||||||
Status = ZwRequestWaitReplyPort(LsaHandle,
|
|
||||||
&Request->Header,
|
|
||||||
&Reply->Header);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
*SubStatus = Reply->d.LogonUserReply.SubStatus;
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Reply->Status))
|
|
||||||
{
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
*ProfileBuffer = RtlAllocateHeap(Secur32Heap,
|
|
||||||
0,
|
|
||||||
Reply->d.LogonUserReply.ProfileBufferLength);
|
|
||||||
memcpy(*ProfileBuffer,
|
|
||||||
(PVOID)((ULONG_PTR)Reply->d.LogonUserReply.Data +
|
|
||||||
(ULONG_PTR)Reply->d.LogonUserReply.ProfileBuffer),
|
|
||||||
Reply->d.LogonUserReply.ProfileBufferLength);
|
|
||||||
*LogonId = Reply->d.LogonUserReply.LogonId;
|
|
||||||
*Token = Reply->d.LogonUserReply.Token;
|
|
||||||
memcpy(Quotas,
|
|
||||||
&Reply->d.LogonUserReply.Quotas,
|
|
||||||
sizeof(Reply->d.LogonUserReply.Quotas));
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -436,7 +338,7 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
|
||||||
DPRINT("ConnectInfo.OperationalMode: 0x%08lx\n", ConnectInfo.OperationalMode);
|
DPRINT("ConnectInfo.OperationalMode: 0x%08lx\n", ConnectInfo.OperationalMode);
|
||||||
*OperationalMode = ConnectInfo.OperationalMode;
|
*OperationalMode = ConnectInfo.OperationalMode;
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(ConnectInfo.Status))
|
||||||
{
|
{
|
||||||
DPRINT1("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status);
|
DPRINT1("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue