Relative Content

Tag Archive for c++windowsservicetriggers

Сan’t change a service startup type after adding triggers

After I add SERVICE_TRIGGER with type SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL to start a service using WinAPI, I can’t change the service startup type by ChangeServiceConfig(A/W). Without changing the trigger type to SERVICE_DISABLE before adding trigger, trying to add a trigger always fails with an error ERROR_INVALID_PARAMETER.