Opens an existing storage object that does not reside in a disk file, but instead has an underlying byte array provided by the caller.
WINOLEAPI StgOpenStorageOnILockBytes(
ILockBytes * plkbyt, //Points to the ILockBytes interface on the
// underlying byte array
IStorage * pStgPriority, //Points to a previous opening of a
// root storage object
DWORD grfMode, //Specifies the access mode for the object
SNB snbExclude, //Points to an SNB structure specifying
// elements to be excluded
DWORD reserved, //Reserved, must be zero
IStorage ** ppstgOpen //Points to location for returning the
// storage object
);
After the StgOpenStorageOnILockBytes function returns, the storage object specified in the pStgPriority parameter on function entry is invalid, and can no longer be used; use the one specified in the ppStgOpen parameter instead.
This function can also return any file system errors, or Win32 errors wrapped in an HRESULT, or ILockBytes interface error return values.
StgOpenStorageOnILockBytes opens the specified root storage object. The storage object is opened according to the access mode in the grfMode parameter; a pointer to the IStorage interface on the opened storage object is supplied through the ppstgOpen parameter.
The storage object must have been previously created by the StgCreateDocfileOnILockBytes function.
Except for specifying a programmer-provided byte-array object, StgOpenStorageOnILockBytes is similar to the StgOpenStorage function. For more information, refer to StgOpenStorage.
Windows CE: The StgCreateDocfileOnILockBytes and StgOpenStorageOnILockBytes functions are not available for the non-desktop compatible implementation via CESYSGEN.
Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application. For more information about handling exceptions, see Programming Considerations.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Use version 2.0 or later.
Header: Declared in objbase.h.
Import Library: Use ole32.lib.
StgOpenStorage, StgCreateDocfileOnILockBytes