msi: Pass string length to msi_set_property in ACTION_CustomAction.

This commit is contained in:
Hans Leidekker 2012-10-29 12:18:50 +01:00 committed by Alexandre Julliard
parent 52a87c9054
commit af08a2f6ba
3 changed files with 8 additions and 7 deletions

View File

@ -1227,6 +1227,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
UINT type;
const WCHAR *source, *target, *ptr, *deferred_data = NULL;
WCHAR *deformated = NULL;
int len;
/* deferred action: [properties]Action */
if ((ptr = strrchrW(action, ']')))
@ -1326,8 +1327,8 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
if (!source)
break;
deformat_string(package,target,&deformated);
rc = msi_set_property( package->db, source, deformated, -1 );
len = deformat_string( package, target, &deformated );
rc = msi_set_property( package->db, source, deformated, len );
if (rc == ERROR_SUCCESS && !strcmpW( source, szSourceDir ))
msi_reset_folders( package, TRUE );
msi_free(deformated);

View File

@ -2697,8 +2697,8 @@ static void test_formatrecord_tables(void)
memset( buf, 'a', sizeof(buf) );
r = MsiGetProperty( hpkg, "prop", buf, &size );
ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
todo_wine ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong value\n");
todo_wine ok( size == sizeof("\0np") - 1, "got %u\n", size );
ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong value\n");
ok( size == sizeof("\0np") - 1, "got %u\n", size );
r = MsiSetProperty( hpkg, "prop", "[~]np" );
ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);

View File

@ -2316,11 +2316,11 @@ static void test_property_table(void)
memset( buffer, 'a', sizeof(buffer) );
r = MsiGetProperty( hpkg, "prop2", buffer, &sz );
ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
todo_wine ok( !memcmp( buffer, "\0np", sizeof("\0np") ), "wrong value\n");
todo_wine ok( sz == sizeof("\0np") - 1, "got %u\n", sz );
ok( !memcmp( buffer, "\0np", sizeof("\0np") ), "wrong value\n");
ok( sz == sizeof("\0np") - 1, "got %u\n", sz );
found = find_prop_in_property(hdb, "prop2", "\0np", 3);
todo_wine ok(found == TRUE, "prop2 should be in the _Property table\n");
ok(found == TRUE, "prop2 should be in the _Property table\n");
MsiCloseHandle(hdb);
MsiCloseHandle(hpkg);