if (dataObj.GetData(Format, Medium) = S_OK) then
begin
pfgd := PFileGroupDescriptor(GlobalLock(Medium.hGlobal));
for dwCount := 0 to pfgd.cItems — 1 do
begin
Format.cfFormat := CF_FILECONTENTS;
Format.ptd := nil;
Format.dwAspect := 1;
Format.lindex := dwCount;
Format.tymed := TYMED_ISTORAGE or TYMED_ISTREAM;
if (dataObj.GetData(Format, stgmitem) = S_OK) then
begin
pstg := IStorage(stgmitem.stg);
if pstg.OpenStream('__substg1.0_10090102', nil, STGM_READ or STGM_SHARE_EXCLUSIVE, 0, pstm) = S_OK then
...