Commit af08a2f6 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Pass string length to msi_set_property in ACTION_CustomAction.

parent 52a87c90
...@@ -1227,6 +1227,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL ...@@ -1227,6 +1227,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
UINT type; UINT type;
const WCHAR *source, *target, *ptr, *deferred_data = NULL; const WCHAR *source, *target, *ptr, *deferred_data = NULL;
WCHAR *deformated = NULL; WCHAR *deformated = NULL;
int len;
/* deferred action: [properties]Action */ /* deferred action: [properties]Action */
if ((ptr = strrchrW(action, ']'))) if ((ptr = strrchrW(action, ']')))
...@@ -1326,8 +1327,8 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL ...@@ -1326,8 +1327,8 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
if (!source) if (!source)
break; break;
deformat_string(package,target,&deformated); len = deformat_string( package, target, &deformated );
rc = msi_set_property( package->db, source, deformated, -1 ); rc = msi_set_property( package->db, source, deformated, len );
if (rc == ERROR_SUCCESS && !strcmpW( source, szSourceDir )) if (rc == ERROR_SUCCESS && !strcmpW( source, szSourceDir ))
msi_reset_folders( package, TRUE ); msi_reset_folders( package, TRUE );
msi_free(deformated); msi_free(deformated);
......
...@@ -2697,8 +2697,8 @@ static void test_formatrecord_tables(void) ...@@ -2697,8 +2697,8 @@ static void test_formatrecord_tables(void)
memset( buf, 'a', sizeof(buf) ); memset( buf, 'a', sizeof(buf) );
r = MsiGetProperty( hpkg, "prop", buf, &size ); r = MsiGetProperty( hpkg, "prop", buf, &size );
ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
todo_wine ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong value\n"); ok( !memcmp( buf, "\0np", sizeof("\0np") ), "wrong value\n");
todo_wine ok( size == sizeof("\0np") - 1, "got %u\n", size ); ok( size == sizeof("\0np") - 1, "got %u\n", size );
r = MsiSetProperty( hpkg, "prop", "[~]np" ); r = MsiSetProperty( hpkg, "prop", "[~]np" );
ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r); ok( r == ERROR_SUCCESS, "cannot set property: %d\n", r);
......
...@@ -2316,11 +2316,11 @@ static void test_property_table(void) ...@@ -2316,11 +2316,11 @@ static void test_property_table(void)
memset( buffer, 'a', sizeof(buffer) ); memset( buffer, 'a', sizeof(buffer) );
r = MsiGetProperty( hpkg, "prop2", buffer, &sz ); r = MsiGetProperty( hpkg, "prop2", buffer, &sz );
ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); ok( r == ERROR_SUCCESS, "get property failed: %d\n", r);
todo_wine ok( !memcmp( buffer, "\0np", sizeof("\0np") ), "wrong value\n"); ok( !memcmp( buffer, "\0np", sizeof("\0np") ), "wrong value\n");
todo_wine ok( sz == sizeof("\0np") - 1, "got %u\n", sz ); ok( sz == sizeof("\0np") - 1, "got %u\n", sz );
found = find_prop_in_property(hdb, "prop2", "\0np", 3); 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(hdb);
MsiCloseHandle(hpkg); MsiCloseHandle(hpkg);
......
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