mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[LSALIB]
- LsaRegisterLogonProcess: Wait for the LSA_AUTHENTICATION_INITIALIZED event. - LsaDeregisterLogonProcess: Use ZwClose to close the port handle. svn path=/trunk/; revision=72756
This commit is contained in:
parent
dff8dfadb8
commit
73975f8f4a
1 changed files with 33 additions and 26 deletions
|
@ -209,17 +209,14 @@ LsaRegisterLogonProcess(IN PLSA_STRING LogonProcessName,
|
|||
OUT PHANDLE LsaHandle,
|
||||
OUT PLSA_OPERATIONAL_MODE OperationalMode)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
#if 0
|
||||
HANDLE EventHandle;
|
||||
#endif
|
||||
UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort");
|
||||
#if 0
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
#endif
|
||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||
LSA_CONNECTION_INFO ConnectInfo;
|
||||
ULONG ConnectInfoLength = sizeof(ConnectInfo);
|
||||
UNICODE_STRING PortName;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
UNICODE_STRING EventName;
|
||||
HANDLE EventHandle;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("LsaRegisterLogonProcess()\n");
|
||||
|
||||
|
@ -227,36 +224,46 @@ LsaRegisterLogonProcess(IN PLSA_STRING LogonProcessName,
|
|||
if (LogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH)
|
||||
return STATUS_NAME_TOO_LONG;
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* First check whether the LSA server is ready:
|
||||
* open the LSA event and wait on it.
|
||||
*/
|
||||
// Note that we just reuse the 'PortName' variable here.
|
||||
RtlInitUnicodeString(&PortName, L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED");
|
||||
/* Wait for the LSA authentication thread */
|
||||
RtlInitUnicodeString(&EventName,
|
||||
L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED");
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&PortName,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
&EventName,
|
||||
OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
|
||||
NULL,
|
||||
NULL);
|
||||
Status = NtOpenEvent(&EventHandle, SYNCHRONIZE, &ObjectAttributes);
|
||||
Status = ZwOpenEvent(&EventHandle,
|
||||
SYNCHRONIZE,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtOpenEvent failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
DPRINT"NtOpenEvent failed (Status 0x%08lx)\n", Status);
|
||||
|
||||
Status = ZwCreateEvent(&EventHandle,
|
||||
SYNCHRONIZE,
|
||||
&ObjectAttributes,
|
||||
NotificationEvent,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtCreateEvent failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
Status = NtWaitForSingleObject(EventHandle, TRUE, NULL);
|
||||
NtClose(EventHandle);
|
||||
Status = ZwWaitForSingleObject(EventHandle,
|
||||
TRUE,
|
||||
NULL);
|
||||
ZwClose(EventHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtWaitForSingleObject failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now attempt the connection */
|
||||
RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort");
|
||||
/* Establish the connection */
|
||||
RtlInitUnicodeString(&PortName,
|
||||
L"\\LsaAuthenticationPort");
|
||||
|
||||
SecurityQos.Length = sizeof(SecurityQos);
|
||||
SecurityQos.ImpersonationLevel = SecurityIdentification;
|
||||
|
@ -328,7 +335,7 @@ LsaDeregisterLogonProcess(IN HANDLE LsaHandle)
|
|||
return ApiMessage.Status;
|
||||
}
|
||||
|
||||
NtClose(LsaHandle);
|
||||
ZwClose(LsaHandle);
|
||||
|
||||
DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status);
|
||||
|
||||
|
|
Loading…
Reference in a new issue