Author: gedmurphy
Date: Wed Jan 6 14:10:09 2010
New Revision: 44976
URL:
http://svn.reactos.org/svn/reactos?rev=44976&view=rev
Log:
Fix pause / resume code. The buttons need fixing yet so it still won't work, although
the menu items probably will.
Modified:
trunk/reactos/base/applications/mscutils/servman/control.c
Modified: trunk/reactos/base/applications/mscutils/servman/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/control.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/control.c [iso-8859-1] Wed Jan 6
14:10:09 2010
@@ -23,7 +23,22 @@
DWORD dwOldCheckPoint;
DWORD dwWaitTime;
DWORD dwMaxWait;
+ DWORD dwReqState;
BOOL bRet = FALSE;
+
+ /* Set the state we're interested in */
+ switch (Control)
+ {
+ case SERVICE_CONTROL_PAUSE:
+ dwReqState = SERVICE_PAUSED;
+ break;
+ case SERVICE_CONTROL_CONTINUE:
+ dwReqState = SERVICE_RUNNING;
+ break;
+ default:
+ /* Unhandled control code */
+ return FALSE;
+ }
hSCManager = OpenSCManager(NULL,
NULL,
@@ -32,7 +47,7 @@
{
hService = OpenService(hSCManager,
Info->pCurrentService->lpServiceName,
- SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE |
SERVICE_QUERY_CONFIG);
+ SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE |
SERVICE_QUERY_STATUS);
if (hService)
{
if (hProgress)
@@ -58,7 +73,7 @@
dwStartTickCount = GetTickCount();
/* Loop until it's at the correct state */
- while (ServiceStatus.dwCurrentState != Control)
+ while (ServiceStatus.dwCurrentState != dwReqState)
{
dwOldCheckPoint = ServiceStatus.dwCheckPoint;
dwWaitTime = ServiceStatus.dwWaitHint / 10;
@@ -103,7 +118,7 @@
}
}
- if (ServiceStatus.dwCurrentState == Control)
+ if (ServiceStatus.dwCurrentState == dwReqState)
{
bRet = TRUE;
}