Author: hbelusca Date: Mon Feb 6 16:56:32 2017 New Revision: 73726
URL: http://svn.reactos.org/svn/reactos?rev=73726&view=rev Log: [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.
Modified: trunk/reactos/base/services/rpcss/service_main.c trunk/reactos/base/services/svchost/rpcsrv.c trunk/reactos/base/services/thmsvc/thmsvc.c trunk/reactos/base/system/winlogon/rpcserver.c trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/samsrv/samrpc.c
Modified: trunk/reactos/base/services/rpcss/service_main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/rpcss/service... ============================================================================== --- trunk/reactos/base/services/rpcss/service_main.c [iso-8859-1] (original) +++ trunk/reactos/base/services/rpcss/service_main.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -82,9 +82,10 @@
WaitForSingleObject(exit_event, INFINITE);
+ RPCSS_Shutdown(); + ServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(ServiceStatusHandle, &ServiceStatus); - RPCSS_Shutdown(); } }
Modified: trunk/reactos/base/services/svchost/rpcsrv.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/svchost/rpcsr... ============================================================================== --- trunk/reactos/base/services/svchost/rpcsrv.c [iso-8859-1] (original) +++ trunk/reactos/base/services/svchost/rpcsrv.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -98,7 +98,9 @@ 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 @@ } else { - /* It worked, register an interface on this endpoint now*/ + /* It worked, register an interface on this endpoint now */ rpcStatus = RpcServerRegisterIf(IfSpec, 0, 0); }
Modified: trunk/reactos/base/services/thmsvc/thmsvc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/thmsvc/thmsvc... ============================================================================== --- trunk/reactos/base/services/thmsvc/thmsvc.c [iso-8859-1] (original) +++ trunk/reactos/base/services/thmsvc/thmsvc.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -74,8 +74,8 @@ { case SERVICE_CONTROL_STOP: TRACE(" SERVICE_CONTROL_STOP received\n"); + ThemeHooksRemove(); UpdateServiceStatus(SERVICE_STOPPED); - ThemeHooksRemove(); return ERROR_SUCCESS;
case SERVICE_CONTROL_PAUSE:
Modified: trunk/reactos/base/system/winlogon/rpcserver.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/rpcser... ============================================================================== --- trunk/reactos/base/system/winlogon/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/rpcserver.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -24,7 +24,7 @@ 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)
Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?r... ============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -46,7 +46,7 @@ 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)
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?r... ============================================================================== --- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Mon Feb 6 16:56:32 2017 @@ -82,7 +82,7 @@ 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)