http://bugs.winehq.org/show_bug.cgi?id=7949
------- Additional Comments From andrey.turkin@gmail.com 2007-25-04 06:57 ------- So, I will participate as describer then. First DWORD of stream is ATL version (0x800 or such). pMap array describe meaning of stream remainder. pMap element with NULL pclsidPropPage marks end of array; elements with NULL szDesc must be ignored. Rest elements are either: 1) raw data dwSizeData bytes must be read from stream to an object pointed by pThis at offset dwOffsetData. However, if this entry describe BSTR, when in the stream there are DWORD - string length in bytes, followed by string itself. In this case pointer to SysAllocString-allocated BSTR must be written to the object. 2) Property if dwSizeData is zero. In this case serialized VARIANT property is read from stream (CComVariant::ReadFromString way, Ill describe it later); variant type must be equal to pMaps vt, unless it is VT_EMPTY. piidDispatch is IID of interface (which must derive from IDispatch) to put property to, and dispid is obviously property id.
Implementation does not care for endianness.
VARIANT serialized as follows: 1) VARTYPE 2) Raw data for simple types (1, 2, 4 or 8 bytes); prepared for OleLoadFromStream data in case of VT_UNKNOWN or VT_DISPATCH; or BSTR serialized as described earlier.