| Previous | Next |
| STATUS_DEVICE_POWER_CYCLE_REQUIRED | STATUS_DEVICE_REQUIRES_CLEANING |
STATUS_NO_WORK_DONE
A sequence-number optimization can make “no work” the expected result
STATUS_NO_WORK_DONE should not be interpreted as a generic failed operation. Microsoft documents a direct use in PsQuerySystemAvailableCpus and PsQueryProcessAvailableCpus. The caller may supply the most recent sequence number it observed. If that sequence still matches the current CPU-availability sequence, the routine returns this status and does not write to the affinity buffer.
This is a cache/change-detection contract. The sequence number lets a caller avoid repeatedly rebuilding or copying the same processor-affinity information. The crucial detail is that the output buffer is not refreshed on this return path. Code that clears the buffer before every call and then treats STATUS_NO_WORK_DONE as “use the output” can accidentally replace valid cached affinity with an empty value.
Log the observed sequence number, returned/current sequence number, API used, and whether the caller retained the last successful affinity result. On this documented path, reuse the previously obtained data according to the API contract instead of retrying in a tight loop. If the status appears from another component, return to that component’s contract: the NTSTATUS is generic enough to be reused, and the PsQuery APIs are a concrete example rather than proof that every occurrence concerns CPU affinity.
What to inspect
- For the PsQuery APIs, preserve the last successful affinity data until a changed sequence causes a new query result.
- Do not assume output buffers were written when the routine documents a no-work fast path.
- Outside these APIs, identify the exact producer of the status before applying sequence-number semantics.
References
- Microsoft: PsQuerySystemAvailableCpus
- Microsoft: PsQueryProcessAvailableCpus
- Microsoft: Processor groups
- Microsoft: Using NTSTATUS values
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.
