msi: Preserve strings with embedded nulls when copying from the string table to a record.
This commit is contained in:
parent
32aed60786
commit
9588deb54c
|
@ -345,10 +345,9 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
|
||||||
|
|
||||||
if (type & MSITYPE_STRING)
|
if (type & MSITYPE_STRING)
|
||||||
{
|
{
|
||||||
LPCWSTR sval;
|
int len;
|
||||||
|
const WCHAR *sval = msi_string_lookup( db->strings, ival, &len );
|
||||||
sval = msi_string_lookup(db->strings, ival, NULL);
|
msi_record_set_string( *rec, i, sval, len );
|
||||||
MSI_RecordSetStringW(*rec, i, sval);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2181,7 +2181,7 @@ UINT msi_get_property( MSIDATABASE *db, LPCWSTR szName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc == ERROR_SUCCESS)
|
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));
|
debugstr_w(szName));
|
||||||
else if (rc == ERROR_MORE_DATA)
|
else if (rc == ERROR_MORE_DATA)
|
||||||
TRACE("need %d sized buffer for %s\n", *pchValueBuf,
|
TRACE("need %d sized buffer for %s\n", *pchValueBuf,
|
||||||
|
|
|
@ -276,8 +276,9 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
|
||||||
}
|
}
|
||||||
else if (type & MSITYPE_STRING)
|
else if (type & MSITYPE_STRING)
|
||||||
{
|
{
|
||||||
str = MSI_RecordGetString(rec, i + 1);
|
int len;
|
||||||
r = MSI_RecordSetStringW(mod, col, str);
|
str = msi_record_get_string( rec, i + 1, &len );
|
||||||
|
r = msi_record_set_string( mod, col, str, len );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2340,12 +2340,13 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
|
||||||
}
|
}
|
||||||
else if( columns[i].type & MSITYPE_STRING )
|
else if( columns[i].type & MSITYPE_STRING )
|
||||||
{
|
{
|
||||||
LPCWSTR sval;
|
int len;
|
||||||
|
const WCHAR *sval;
|
||||||
|
|
||||||
val = read_raw_int(rawdata, ofs, bytes_per_strref);
|
val = read_raw_int(rawdata, ofs, bytes_per_strref);
|
||||||
sval = msi_string_lookup( st, val, NULL );
|
sval = msi_string_lookup( st, val, &len );
|
||||||
MSI_RecordSetStringW( rec, i+1, sval );
|
msi_record_set_string( rec, i+1, sval, len );
|
||||||
TRACE(" field %d [%s]\n", i+1, debugstr_w(sval));
|
TRACE(" field %d [%s]\n", i+1, debugstr_wn(sval, len));
|
||||||
ofs += bytes_per_strref;
|
ofs += bytes_per_strref;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue