| 170 | } |
| 171 | |
| 172 | void ConcreteService::ReportServiceStatus(DWORD currentState, DWORD win32ExitCode, |
| 173 | DWORD waitHint) |
| 174 | { |
| 175 | mServiceStatus.dwCurrentState = currentState; |
| 176 | mServiceStatus.dwWin32ExitCode = win32ExitCode; |
| 177 | mServiceStatus.dwWaitHint = waitHint; |
| 178 | |
| 179 | if (currentState == SERVICE_START_PENDING) { |
| 180 | // If we are in a PENDING state do not accept any controls. |
| 181 | mServiceStatus.dwControlsAccepted = 0; |
| 182 | // Increment the check point to indicate to the SCM progress |
| 183 | // is being made |
| 184 | mServiceStatus.dwCheckPoint = mCheckPoint++; |
| 185 | } |
| 186 | else if (currentState == SERVICE_RUNNING || |
| 187 | currentState == SERVICE_STOP_PENDING || |
| 188 | currentState == SERVICE_STOPPED) { |
| 189 | // If we transitioned to a RUNNING, STOP_PENDING or STOPPED state |
| 190 | // we accept a STOP control |
| 191 | mServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; |
| 192 | mServiceStatus.dwCheckPoint = 0; |
| 193 | } |
| 194 | else { |
| 195 | // We only set START_PENDING, RUNNING, STOP_PENDING and STOPPED. |
| 196 | // Please check this incoming currentState. |
| 197 | assert(false); |
| 198 | } |
| 199 | |
| 200 | SetServiceStatus(mServiceStatusHandle, &mServiceStatus); |
| 201 | } |
| 202 | |
| 203 | |
| 204 | // debug mock service |
no outgoing calls
no test coverage detected