msi: Update an existing record even if the low bit in the transform mask is set.
This commit is contained in:
parent
73774b3ef8
commit
6b1a1579f6
|
@ -2741,14 +2741,11 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
|
|||
|
||||
rec = msi_get_transform_record( tv, st, stg, &rawdata[n], bytes_per_strref );
|
||||
if (rec)
|
||||
{
|
||||
if ( mask & 1 )
|
||||
{
|
||||
WCHAR table[32];
|
||||
DWORD sz = 32;
|
||||
UINT number = MSI_NULL_INTEGER;
|
||||
|
||||
TRACE("inserting record\n");
|
||||
UINT row = 0;
|
||||
|
||||
if (!lstrcmpW( name, szColumns ))
|
||||
{
|
||||
|
@ -2773,32 +2770,44 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
|
|||
}
|
||||
}
|
||||
|
||||
if (TRACE_ON(msidb)) dump_record( rec );
|
||||
|
||||
r = msi_table_find_row( tv, rec, &row );
|
||||
if (r == ERROR_SUCCESS)
|
||||
{
|
||||
if (!mask)
|
||||
{
|
||||
TRACE("deleting row [%d]:\n", row);
|
||||
r = TABLE_delete_row( &tv->view, row );
|
||||
if (r != ERROR_SUCCESS)
|
||||
WARN("failed to delete row %u\n", r);
|
||||
}
|
||||
else if (mask & 1)
|
||||
{
|
||||
TRACE("modifying full row [%d]:\n", row);
|
||||
r = TABLE_set_row( &tv->view, row, rec, (1 << tv->num_cols) - 1 );
|
||||
if (r != ERROR_SUCCESS)
|
||||
WARN("failed to modify row %u\n", r);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("modifying masked row [%d]:\n", row);
|
||||
r = TABLE_set_row( &tv->view, row, rec, mask );
|
||||
if (r != ERROR_SUCCESS)
|
||||
WARN("failed to modify row %u\n", r);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("inserting row\n");
|
||||
r = TABLE_insert_row( &tv->view, rec, -1, FALSE );
|
||||
if (r != ERROR_SUCCESS)
|
||||
WARN("insert row failed\n");
|
||||
WARN("failed to insert row %u\n", r);
|
||||
}
|
||||
|
||||
if (number != MSI_NULL_INTEGER && !lstrcmpW( name, szColumns ))
|
||||
msi_update_table_columns( db, table );
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT row = 0;
|
||||
|
||||
r = msi_table_find_row( tv, rec, &row );
|
||||
if (r != ERROR_SUCCESS)
|
||||
WARN("no matching row to transform\n");
|
||||
else if ( mask )
|
||||
{
|
||||
TRACE("modifying row [%d]:\n", row);
|
||||
TABLE_set_row( &tv->view, row, rec, mask );
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("deleting row [%d]:\n", row);
|
||||
TABLE_delete_row( &tv->view, row );
|
||||
}
|
||||
}
|
||||
if( TRACE_ON(msidb) ) dump_record( rec );
|
||||
msiobj_release( &rec->hdr );
|
||||
}
|
||||
|
||||
|
|
|
@ -794,7 +794,7 @@ static void test_simple_patch( void )
|
|||
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
|
||||
|
||||
r = MsiViewFetch( hview, &hrec );
|
||||
todo_wine ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
|
||||
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
|
||||
|
||||
MsiCloseHandle( hrec );
|
||||
MsiViewClose( hview );
|
||||
|
|
Loading…
Reference in New Issue