summaryrefslogtreecommitdiff
path: root/ace/NT_Service.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2001-11-21 17:12:48 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2001-11-21 17:12:48 +0000
commit9341cf09df21eeef8e9ab339c4909746ac6aa4d7 (patch)
treefc589713f841ba3b2af74905f14377d532d7e784 /ace/NT_Service.cpp
parentbc828b70c0ab26cfbb59bfc48a4e8f7406332bc3 (diff)
downloadATCD-9341cf09df21eeef8e9ab339c4909746ac6aa4d7.tar.gz
ChangeLogTag:Wed Nov 21 09:07:37 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
Diffstat (limited to 'ace/NT_Service.cpp')
-rw-r--r--ace/NT_Service.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/ace/NT_Service.cpp b/ace/NT_Service.cpp
index 614fa9dfb1f..a1989ec4957 100644
--- a/ace/NT_Service.cpp
+++ b/ace/NT_Service.cpp
@@ -380,9 +380,16 @@ ACE_NT_Service::state (DWORD *pstate,
ACE_Time_Value *wait_hint)
{
SC_HANDLE svc = this->svc_sc_handle ();
+
if (svc == 0)
return -1;
+ // Need to create a temporary copy of this variable since the
+ // QueryServiceStatus call will modify the setting depending on the
+ // current state of the Service. If the service is currently
+ // STOPPED, the value will be cleared.
+ DWORD controls_accepted = svc_status_.dwControlsAccepted;
+
if (QueryServiceStatus (svc,
&this->svc_status_) == 0)
return -1;
@@ -391,7 +398,7 @@ ACE_NT_Service::state (DWORD *pstate,
wait_hint->msec (this->svc_status_.dwWaitHint);
*pstate = this->svc_status_.dwCurrentState;
-
+ this->svc_status_.dwControlsAccepted = controls_accepted;
return 0;
}