Added service_status_text().

Function to get a string representation of a service status, eg
SERVICE_RUNNING.
master
Iain Patterson 11 years ago
parent f1d6394333
commit 8d884cbd58

@ -1292,6 +1292,19 @@ TCHAR *service_control_text(unsigned long control) {
}
}
TCHAR *service_status_text(unsigned long status) {
switch (status) {
case SERVICE_STOPPED: return _T("SERVICE_STOPPED");
case SERVICE_START_PENDING: return _T("SERVICE_START_PENDING");
case SERVICE_STOP_PENDING: return _T("SERVICE_STOP_PENDING");
case SERVICE_RUNNING: return _T("SERVICE_RUNNING");
case SERVICE_CONTINUE_PENDING: return _T("SERVICE_CONTINUE_PENDING");
case SERVICE_PAUSE_PENDING: return _T("SERVICE_PAUSE_PENDING");
case SERVICE_PAUSED: return _T("SERVICE_PAUSED");
default: return 0;
}
}
void log_service_control(TCHAR *service_name, unsigned long control, bool handled) {
TCHAR *text = service_control_text(control);
unsigned long event;

@ -104,6 +104,7 @@ typedef struct {
void WINAPI service_main(unsigned long, TCHAR **);
TCHAR *service_control_text(unsigned long);
TCHAR *service_status_text(unsigned long);
void log_service_control(TCHAR *, unsigned long, bool);
unsigned long WINAPI service_control_handler(unsigned long, unsigned long, void *, void *);

Loading…
Cancel
Save