mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
[LSASRV] Move the LSA_RPC_SERVER_ACTIVE event creation to a better place, in LsarStartRpcServer().
This commit is contained in:
parent
0208a4d196
commit
c901c3d37f
4 changed files with 44 additions and 37 deletions
|
@ -182,7 +182,6 @@ LsapInitSids(VOID)
|
||||||
hInstance = GetModuleHandleW(L"lsasrv.dll");
|
hInstance = GetModuleHandleW(L"lsasrv.dll");
|
||||||
|
|
||||||
/* NT Authority */
|
/* NT Authority */
|
||||||
|
|
||||||
LsapLoadString(hInstance, IDS_NT_AUTHORITY, szAccountName, ARRAYSIZE(szAccountName));
|
LsapLoadString(hInstance, IDS_NT_AUTHORITY, szAccountName, ARRAYSIZE(szAccountName));
|
||||||
LsapLoadString(hInstance, IDS_NT_AUTHORITY, szDomainName, ARRAYSIZE(szDomainName));
|
LsapLoadString(hInstance, IDS_NT_AUTHORITY, szDomainName, ARRAYSIZE(szDomainName));
|
||||||
LsapCreateSid(&NtAuthority,
|
LsapCreateSid(&NtAuthority,
|
||||||
|
|
|
@ -36,10 +36,12 @@ LsapSecretMapping = {SECRET_READ,
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
VOID
|
NTSTATUS
|
||||||
LsarStartRpcServer(VOID)
|
LsarStartRpcServer(VOID)
|
||||||
{
|
{
|
||||||
RPC_STATUS Status;
|
RPC_STATUS Status;
|
||||||
|
DWORD dwError;
|
||||||
|
HANDLE hEvent;
|
||||||
|
|
||||||
RtlInitializeCriticalSection(&PolicyHandleTableLock);
|
RtlInitializeCriticalSection(&PolicyHandleTableLock);
|
||||||
|
|
||||||
|
@ -52,7 +54,7 @@ LsarStartRpcServer(VOID)
|
||||||
if (Status != RPC_S_OK)
|
if (Status != RPC_S_OK)
|
||||||
{
|
{
|
||||||
WARN("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
|
WARN("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
|
||||||
return;
|
return I_RpcMapWin32Status(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RpcServerRegisterIf(lsarpc_v0_0_s_ifspec,
|
Status = RpcServerRegisterIf(lsarpc_v0_0_s_ifspec,
|
||||||
|
@ -61,7 +63,7 @@ LsarStartRpcServer(VOID)
|
||||||
if (Status != RPC_S_OK)
|
if (Status != RPC_S_OK)
|
||||||
{
|
{
|
||||||
WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status);
|
WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status);
|
||||||
return;
|
return I_RpcMapWin32Status(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
DsSetupInit();
|
DsSetupInit();
|
||||||
|
@ -70,10 +72,42 @@ LsarStartRpcServer(VOID)
|
||||||
if (Status != RPC_S_OK)
|
if (Status != RPC_S_OK)
|
||||||
{
|
{
|
||||||
WARN("RpcServerListen() failed (Status %lx)\n", Status);
|
WARN("RpcServerListen() failed (Status %lx)\n", Status);
|
||||||
return;
|
return I_RpcMapWin32Status(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Notify the service manager */
|
||||||
|
TRACE("Creating notification event!\n");
|
||||||
|
hEvent = CreateEventW(NULL,
|
||||||
|
TRUE,
|
||||||
|
FALSE,
|
||||||
|
L"LSA_RPC_SERVER_ACTIVE");
|
||||||
|
if (hEvent == NULL)
|
||||||
|
{
|
||||||
|
dwError = GetLastError();
|
||||||
|
TRACE("Failed to create or open the notification event (Error %lu)\n", dwError);
|
||||||
|
#if 0
|
||||||
|
if (dwError == ERROR_ALREADY_EXISTS)
|
||||||
|
{
|
||||||
|
hEvent = OpenEventW(GENERIC_WRITE,
|
||||||
|
FALSE,
|
||||||
|
L"LSA_RPC_SERVER_ACTIVE");
|
||||||
|
if (hEvent == NULL)
|
||||||
|
{
|
||||||
|
ERR("Could not open the notification event (Error %lu)\n", GetLastError());
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Set notification event!\n");
|
||||||
|
SetEvent(hEvent);
|
||||||
|
|
||||||
|
/* NOTE: Do not close the event handle, as it must remain alive! */
|
||||||
|
|
||||||
TRACE("LsarStartRpcServer() done\n");
|
TRACE("LsarStartRpcServer() done\n");
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -271,8 +271,6 @@ LsaIFree_LSAPR_TRANSLATED_SIDS(
|
||||||
NTSTATUS WINAPI
|
NTSTATUS WINAPI
|
||||||
LsapInitLsa(VOID)
|
LsapInitLsa(VOID)
|
||||||
{
|
{
|
||||||
HANDLE hEvent;
|
|
||||||
DWORD dwError;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
TRACE("LsapInitLsa() called\n");
|
TRACE("LsapInitLsa() called\n");
|
||||||
|
@ -302,7 +300,7 @@ LsapInitLsa(VOID)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the authentication port thread */
|
/* Start the authentication LPC port thread */
|
||||||
Status = StartAuthenticationPort();
|
Status = StartAuthenticationPort();
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -311,37 +309,13 @@ LsapInitLsa(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the RPC server */
|
/* Start the RPC server */
|
||||||
LsarStartRpcServer();
|
Status = LsarStartRpcServer();
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
TRACE("Creating notification event!\n");
|
|
||||||
/* Notify the service manager */
|
|
||||||
hEvent = CreateEventW(NULL,
|
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
L"LSA_RPC_SERVER_ACTIVE");
|
|
||||||
if (hEvent == NULL)
|
|
||||||
{
|
{
|
||||||
dwError = GetLastError();
|
ERR("LsarStartRpcServer() failed (Status 0x%08lx)\n", Status);
|
||||||
TRACE("Failed to create the notification event (Error %lu)\n", dwError);
|
return Status;
|
||||||
|
|
||||||
if (dwError == ERROR_ALREADY_EXISTS)
|
|
||||||
{
|
|
||||||
hEvent = OpenEventW(GENERIC_WRITE,
|
|
||||||
FALSE,
|
|
||||||
L"LSA_RPC_SERVER_ACTIVE");
|
|
||||||
if (hEvent == NULL)
|
|
||||||
{
|
|
||||||
ERR("Could not open the notification event (Error %lu)\n", GetLastError());
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Set notification event!\n");
|
|
||||||
SetEvent(hEvent);
|
|
||||||
|
|
||||||
/* NOTE: Do not close the event handle!!!! */
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
|
||||||
DWORD ClientRevision);
|
DWORD ClientRevision);
|
||||||
|
|
||||||
/* lsarpc.c */
|
/* lsarpc.c */
|
||||||
VOID
|
NTSTATUS
|
||||||
LsarStartRpcServer(VOID);
|
LsarStartRpcServer(VOID);
|
||||||
|
|
||||||
/* policy.c */
|
/* policy.c */
|
||||||
|
|
Loading…
Reference in a new issue