[RPCSS][THMSVC]: Perform the internal cleanup tasks before calling SetServiceStatus with 'dwCurrentState = SERVICE_STOPPED', because otherwise (if internal cleanup is done after calling SetServiceStatus) the SCM could kill the service in the middle of its cleanup tasks.

[SVCHOST][WINLOGON][LSASRV][SAMSRV]: Use the SDK-defined constant RPC_C_PROTSEQ_MAX_REQS_DEFAULT instead of hardcoding its value in the RpcServerUseProtseqEpW calls.

svn path=/trunk/; revision=73726
This commit is contained in:
Hermès Bélusca-Maïto 2017-02-06 16:56:32 +00:00
parent 0b7e31082f
commit 826536350c
6 changed files with 10 additions and 7 deletions

View file

@ -82,9 +82,10 @@ ServiceMain(DWORD argc, LPWSTR argv[])
WaitForSingleObject(exit_event, INFINITE);
RPCSS_Shutdown();
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
RPCSS_Shutdown();
}
}

View file

@ -98,7 +98,9 @@ RpcpAddInterface (
wcscat(endpointName, IfName);
/* Create a named pipe endpoint with this name */
rpcStatus = RpcServerUseProtseqEpW(L"ncacn_np", 10, endpointName, NULL);
rpcStatus = RpcServerUseProtseqEpW(L"ncacn_np",
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
endpointName, NULL);
if ((rpcStatus != RPC_S_OK) && (rpcStatus != RPC_S_DUPLICATE_ENDPOINT))
{
/* We couldn't create it, or it already existed... */
@ -106,7 +108,7 @@ RpcpAddInterface (
}
else
{
/* It worked, register an interface on this endpoint now*/
/* It worked, register an interface on this endpoint now */
rpcStatus = RpcServerRegisterIf(IfSpec, 0, 0);
}

View file

@ -74,8 +74,8 @@ ServiceControlHandler(DWORD dwControl,
{
case SERVICE_CONTROL_STOP:
TRACE(" SERVICE_CONTROL_STOP received\n");
UpdateServiceStatus(SERVICE_STOPPED);
ThemeHooksRemove();
UpdateServiceStatus(SERVICE_STOPPED);
return ERROR_SUCCESS;
case SERVICE_CONTROL_PAUSE:

View file

@ -24,7 +24,7 @@ StartRpcServer(VOID)
TRACE("StartRpcServer() called\n");
Status = RpcServerUseProtseqEpW(L"ncacn_np",
10,
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
L"\\pipe\\winreg",
NULL);
if (Status != RPC_S_OK)

View file

@ -46,7 +46,7 @@ LsarStartRpcServer(VOID)
TRACE("LsarStartRpcServer() called\n");
Status = RpcServerUseProtseqEpW(L"ncacn_np",
10,
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
L"\\pipe\\lsarpc",
NULL);
if (Status != RPC_S_OK)

View file

@ -82,7 +82,7 @@ SampStartRpcServer(VOID)
TRACE("SampStartRpcServer() called\n");
Status = RpcServerUseProtseqEpW(L"ncacn_np",
10,
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
L"\\pipe\\samr",
NULL);
if (Status != RPC_S_OK)