| Previous | Next |
| ERROR_WAS_UNLOCKED | ERROR_WAS_LOCKED |
ERROR_SERVICE_NOTIFICATION
A service-related notification carries formatted status text
ERROR_SERVICE_NOTIFICATION corresponds to Win32 error value documented as: %hs This value is used with service notification paths where the message body supplies the meaningful detail. It should be interpreted together with the substituted service name, operation, and notification text rather than in isolation.
Where the result appears in real systems
- Service Control Manager notifications.
- Installers waiting for a service state change.
- Management agents forwarding service events to another process.
Evidence to collect before changing the system
preserve every insertion string from the formatted message; record service name, PID, current state, accepted controls, and the API that delivered the notification; correlate the timestamp with System log events from Service Control Manager
Keep the original numeric value, symbolic name, API return path, thread and process identity, and the exact timestamp in one diagnostic record. Those fields prevent later layers from replacing this specific result with a generic failure and make correlation with ETW or Event Viewer practical.
Handling and recovery
Handle the notification according to its embedded state and reason. Monitoring software should not label every occurrence as a service crash, because the message may describe a transition or informational condition.
Code that receives this result should classify it according to the operation that produced it: completion information, a recoverable environmental condition, or a programming defect. The result classification should be made at the API boundary where the caller still knows the handle, object, flags, and expected state.
What not to infer from this code
This result is a message container, not a universal diagnosis. The inserted text is essential and must not be discarded by logging code.
Implementation guidance
Preserve this result through logging and telemetry instead of immediately converting it to free-form text. When it crosses an HRESULT boundary, record both the original Win32 value and the converted HRESULT; when it crosses RPC, JSON, or another protocol, include an explicit error-domain field so the receiver does not convert it twice.
A useful automated test for this Win32 error should reproduce the relevant state transition, assert the exact returned value, and verify cleanup after both the normal and exceptional path. The test for this Win32 error should also check that a retry is performed only when the underlying state can genuinely change, because unconditional retries often hide ownership, architecture, power, or resource-negotiation defects.
References
Looking for a different code? Search another status or error code.