| Previous | Next |
| STG_E_EXTANTMARSHALLINGS | STG_E_BADBASEADDRESS |
STG_E_DOCFILECORRUPT
What “document file corrupt” means here
STG_E_DOCFILECORRUPT refers to corruption detected in a Structured Storage compound file. A compound file is not a flat document: it contains a directory of storages and streams plus allocation structures that link sectors together. A file can have a recognizable signature and still be unusable when those internal structures disagree, point outside the file, contain impossible chains, or have been truncated during a copy or write.
This HRESULT should be differentiated from STG_E_INVALIDHEADER. An invalid header is often detected immediately because the file does not look like a valid CFB container. STG_E_DOCFILECORRUPT generally means the reader progressed far enough to discover a deeper structural inconsistency.
Preserve first, then inspect
- Make a byte-for-byte copy and work on the copy; do not open-and-save the only original.
- Compare size and hash with a known-good source or archive, especially after network transfer or recovery from removable media.
- Inspect read-only with a second implementation such as Apache POI or libolecf; agreement between independent readers strengthens the corruption diagnosis.
- Recover individual streams only when their provenance and integrity can be verified; a successful extraction does not necessarily make the container safe to reuse.
References
Looking for a different code? Search another status or error code.