| Previous | Next |
| D2DERR_UNSUPPORTED_OPERATION | D2DERR_SCREEN_ACCESS_DENIED |
D2DERR_SCANNER_FAILED
The scope of D2DERR_SCANNER_FAILED is Direct2D geometry and numeric validation. The geometry scanner could not process the supplied geometry data. Keep 0x88990004 beside the returning method because a wrapper can replace this distinction with a generic subsystem message.
Keep neighboring failures separate
D2DERR_BAD_NUMBER identifies invalid numeric input broadly; SCANNER_FAILED is tied to geometry processing. Do not respond with a universal render-target recreation loop unless the returned status specifically documents device-loss recovery; graph, property, numeric, lifetime, and print-state errors require correcting their contract.
What the status establishes
When it is returned, Direct2D geometry processing depends on finite coordinates, valid matrices, closed geometry sinks, fill rules, and tolerances. A scanner failure identifies geometry processing, while a bad-number result can be raised by many APIs before rasterization. Preserve the path segments and numeric inputs at the first method that rejects them.
Inspect the following boundary: path geometry, tessellation, winding, numeric range, or sink construction before rasterization.
Build a useful incident record
| Record | Why it matters here |
|---|---|
| Geometry type and serialized segments | Recording geometry type and serialized segments separates the Direct2D geometry and numeric validation boundary from a later wrapper symptom. |
| Fill mode, transforms, tolerance, and bounds | In this result diagnostics, recording fill mode, transforms, tolerance, and bounds ties the HRESULT to the Direct2D geometry and numeric validation boundary rather than to the final visible failure. |
| NaN, infinity, extreme coordinates, or degenerate segments | Comparing NaN, infinity, extreme coordinates, or degenerate segments shows whether this result follows input, object state, or environment. |
| The scanner-consuming API and deferred error point | Preserving the scanner-consuming API and deferred error point provides the evidence needed to test this distinction: d2DERR_BAD_NUMBER identifies invalid numeric input broadly; SCANNER_FAILED is tied to geometry processing. |
Interpret the controls
| Test | Interpretation | Hold constant |
|---|---|---|
| Same environment, reduced input | If this result disappears with a smaller faithful case, complexity within Direct2D geometry and numeric validation is implicated. | Keep geometry type and serialized segments fixed while simplifying NaN, infinity, extreme coordinates, or degenerate segments. |
| Same input, fresh object generation | If this result changes after rebuilding state, examine ownership across the caller’s object graph, custom effect or renderer, Direct2D validation layer, backing device, and deferred draw boundary. | Place fill mode, transforms, tolerance, and bounds on the timeline of the last successful transition. |
| Same operation on a controlled second path | If this result follows one environment, the failure is not explained by source data alone. | Compare adapter and feature level, factory and device generations, target identity, debug-layer output, and thread ownership while preserving the scanner-consuming API and deferred error point. |
Reduce the scenario safely
Build the geometry segment by segment with identity transform and moderate coordinates., check every sink close result, then add the original transform, tolerance, and extreme values independently.
- When it is returned, rebuild the path segment by segment.
- Test without transforms and with moderate coordinates.
- close every geometry sink successfully.
- When it is returned, compare fill and stroke operations.
Prove the correction
A correction for it should let the operation at the Direct2D geometry and numeric validation boundary complete repeatedly under the original supported conditions. Repeat the control that begins with “Rebuild the path segment by segment” and confirm that the following lifecycle step also succeeds. Keep the original failing sample and one deliberate negative case so fallback cannot be mistaken for repair.
Technical references
When it is returned, these references define the public API family, object model, or error list used to interpret this status.
- Microsoft: Direct2D error codes.
- Microsoft: Direct2D API overview.
- Microsoft: Direct2D geometries overview.
- Microsoft: Direct2D devices and device contexts.
Looking for a different code? Search another status or error code.