| Previous | Next |
| PERSIST_E_SIZEINDEFINITE | TRUST_E_NOSIGNATURE |
PERSIST_E_NOTSELFSIZING
PERSIST_E_NOTSELFSIZING (0x800B000B) describes object does not carry enough information to delimit its own persisted representation. The persistence format depends on an external length, container record, or caller-owned boundary. Reading the object from an arbitrary stream position cannot determine where that object ends by inspecting its bytes alone. For PERSIST_E_NOTSELFSIZING, distinguish serialized bytes, the sizing interface, and the stream or container that owns framing.
Map the framing owner
| Layer | Responsibility |
|---|---|
| Container | May store a length prefix or directory entry for the object. |
| Object | Writes fields but no complete self-delimiting envelope. |
| Caller | Must pass a bounded substream or exact byte count. |
Failure pattern
Concatenating several non-self-sizing objects into one stream without external lengths makes recovery ambiguous. Adding a magic value alone is not a robust length contract when the same bytes may occur in payload data.
Design tests
- Persist one object inside its documented container
- Attempt sequential reads with explicit bounded substreams
- Corrupt the external length and verify the reader fails without consuming the next record
Repair criterion
The container and object agree on framing, version, and byte count, and the reader never scans unbounded data to guess an object boundary.
Never recover a boundary by blind scanning
When the object is not self-sizing, its parent must provide a trusted length or bounded substream. Searching for the next magic value can misidentify payload bytes as framing and can turn one corrupt record into loss of synchronization for every following object.
Incident record for PERSIST_E_NOTSELFSIZING
| 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_NOTSELFSIZING
A retry that drops PERSIST_E_NOTSELFSIZING 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_NOTSELFSIZING
| 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_NOTSELFSIZING
Validate PERSIST_E_NOTSELFSIZING 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_NOTSELFSIZING
- 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_NOTSELFSIZING
| 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_NOTSELFSIZING
- Microsoft Open Specifications: HRESULT values
- COM persistence interfaces
- IPersistStream::GetSizeMax
- IStream interface
Looking for a different code? Search another status or error code.