Commit 929d2340 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Return length instead of size from deformat_string.

parent 0f1d3474
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment