| Previous | Next |
| ERROR_GRAPHICS_INVALID_VISIBLEREGION_SIZE | ERROR_GRAPHICS_INVALID_PIXELFORMAT |
ERROR_GRAPHICS_INVALID_STRIDE
Interpret the result in its owning layer: graphics invalid stride
ERROR_GRAPHICS_INVALID_STRIDE (0xC026233C) belongs to the vidpn layer. It marks the primary surface stride violates format, width, alignment or driver constraints, rather than a generic rendering failure. The object that owns the decision is source-mode scanline pitch.
Recalculate pitch from format and alignment
Stride is measured in bytes between adjacent scanlines and may exceed width multiplied by bytes per pixel because the driver requires alignment. Capture width, format, bits per pixel, allocation pitch and any private-format metadata from the same device. Build the control surface through the runtime so its pitch is authoritative. Never copy a pitch from another adapter, resource generation or rotated layout into the candidate source mode.
This result: VidPN handles and subobjects are generation-bound. A monitor hot-plug, docking action, session switch or mode commit can invalidate an otherwise well-formed cached object. The built-in one-line message identifies the immediate result; diagnosis also needs the producing API, object ownership and the display generation current at the time.
Capture before recreating objects
| Capture item | Why it matters for it |
|---|---|
| Current graph state | VidPN, topology, source and target mode sets, and the present path connecting them |
| Supporting trace | source and target IDs, topology generation, path descriptors, pinned modes, mode-set handles and monitor timing data |
| Object identity | source-mode scanline pitch |
| Rejected boundary | the primary surface stride violates format, width, alignment or driver constraints |
| Decisive capture | stride in bytes, width, pixel format, bits per pixel, alignment and private-format metadata |
Preserve the unsigned HRESULT, symbolic name, first failing API and timestamp in one record. If cleanup later fails too, keep that secondary result separately from this result.
Reproduce one variable at a time
- Freeze the result generation. Record stride in bytes, width, pixel format, bits per pixel, alignment and private-format metadata. Before diagnosing this result, do not resize, hot-plug, recreate or release the object under examination.
- Run the narrow this result comparison. derive the minimum aligned pitch for the same width and format and retry. During the result comparison, keep every driver, monitor, resource format and unrelated policy unchanged.
- Observe the layer after it. for it, if the exact check passes, record the next HRESULT or visible outcome. A different downstream result shows that the boundary was crossed.
- Repeat it through a lifecycle transition. for it, exercise one relevant resize, mode switch, device recreation, hot-plug or session change and confirm that it does not reuse stale handles.
The comparison with ERROR_GRAPHICS_INVALID_PIXELFORMAT is especially useful: ERROR_GRAPHICS_INVALID_PIXELFORMAT rejects the format itself rather than its memory pitch. Recording both names prevents a broad “graphics error” label from merging distinct ownership, capability and lifetime problems.
Recovery contract
Use the runtime or driver-required pitch calculation instead of assuming width times bytes per pixel. Repair of it is complete only when the original call succeeds or returns its documented nonfatal status and the same lifetime test remains correct after a second display transition.
- The result trace identifies one producing API and one current graphics object, rather than only the final UI symptom.
- The passing run changes exactly the condition described for it; unrelated adapter, monitor and application state remains unchanged.
- debug-layer, ETW or driver diagnostics no longer report the rejected source-mode scanline pitch contract during the same scenario.
- The application handles recurrence of it without an unbounded retry loop, leaked resource, duplicate composition target or stale topology handle.
Implementation notes
Log source and target IDs, topology generation, path descriptors, pinned modes, mode-set handles and monitor timing data. When the path returns a count, size, status flag or replacement object, retain it even on a nonfatal result because it can direct the next call.
A production fallback for it should be explicit: pause rendering, re-enumerate, rebuild one cache entry, recreate a device, or decline a protected path only when this layer calls for that action. Reinstalling every display component, deleting all caches or forcing a resolution change is not an evidence-based fix for it.
Technical references
- Microsoft: Introduction to Video Present Networks — background for the source-mode scanline pitch boundary involved in it.
- Microsoft: VidPN objects and interfaces
- Microsoft: Enumerating cofunctional VidPN modes
- Microsoft: Determining VidPN support
Looking for a different code? Search another status or error code.