| Previous | Next |
| PERSIST_E_SIZEDEFINITE | PERSIST_E_NOTSELFSIZING |
PERSIST_E_SIZEINDEFINITE
PERSIST_E_SIZEINDEFINITE (0x800B000A) describes an indefinite-sized persistence source cannot provide a usable total. The object or source is explicitly indefinite in size, yet the consuming path still requires a determinate amount before it can allocate, marshal, or complete persistence. Distinguish serialized bytes, the sizing interface, and the stream or container that owns framing.
Identify why size is indefinite
- Content may be generated lazily or read from an unbounded source.
- A child object may not implement a sizing contract.
- The format may rely on termination markers instead of a byte count.
Choose a compatible destination
| Approach | Constraint |
|---|---|
| Growable IStream | Can accept incremental writes when the format and caller permit it. |
| Fixed buffer | Requires a safe upper bound before Save begins. |
| Two-pass serialization | First counts bytes, second writes; valid only if object state remains stable. |
Race to avoid
If a two-pass method is used, mutation between the sizing and saving passes can invalidate the count. Freeze or snapshot the persisted state rather than assuming it remains unchanged.
Verification
The selected path supports indefinite production or converts it to a repeatable definite representation, with tests for empty, large, and changing sources.
Streaming capability must be explicit
A growable IStream can remove the need for one fixed allocation, but the surrounding container may still require a length before it writes its directory or header. Determine whether seeking back to patch a length is supported and what happens for a non-seekable stream.
Questions that narrow the result
| Question | Diagnostic direction |
|---|---|
| Same input rejected elsewhere | Agreement at the same offset supports a representation or contract cause |
| Known-good sample fails locally | Attention shifts to local libraries, state, packaging, or configuration |
| Clean process behaves differently | Look for mutation, leaked state, concurrency, or cached negotiation |
| Boundary control no longer fails | Validation may have been disabled rather than corrected |
Preserve causal order
Timestamp acquisition, parsing or preparation, the call returning this result, automatic retry, and cleanup so a later network, storage, or disposal result cannot replace the original cause.
Serialized envelope
| Format part | Question |
|---|---|
| Header and version | Object class and format revision |
| Length ownership | Object, container, or outer record supplying the boundary |
| Variable children | Strings, streams, embedded objects, and optional blocks |
| Integrity and termination | Checksums, counts, sentinels, or end-of-stream rules |
Round-trip states
Validate this result with minimum, typical, and maximum object states, include unknown optional fields for extensible formats, and require truncated or overlong data to fail without consuming the next object.
Responsibilities around the result
- The object documents the size behavior it actually supports
- The caller provides a growable stream, conservative buffer, or bounded substream
- Object state remains stable between related sizing and saving passes
- Version and framing changes are tested against older readers
Container compatibility
| Container property | Diagnostic consequence |
|---|---|
| Seekable stream | May permit length or directory fields to be patched after serialization |
| Non-seekable stream | Requires forward-only framing known before dependent records are emitted |
| Bounded substream | Prevents one malformed object from consuming bytes owned by the next record |
| Versioned container | Defines how older readers skip, reject, or preserve unknown persisted fields |
Technical references
- Microsoft Open Specifications: HRESULT values
- COM persistence interfaces
- IPersistStream::GetSizeMax
- IStream interface
Looking for a different code? Search another status or error code.
