diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 17900cc5a62..4036f7df483 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -941,6 +941,9 @@ static BOOL service_accepts_control(const struct service_entry *service, DWORD d { DWORD a = service->status.dwControlsAccepted; + if (dwControl >= 128 && dwControl <= 255) + return TRUE; + switch (dwControl) { case SERVICE_CONTROL_INTERROGATE: diff --git a/programs/services/tests/service.c b/programs/services/tests/service.c index 85b8e861ca5..fea6363f770 100644 --- a/programs/services/tests/service.c +++ b/programs/services/tests/service.c @@ -83,6 +83,9 @@ static DWORD WINAPI service_handler(DWORD ctrl, DWORD event_type, void *event_da SetServiceStatus(service_handle, &status); SetEvent(service_stop_event); return NO_ERROR; + case 128: + service_event("CUSTOM"); + return 0xdeadbeef; default: status.dwCurrentState = SERVICE_RUNNING; SetServiceStatus( service_handle, &status ); @@ -346,6 +349,10 @@ static void test_service(void) ok(status.dwCheckPoint == 0, "status.dwCheckPoint = %d\n", status.dwCheckPoint); todo_wine ok(status.dwWaitHint == 0, "status.dwWaitHint = %d\n", status.dwWaitHint); + res = ControlService(service_handle, 128, &status); + ok(res, "ControlService failed: %u\n", GetLastError()); + expect_event("CUSTOM"); + res = ControlService(service_handle, SERVICE_CONTROL_STOP, &status); ok(res, "ControlService failed: %u\n", GetLastError()); expect_event("STOP");