msi: Clone an open stream if possible in cabinet_open_stream.

This commit is contained in:
Hans Leidekker 2011-05-06 14:41:14 +02:00 committed by Alexandre Julliard
parent 4f9971f5f8
commit 3f7312fdc1
1 changed files with 9 additions and 5 deletions

View File

@ -235,13 +235,17 @@ static INT_PTR CDECL cabinet_open_stream( char *pszFile, int oflag, int pmode )
WARN("failed to encode stream name\n");
return 0;
}
hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream );
msi_free( encoded );
if (FAILED(hr))
if (msi_clone_open_stream( package_disk.package->db, cab->storage, encoded, &stream ) != ERROR_SUCCESS)
{
WARN("failed to open stream 0x%08x\n", hr);
return 0;
hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream );
msi_free( encoded );
if (FAILED(hr))
{
WARN("failed to open stream 0x%08x\n", hr);
return 0;
}
}
msi_free( encoded );
return (INT_PTR)stream;
}