Create a stub function to apply a single table transform and call it

where we need to apply transforms.
This commit is contained in:
Mike McCormack 2005-10-26 13:56:33 +00:00 committed by Alexandre Julliard
parent c4e8f06375
commit f8fef6ea94
4 changed files with 61 additions and 4 deletions

View File

@ -460,8 +460,7 @@ static UINT msi_apply_substorage_transform( MSIPACKAGE *package,
r = IStorage_OpenStorage( patch_db->storage, name, NULL, STGM_SHARE_EXCLUSIVE, NULL, 0, &stg ); r = IStorage_OpenStorage( patch_db->storage, name, NULL, STGM_SHARE_EXCLUSIVE, NULL, 0, &stg );
if (SUCCEEDED(r)) if (SUCCEEDED(r))
{ {
FIXME("apply substorage transform %s\n", debugstr_w(name)); ret = msi_table_apply_transform( package->db, stg );
/* ret = table_apply_transform( package->db, stg ); */
IStorage_Release( stg ); IStorage_Release( stg );
ret = ERROR_SUCCESS; ret = ERROR_SUCCESS;
} }

View File

@ -310,6 +310,9 @@ extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname, extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
USHORT **pdata, UINT *psz ); USHORT **pdata, UINT *psz );
/* transform functions */
extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg );
/* action internals */ /* action internals */
extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR ); extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
extern void ACTION_free_package_structures( MSIPACKAGE* ); extern void ACTION_free_package_structures( MSIPACKAGE* );

View File

@ -657,8 +657,7 @@ static UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
if( TRACE_ON( msi ) ) if( TRACE_ON( msi ) )
enum_stream_names( stg ); enum_stream_names( stg );
/* r = table_apply_transform( db, stg ); */ r = msi_table_apply_transform( db, stg );
FIXME("should apply transform %s\n", debugstr_w(szTransformFile) );
IStorage_Release( stg ); IStorage_Release( stg );

View File

@ -1532,3 +1532,59 @@ UINT MSI_CommitTables( MSIDATABASE *db )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
string_table *st, LPCWSTR name )
{
FIXME("%p %p %p %s\n", db, stg, st, debugstr_w(name) );
return ERROR_SUCCESS;
}
/*
* msi_table_apply_transform
*
* Enumerate the table transforms in a transform storage and apply each one.
*/
UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg )
{
IEnumSTATSTG *stgenum = NULL;
HRESULT r;
STATSTG stat;
ULONG n, count;
WCHAR name[0x40];
string_table *strings;
UINT ret = ERROR_FUNCTION_FAILED;
strings = load_string_table( stg );
if( !strings )
goto end;
r = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
if( FAILED( r ) )
goto end;
n = 0;
ret = ERROR_SUCCESS;
while( r == ERROR_SUCCESS )
{
count = 0;
r = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
if( FAILED( r ) || !count )
break;
decode_streamname( stat.pwcsName, name );
if( ( name[0] == 0x4840 ) && ( name[1] != '_' ) )
r = msi_table_load_transform( db, stg, strings, name+1 );
else
TRACE("non-table stream %s\n", debugstr_w(name) );
n++;
}
end:
if ( stgenum )
IEnumSTATSTG_Release( stgenum );
if ( strings )
msi_destroy_stringtable( strings );
return ret;
}