Commit 6d02194a authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Expand REG_EXPAND_SZ registry values in the RegLocator table.

parent 65915af1
......@@ -245,7 +245,6 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
LPWSTR *appValue)
{
static const WCHAR dwordFmt[] = { '#','%','d','\0' };
static const WCHAR expandSzFmt[] = { '#','%','%','%','s','\0' };
static const WCHAR binFmt[] = { '#','x','%','x','\0' };
DWORD i;
......@@ -273,9 +272,9 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
sprintfW(*appValue, dwordFmt, *(const DWORD *)value);
break;
case REG_EXPAND_SZ:
/* space for extra #% characters in front */
*appValue = msi_alloc(sz + 2 * sizeof(WCHAR));
sprintfW(*appValue, expandSzFmt, (LPCWSTR)value);
sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0);
*appValue = msi_alloc(sz * sizeof(WCHAR));
ExpandEnvironmentStringsW((LPCWSTR)value, *appValue, sz);
break;
case REG_BINARY:
/* 3 == length of "#x<nibble>" */
......
......@@ -6318,19 +6318,13 @@ static void test_appsearch_reglocator(void)
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop,
"my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
}
ok(!lstrcmpA(prop,
"my%NOVAR%"), "Expected \"my%%NOVAR%%\", got \"%s\"\n", prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
......
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