What does HRESULT 0x800B000A (PERSIST_E_SIZEINDEFINITE) mean?

 
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

ApproachConstraint
Growable IStreamCan accept incremental writes when the format and caller permit it.
Fixed bufferRequires a safe upper bound before Save begins.
Two-pass serializationFirst 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

QuestionDiagnostic direction
Same input rejected elsewhereAgreement at the same offset supports a representation or contract cause
Known-good sample fails locallyAttention shifts to local libraries, state, packaging, or configuration
Clean process behaves differentlyLook for mutation, leaked state, concurrency, or cached negotiation
Boundary control no longer failsValidation 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 partQuestion
Header and versionObject class and format revision
Length ownershipObject, container, or outer record supplying the boundary
Variable childrenStrings, streams, embedded objects, and optional blocks
Integrity and terminationChecksums, 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 propertyDiagnostic consequence
Seekable streamMay permit length or directory fields to be patched after serialization
Non-seekable streamRequires forward-only framing known before dependent records are emitted
Bounded substreamPrevents one malformed object from consuming bytes owned by the next record
Versioned containerDefines how older readers skip, reject, or preserve unknown persisted fields

Technical references


Looking for a different code? Search another status or error code.