| Previous | Next |
| ERROR_INVALID_FUNCTION |
ERROR_SUCCESS
The operation completed successfully.
ERROR_SUCCESS is Windows system result 0 (0x00000000). Microsoft defines it as “The operation completed successfully.” The value should be captured immediately at the producing boundary because later diagnostics, cleanup, or retry code can overwrite a thread-local last-error value or collapse a richer native status.
How to classify this result
ERROR_SUCCESS represents successful completion, not an error. The correct interpretation depends on the exact API contract that returned zero and whether the API reports status directly, through BOOL plus GetLastError, or through an output structure.
The most important boundary for ERROR_SUCCESS is whether the operation reached a documented final state.
Where it can appear
ERROR_SUCCESScan appear in a Win32 function that returns an explicit status code.ERROR_SUCCESScan appear in a service, installer, or management command that serializes Win32 results.ERROR_SUCCESScan appear in telemetry that records success and failure in one numeric field.
When ERROR_SUCCESS is found only in a log, preserve the logger, event provider, process, thread, and translation path.
Typical causes
- For
ERROR_SUCCESS, application code checks GetLastError after a successful call even though the function does not define that value on success. - For
ERROR_SUCCESS, a wrapper treats zero as an absent optional value and drops useful success telemetry. - For
ERROR_SUCCESS, an HRESULT or NTSTATUS conversion is applied to zero without recording the original result domain. - For
ERROR_SUCCESS, a multi-step operation reports overall success even though an earlier optional step produced a warning.
These causes are starting points for ERROR_SUCCESS, not substitutes for evidence.
Diagnostic sequence
- Read the documentation for the producing function before interpreting zero.
- Record the function return value separately from the thread last-error slot.
- Check required output parameters and postconditions instead of relying only on ERROR_SUCCESS.
- For a multi-stage workflow, confirm which stage emitted the value and whether partial work remains.
- When testing wrappers, include zero in serialization, database, JSON, and UI round trips.
After the first pass, reproduce ERROR_SUCCESS with the smallest input and only one intentional fault.
Evidence to preserve
- Record producing API name and return type for
ERROR_SUCCESS. - Record raw return value before conversion for
ERROR_SUCCESS. - Record postcondition or output value proving completion for
ERROR_SUCCESS. - Record correlation ID for the larger operation for
ERROR_SUCCESS. - Record whether GetLastError was consulted and at what instruction boundary for
ERROR_SUCCESS.
For ERROR_SUCCESS, also retain decimal 0, hexadecimal 0x00000000, UTC time, machine build, component version, and a correlation identifier.
Recovery and retry
The recovery objective for ERROR_SUCCESS is to No remediation is required for ERROR_SUCCESS itself; continue only when the documented postconditions are satisfied.
Retry is unnecessary merely because the numeric value is zero. Repeat only when the caller has independent evidence that the intended state was not reached.
Difference from related results
ERROR_SUCCESS differs from informational statuses such as ERROR_VALIDATE_CONTINUE: zero normally terminates the operation successfully, whereas a continuation value requests another phase.
Keep the original constant in telemetry rather than replacing ERROR_SUCCESS with a nearby result that seems more familiar.
Practical validation scenario
A wrapper calls CreateDirectory, receives a nonzero BOOL, and then sees ERROR_SUCCESS in a stale or reset last-error slot. The correct test uses the BOOL result and verifies the directory, rather than treating the last-error value as the primary outcome.
A useful test report for ERROR_SUCCESS includes the failing call, exact input, state before the call, raw output, expected state, and observed state after recovery.
Telemetry and support fields
- Record
success_operationfor the producing API, callback, wait, driver, packaging phase, or service transition. - Record
success_targetfor the stable session, selector, device, pin, content, resource, service, or validation identity. - Record
success_state_beforeandsuccess_requested_stateusing explicit units and enum names. - Record
success_raw_status, the original result domain, and any later HRESULT or Win32 conversion. - Record
success_attempt, elapsed time, process and thread IDs, server or device instance, and correlation ID.
Alerting for ERROR_SUCCESS should reflect the classification above.
Developer and administrator guidance
Developers should keep success values in logs when they close an incident timeline, but should not generate alerts for ERROR_SUCCESS. Administrators should verify the requested state instead of trying to “fix” code zero.
Developers should preserve ERROR_SUCCESS at module boundaries and document whether ownership of buffers, handles, mutexes, callbacks, or transition contexts changes on return.
References
- Microsoft: System Error Codes 0–499 — official documentation relevant to
ERROR_SUCCESS. - Microsoft: GetLastError — official documentation relevant to
ERROR_SUCCESS. - Microsoft: FormatMessage — official documentation relevant to
ERROR_SUCCESS.
Looking for a different code? Search another status or error code.
