Hans Leidekker : msi: Preserve strings with embedded nulls when copying from the string table to a record .
Alexandre Julliard
julliard at winehq.org
Mon Oct 29 13:52:52 CDT 2012
Module: wine
Branch: master
Commit: 9588deb54c08ac1f9a858f700608476ab331afa9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9588deb54c08ac1f9a858f700608476ab331afa9
Author: Hans Leidekker <hans at codeweavers.com>
Date: Mon Oct 29 12:14:19 2012 +0100
msi: Preserve strings with embedded nulls when copying from the string table to a record.
---
dlls/msi/msiquery.c | 7 +++----
dlls/msi/package.c | 2 +-
dlls/msi/select.c | 5 +++--
dlls/msi/table.c | 9 +++++----
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index 4b826f8..451fddd 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -345,10 +345,9 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
if (type & MSITYPE_STRING)
{
- LPCWSTR sval;
-
- sval = msi_string_lookup(db->strings, ival, NULL);
- MSI_RecordSetStringW(*rec, i, sval);
+ int len;
+ const WCHAR *sval = msi_string_lookup( db->strings, ival, &len );
+ msi_record_set_string( *rec, i, sval, len );
}
else
{
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index a050b2e..6528b85 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -2181,7 +2181,7 @@ UINT msi_get_property( MSIDATABASE *db, LPCWSTR szName,
}
if (rc == ERROR_SUCCESS)
- TRACE("returning %s for property %s\n", debugstr_w(szValueBuf),
+ TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
debugstr_w(szName));
else if (rc == ERROR_MORE_DATA)
TRACE("need %d sized buffer for %s\n", *pchValueBuf,
diff --git a/dlls/msi/select.c b/dlls/msi/select.c
index 982cf6a..ada4eed 100644
--- a/dlls/msi/select.c
+++ b/dlls/msi/select.c
@@ -276,8 +276,9 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
}
else if (type & MSITYPE_STRING)
{
- str = MSI_RecordGetString(rec, i + 1);
- r = MSI_RecordSetStringW(mod, col, str);
+ int len;
+ str = msi_record_get_string( rec, i + 1, &len );
+ r = msi_record_set_string( mod, col, str, len );
}
else
{
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 3276259..78c00b1 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -2340,12 +2340,13 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
}
else if( columns[i].type & MSITYPE_STRING )
{
- LPCWSTR sval;
+ int len;
+ const WCHAR *sval;
val = read_raw_int(rawdata, ofs, bytes_per_strref);
- sval = msi_string_lookup( st, val, NULL );
- MSI_RecordSetStringW( rec, i+1, sval );
- TRACE(" field %d [%s]\n", i+1, debugstr_w(sval));
+ sval = msi_string_lookup( st, val, &len );
+ msi_record_set_string( rec, i+1, sval, len );
+ TRACE(" field %d [%s]\n", i+1, debugstr_wn(sval, len));
ofs += bytes_per_strref;
}
else
More information about the wine-cvs
mailing list