From: Guus Sliepen Date: Fri, 8 Aug 2003 12:55:05 +0000 (+0000) Subject: Tell windows to be patient. X-Git-Tag: release-1.0.1~22 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=070aee3be16b8d8078b049c5bb43dce7b18123df;p=tinc Tell windows to be patient. --- diff --git a/src/process.c b/src/process.c index babdf436..3c7164be 100644 --- a/src/process.c +++ b/src/process.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: process.c,v 1.1.2.63 2003/08/03 21:45:13 guus Exp $ + $Id: process.c,v 1.1.2.64 2003/08/08 12:55:05 guus Exp $ */ #include "system.h" @@ -166,6 +166,7 @@ DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) { } if(!running) { + status.dwWaitHint = 30000; status.dwCurrentState = SERVICE_STOP_PENDING; SetServiceStatus(statushandle, &status); } @@ -184,7 +185,6 @@ VOID WINAPI run_service(DWORD argc, LPTSTR* argv) status.dwWin32ExitCode = 0; status.dwServiceSpecificExitCode = 0; status.dwCheckPoint = 0; - status.dwWaitHint = 0; statushandle = RegisterServiceCtrlHandlerEx(identname, controlhandler, NULL); @@ -192,14 +192,17 @@ VOID WINAPI run_service(DWORD argc, LPTSTR* argv) logger(LOG_ERR, _("System call `%s' failed: %s"), "RegisterServiceCtrlHandlerEx", winerror(GetLastError())); err = 1; } else { + status.dwWaitHint = 30000; status.dwCurrentState = SERVICE_START_PENDING; SetServiceStatus(statushandle, &status); + status.dwWaitHint = 0; status.dwCurrentState = SERVICE_RUNNING; SetServiceStatus(statushandle, &status); err = main2(argc, argv); + status.dwWaitHint = 0; status.dwCurrentState = SERVICE_STOPPED; //status.dwWin32ExitCode = err; SetServiceStatus(statushandle, &status);