Author: ekohl
Date: Mon Mar 8 21:42:48 2010
New Revision: 46002
URL:
http://svn.reactos.org/svn/reactos?rev=46002&view=rev
Log:
SEH-Protect the call to RSetServiceStatus in SetServiceStatus. This keeps services from
crashing when the connection to the service manager fails.
Modified:
trunk/reactos/dll/win32/advapi32/service/sctrl.c
Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] Mon Mar 8 21:42:48
2010
@@ -651,9 +651,18 @@
TRACE("SetServiceStatus() called\n");
TRACE("hServiceStatus %lu\n", hServiceStatus);
- /* Call to services.exe using RPC */
- dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
- lpServiceStatus);
+ RpcTryExcept
+ {
+ /* Call to services.exe using RPC */
+ dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
+ lpServiceStatus);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ dwError = ScmRpcStatusToWinError(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
if (dwError != ERROR_SUCCESS)
{
ERR("ScmrSetServiceStatus() failed (Error %lu)\n", dwError);