case SERVICE_CONTROL_PAUSE: // 2
pService->OnPause();
break;
case SERVICE_CONTROL_CONTINUE: // 3
pService->OnContinue();
break;
case SERVICE_CONTROL_INTERROGATE: // 4
pService->OnInterrogate();
break;
case SERVICE_CONTROL_SHUTDOWN: // 5
pService->OnShutdown();
break;
default:
if (dwOpcode >= SERVICE_CONTROL_USER) {
if (!pService->OnUserControl(dwOpcode)) {
pService->LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_BADREQUEST);
}
} else {
pService->LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_BADREQUEST);
}
break;
}
// Report current status
pService->DebugMsg("Updating status (%lu, %lu)",
pService->m_hServiceStatus,
pService->m_Status.dwCurrentState);
::SetServiceStatus(pService->m_hServiceStatus, &pService->m_Status);
}