msi: Encode stream name in the callers of db_get_raw_stream.
This commit is contained in:
parent
d9e40b8219
commit
9f68142118
|
@ -125,20 +125,14 @@ static UINT clone_open_stream( MSIDATABASE *db, LPCWSTR name, IStream **stm )
|
|||
|
||||
UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm )
|
||||
{
|
||||
LPWSTR encname;
|
||||
HRESULT r;
|
||||
|
||||
encname = encode_streamname(FALSE, stname);
|
||||
TRACE("%s\n", debugstr_w(stname));
|
||||
|
||||
TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname));
|
||||
|
||||
if (clone_open_stream( db, encname, stm ) == ERROR_SUCCESS)
|
||||
{
|
||||
msi_free( encname );
|
||||
if (clone_open_stream( db, stname, stm ) == ERROR_SUCCESS)
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
r = IStorage_OpenStream( db->storage, encname, NULL,
|
||||
r = IStorage_OpenStream( db->storage, stname, NULL,
|
||||
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm );
|
||||
if( FAILED( r ) )
|
||||
{
|
||||
|
@ -147,15 +141,13 @@ UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm )
|
|||
LIST_FOR_EACH_ENTRY( transform, &db->transforms, MSITRANSFORM, entry )
|
||||
{
|
||||
TRACE("looking for %s in transform storage\n", debugstr_w(stname) );
|
||||
r = IStorage_OpenStream( transform->stg, encname, NULL,
|
||||
r = IStorage_OpenStream( transform->stg, stname, NULL,
|
||||
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm );
|
||||
if (SUCCEEDED(r))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
msi_free( encname );
|
||||
|
||||
if( SUCCEEDED(r) )
|
||||
{
|
||||
MSISTREAM *stream;
|
||||
|
@ -181,10 +173,15 @@ UINT read_raw_stream_data( MSIDATABASE *db, LPCWSTR stname,
|
|||
ULONG sz, count;
|
||||
IStream *stm = NULL;
|
||||
STATSTG stat;
|
||||
LPWSTR encname;
|
||||
|
||||
encname = encode_streamname( FALSE, stname );
|
||||
r = db_get_raw_stream( db, encname, &stm );
|
||||
msi_free( encname );
|
||||
|
||||
r = db_get_raw_stream( db, stname, &stm );
|
||||
if( r != ERROR_SUCCESS)
|
||||
return ret;
|
||||
|
||||
r = IStream_Stat(stm, &stat, STATFLAG_NONAME );
|
||||
if( FAILED( r ) )
|
||||
{
|
||||
|
|
|
@ -1168,7 +1168,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
|
|||
{
|
||||
MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
|
||||
UINT r;
|
||||
LPWSTR full_name = NULL;
|
||||
LPWSTR encname, full_name = NULL;
|
||||
|
||||
if( !view->ops->fetch_int )
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
@ -1180,11 +1180,13 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
|
|||
return r;
|
||||
}
|
||||
|
||||
r = db_get_raw_stream( tv->db, full_name, stm );
|
||||
encname = encode_streamname( FALSE, full_name );
|
||||
r = db_get_raw_stream( tv->db, encname, stm );
|
||||
if( r )
|
||||
ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r);
|
||||
msi_free( full_name );
|
||||
|
||||
msi_free( full_name );
|
||||
msi_free( encname );
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue