What does HRESULT 0x800B0009 (PERSIST_E_SIZEDEFINITE) mean?

 
Previous Next
DIGSIG_E_CRYPTO PERSIST_E_SIZEINDEFINITE

PERSIST_E_SIZEDEFINITE

PERSIST_E_SIZEDEFINITE (0x800B0009) describes a fixed-size persistence operation cannot determine the required size. A component expected to provide a definite byte count cannot calculate one for the object in its current state. This matters when the caller must allocate a non-growable buffer or stream before Save is invoked. For PERSIST_E_SIZEDEFINITE, distinguish serialized bytes, the sizing interface, and the stream or container that owns framing.

Locate the sizing contract

EvidenceQuestion
Interface methodRecord GetSizeMax or the framework-specific sizing call.
Object stateVariable strings, child objects, and pending external data can change the estimate.
DestinationDetermine whether the stream can grow or requires an exact bound.

Implementation guidance

IPersistStream::GetSizeMax should return a conservative maximum, not merely the size written by the last sample. The estimate must include framing, version fields, variable-length members, and persisted children.

Controlled checks

  1. Save into a growable stream and measure the actual result
  2. Exercise maximum supported member lengths
  3. Verify the estimate never falls below bytes written

Exit condition

The object reports a stable upper bound for every supported state, and Save succeeds into a stream sized to that bound without truncation.

A maximum need not be an exact prediction

GetSizeMax may return a conservative upper bound, but it must not understate the bytes that Save can write for the same stable object state. Check arithmetic in ULARGE_INTEGER, including overflow when child maxima, headers, padding, and alignment are accumulated.

Incident record for PERSIST_E_SIZEDEFINITE

RecordPurpose
First failing operationAPI name, object state, and exact return point
Original representationUnmodified bytes or a stable hash captured before repair or normalization
Contract identitySchema, protocol, database, or persistence version with feature flags
Negative controlOne intentionally invalid case that must remain rejected

Repeatability versus recovery for PERSIST_E_SIZEDEFINITE

A retry that drops PERSIST_E_SIZEDEFINITE may reflect changed process state, cache contents, timing, or input; repeat the same test in a fresh process and after the correction to distinguish repair from a transient path change.

Serialized envelope for PERSIST_E_SIZEDEFINITE

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 for PERSIST_E_SIZEDEFINITE

Validate PERSIST_E_SIZEDEFINITE 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 PERSIST_E_SIZEDEFINITE

  • 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 for PERSIST_E_SIZEDEFINITE

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 for PERSIST_E_SIZEDEFINITE


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