OLE's Implementation: Compound Files

What we've seen to this point, with the exception of custom marshaling for storage and stream objects, is the specification for Structured Storage. In other words, we've seen the architectural model of storage and stream objects, their interfaces, and how transactioning works. But a model is of little more than academic interest until it's actually implemented as something usable. The implementation of storage and stream objects is what OLE calls Compound Files, which involves a few additions to the architecture as well as a few features, such as transactioned streams and region locking, that are left unsupported.

The sections that follow describe the additions, mainly a LockBytes object that implements an interface named (what else) ILockBytes, the API functions through which a client creates a compound file and obtains the IStorage pointer to the root object within that file, and an interface named IRootStorage. Following discussion of the additions is a hit list of differences between the model and the implementation of Compound Files, and a few other notes of interest about this OLE-provided service.