| 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
| Evidence | Question |
|---|---|
| Interface method | Record GetSizeMax or the framework-specific sizing call. |
| Object state | Variable strings, child objects, and pending external data can change the estimate. |
| Destination | Determine 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
- Save into a growable stream and measure the actual result
- Exercise maximum supported member lengths
- 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
| Record | Purpose |
|---|---|
| First failing operation | API name, object state, and exact return point |
| Original representation | Unmodified bytes or a stable hash captured before repair or normalization |
| Contract identity | Schema, protocol, database, or persistence version with feature flags |
| Negative control | One 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 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 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 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 for PERSIST_E_SIZEDEFINITE
- Microsoft Open Specifications: HRESULT values
- COM persistence interfaces
- IPersistStream::GetSizeMax
- IStream interface
Looking for a different code? Search another status or error code.