mirror of
https://github.com/reactos/wine.git
synced 2025-02-13 08:44:54 +00:00
msi: Return length instead of size from deformat_string.
This commit is contained in:
parent
0f1d3474a8
commit
929d234072
@ -2549,7 +2549,7 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, DWORD
|
||||
if (!strncmpW(value, szMulti, 3))
|
||||
ptr = value + 3;
|
||||
|
||||
*size = deformat_string(package, ptr,(LPWSTR*)&data);
|
||||
*size = deformat_string( package, ptr, (LPWSTR *)&data ) * sizeof(WCHAR);
|
||||
|
||||
/* add double NULL terminator */
|
||||
if (*type == REG_MULTI_SZ)
|
||||
@ -4943,7 +4943,7 @@ static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey)
|
||||
{
|
||||
msi_reg_set_val_dword( hkey, szSystemComponent, 1 );
|
||||
}
|
||||
size = deformat_string(package, modpath_fmt, &buffer);
|
||||
size = deformat_string(package, modpath_fmt, &buffer) * sizeof(WCHAR);
|
||||
RegSetValueExW(hkey, szModifyPath, 0, REG_EXPAND_SZ, (LPBYTE)buffer, size);
|
||||
RegSetValueExW(hkey, szUninstallString, 0, REG_EXPAND_SZ, (LPBYTE)buffer, size);
|
||||
msi_free(buffer);
|
||||
|
@ -1026,19 +1026,19 @@ DWORD deformat_string( MSIPACKAGE *package, const WCHAR *ptr, WCHAR **data )
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
DWORD size = 0;
|
||||
DWORD len = 0;
|
||||
MSIRECORD *rec = MSI_CreateRecord( 1 );
|
||||
|
||||
MSI_RecordSetStringW( rec, 0, ptr );
|
||||
MSI_FormatRecordW( package, rec, NULL, &size );
|
||||
MSI_FormatRecordW( package, rec, NULL, &len );
|
||||
|
||||
size++;
|
||||
*data = msi_alloc( size * sizeof(WCHAR) );
|
||||
if (size > 1) MSI_FormatRecordW( package, rec, *data, &size );
|
||||
len++;
|
||||
*data = msi_alloc( len * sizeof(WCHAR) );
|
||||
if (len > 1) MSI_FormatRecordW( package, rec, *data, &len );
|
||||
else *data[0] = 0;
|
||||
|
||||
msiobj_release( &rec->hdr );
|
||||
return size * sizeof(WCHAR);
|
||||
return len;
|
||||
}
|
||||
*data = NULL;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user