msi: Check transforms have the correct storage guid.

This commit is contained in:
Mike McCormack 2006-10-11 16:27:15 +09:00 committed by Alexandre Julliard
parent ee55546d34
commit eb18bd9403
1 changed files with 20 additions and 8 deletions

View File

@ -37,6 +37,8 @@
#include "query.h"
#include "initguid.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi);
static void MSI_CloseView( MSIOBJECTHDR *arg )
@ -737,30 +739,40 @@ MSIHANDLE WINAPI MsiGetLastErrorRecord( void )
DEFINE_GUID( CLSID_MsiTransform, 0x000c1082, 0x0000, 0x0000, 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
LPCWSTR szTransformFile, int iErrorCond )
{
UINT r;
HRESULT r;
UINT ret = ERROR_FUNCTION_FAILED;
IStorage *stg = NULL;
STATSTG stat;
TRACE("%p %s %d\n", db, debugstr_w(szTransformFile), iErrorCond);
r = StgOpenStorage( szTransformFile, NULL,
STGM_DIRECT|STGM_READ|STGM_SHARE_DENY_WRITE, NULL, 0, &stg);
if( r )
return r;
if ( FAILED(r) )
return ret;
r = IStorage_Stat( stg, &stat, STATFLAG_NONAME );
if ( FAILED( r ) )
goto end;
if ( !IsEqualGUID( &stat.clsid, &CLSID_MsiTransform ) )
goto end;
if( TRACE_ON( msi ) )
enum_stream_names( stg );
r = msi_table_apply_transform( db, stg );
ret = msi_table_apply_transform( db, stg );
end:
IStorage_Release( stg );
return r;
return ret;
}
UINT WINAPI MsiDatabaseApplyTransformW( MSIHANDLE hdb,
UINT WINAPI MsiDatabaseApplyTransformW( MSIHANDLE hdb,
LPCWSTR szTransformFile, int iErrorCond)
{
MSIDATABASE *db;