Structured Storage

Structured storage is a file system within a file. COM uses it to efficiently store multiple types of objects in one document. COM defines structured storage as a collection of two types of COM objects, storage and stream. The former behaves as a directory and the latter as a file. A storage object must implement the IStorage interface and a stream object must implement the IStream interface. Just as a directory in a file system can contain subdirectories and files, a storage object can contain other storage objects and stream objects. A storage object keeps track of the locations and sizes of the contained storage and stream objects. A stream object stores data as a consecutive sequence of bytes.

Structured storage helps to reduce the performance penalties and overhead for storing separate objects in a flat file. Other benefits include incremental access and multiple uses of data in a transacted process, as well as providing facilities for saving files in low-memory situations. Windows CE provides a default implementation, currently for the H/PC platform, of the interfaces, functions, and enumeration required for structured storage services. This default implementation includes the following: