From 9ab7d9e21a0e6af8159902835f17b2d82a9d0380 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 10 Dec 2009 17:01:12 -0800 Subject: [PATCH] msi: Close the original record before copying new data into it. --- dlls/msi/msipriv.h | 1 + dlls/msi/record.c | 2 +- dlls/msi/table.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 5b23f55b189..0e1a23bfaea 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -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 ); diff --git a/dlls/msi/record.c b/dlls/msi/record.c index 68eab694370..45adbac8471 100644 --- a/dlls/msi/record.c +++ b/dlls/msi/record.c @@ -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; diff --git a/dlls/msi/table.c b/dlls/msi/table.c index d2b9a004d43..7c341a7cdf3 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -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);