msi: Close the original record before copying new data into it.

This commit is contained in:
James Hawkins 2009-12-10 17:01:12 -08:00 committed by Alexandre Julliard
parent a44b653d53
commit 9ab7d9e21a
3 changed files with 5 additions and 1 deletions

View File

@ -698,6 +698,7 @@ extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
BOOL preserve_case );
/* record internals */
extern void MSI_CloseRecord( MSIOBJECTHDR * );
extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *);
extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **);
extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT );

View File

@ -64,7 +64,7 @@ static void MSI_FreeField( MSIFIELD *field )
}
}
static void MSI_CloseRecord( MSIOBJECTHDR *arg )
void MSI_CloseRecord( MSIOBJECTHDR *arg )
{
MSIRECORD *rec = (MSIRECORD *) arg;
UINT i;

View File

@ -1835,6 +1835,9 @@ static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT ro
if (r != ERROR_SUCCESS)
return r;
/* Close the original record */
MSI_CloseRecord(&rec->hdr);
count = MSI_RecordGetFieldCount(rec);
for (i = 0; i < count; i++)
MSI_RecordCopyField(curr, i + 1, rec, i + 1);