ILockBytes - File-Based Implementation
Implemented on a byte array object underlying a COM compound file storage object, and designed to read and write directly to a disk file.
Methods of ILockBytes are called from the compound file implementations of IStorage and IStream on the compound file storage object created through a call to StgCreateDocfile, so you do not need to call them directly.
The following are the methods of the ILockBytes File-Based Implementation.
Reads a block of bytes from a specified offset at the beginning of the byte-array.
Writes a block of bytes from a specified offset at the beginning of the byte array.
Ensures that any internal buffers maintained by the ILockBytes implementation are written out to the underlying physical storage.
Sets the size of the byte array.
The dwLockTypes parameter is set to LOCK_ONLYONCE or LOCK_EXCLUSIVE, which will allow or restrict access to locked regions.
This method unlocks the region locked by ILockBytes::LockRegion.
The COM-provided IStorage::Stat implementation calls the ILockBytes::Stat method to retrieve information about the byte array object. If there is no reasonable name for the byte array, the COM-provided ILockBytes::Stat method returns NULL in the pwcsName member of the STATSTG structure.