diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-11-21 17:12:48 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-11-21 17:12:48 +0000 |
commit | d56c392e9961ffbf780734f0463e47efb9867128 (patch) | |
tree | fc589713f841ba3b2af74905f14377d532d7e784 /ace/NT_Service.cpp | |
parent | a941f971a10798b86905a040ffc48e466b01c724 (diff) | |
download | ATCD-d56c392e9961ffbf780734f0463e47efb9867128.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.cpp | 9 |
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; } |