+ (void) nssm_hook(&hook_threads, service, NSSM_HOOK_EVENT_ROTATE, NSSM_HOOK_ACTION_POST, &control);\r
+ return NO_ERROR;\r
+\r
+ case SERVICE_CONTROL_POWEREVENT:\r
+ /* Resume from suspend. */\r
+ if (event == PBT_APMRESUMEAUTOMATIC) {\r
+ service->last_control = control;\r
+ log_service_control(service->name, control, true);\r
+ (void) nssm_hook(&hook_threads, service, NSSM_HOOK_EVENT_POWER, NSSM_HOOK_ACTION_RESUME, &control);\r
+ return NO_ERROR;\r
+ }\r
+\r
+ /* Battery low or changed to A/C power or something. */\r
+ if (event == PBT_APMPOWERSTATUSCHANGE) {\r
+ service->last_control = control;\r
+ log_service_control(service->name, control, true);\r
+ (void) nssm_hook(&hook_threads, service, NSSM_HOOK_EVENT_POWER, NSSM_HOOK_ACTION_CHANGE, &control);\r
+ return NO_ERROR;\r
+ }\r
+ log_service_control(service->name, control, false);\r