msi: Fix use of integer fields in MsiFormatRecord.
This commit is contained in:
parent
8f20756068
commit
5b8fdad920
|
@ -67,9 +67,32 @@ LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name )
|
|||
return FilePath;
|
||||
}
|
||||
|
||||
LPWSTR msi_dup_record_field( MSIRECORD *row, INT index )
|
||||
LPWSTR msi_dup_record_field( MSIRECORD *rec, INT field )
|
||||
{
|
||||
return strdupW( MSI_RecordGetString(row,index) );
|
||||
DWORD sz = 0;
|
||||
LPWSTR str;
|
||||
UINT r;
|
||||
|
||||
if (MSI_RecordIsNull( rec, field ))
|
||||
return NULL;
|
||||
|
||||
r = MSI_RecordGetStringW( rec, field, NULL, &sz );
|
||||
if (r != ERROR_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
sz ++;
|
||||
str = msi_alloc( sz * sizeof (WCHAR) );
|
||||
if (!str)
|
||||
return str;
|
||||
str[0] = 0;
|
||||
r = MSI_RecordGetStringW( rec, field, str, &sz );
|
||||
if (r != ERROR_SUCCESS)
|
||||
{
|
||||
ERR("failed to get string!\n");
|
||||
msi_free( str );
|
||||
return NULL;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component )
|
||||
|
|
|
@ -927,10 +927,8 @@ static void test_formatrecord(void)
|
|||
sz = sizeof buffer;
|
||||
r = MsiFormatRecord(0, hrec, buffer, &sz);
|
||||
ok( r == ERROR_SUCCESS, "format failed\n");
|
||||
todo_wine{
|
||||
ok( sz == 6, "size wrong\n");
|
||||
ok( 0 == strcmp(buffer,"123456"), "wrong output (%s)\n",buffer);
|
||||
}
|
||||
|
||||
r = MsiRecordSetString(hrec, 0, "[~]");
|
||||
sz = sizeof buffer;
|
||||
|
@ -1634,10 +1632,8 @@ static void test_formatrecord(void)
|
|||
MsiRecordSetString(hrec, 0, "[1] [2]");
|
||||
r = MsiFormatRecord(0, hrec, buffer, &sz);
|
||||
ok( r == ERROR_SUCCESS, "format failed\n");
|
||||
todo_wine {
|
||||
ok( sz == 8, "size wrong(%i)\n",sz);
|
||||
ok( 0 == strcmp(buffer,"100 -100"), "wrong output (%s)\n",buffer);
|
||||
}
|
||||
|
||||
MsiCloseHandle( hrec );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue