msi: Fix the returned format of REG_BINARY data.
This commit is contained in:
parent
6d02194a46
commit
47ac325f82
|
@ -245,7 +245,9 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
|
||||||
LPWSTR *appValue)
|
LPWSTR *appValue)
|
||||||
{
|
{
|
||||||
static const WCHAR dwordFmt[] = { '#','%','d','\0' };
|
static const WCHAR dwordFmt[] = { '#','%','d','\0' };
|
||||||
static const WCHAR binFmt[] = { '#','x','%','x','\0' };
|
static const WCHAR binPre[] = { '#','x','\0' };
|
||||||
|
static const WCHAR binFmt[] = { '%','0','2','X','\0' };
|
||||||
|
LPWSTR ptr;
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
switch (regType)
|
switch (regType)
|
||||||
|
@ -277,10 +279,12 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
|
||||||
ExpandEnvironmentStringsW((LPCWSTR)value, *appValue, sz);
|
ExpandEnvironmentStringsW((LPCWSTR)value, *appValue, sz);
|
||||||
break;
|
break;
|
||||||
case REG_BINARY:
|
case REG_BINARY:
|
||||||
/* 3 == length of "#x<nibble>" */
|
/* #x<nibbles>\0 */
|
||||||
*appValue = msi_alloc((sz * 3 + 1) * sizeof(WCHAR));
|
*appValue = msi_alloc((sz * 2 + 3) * sizeof(WCHAR));
|
||||||
for (i = 0; i < sz; i++)
|
lstrcpyW(*appValue, binPre);
|
||||||
sprintfW(*appValue + i * 3, binFmt, value[i]);
|
ptr = *appValue + lstrlenW(binPre);
|
||||||
|
for (i = 0; i < sz; i++, ptr += 2)
|
||||||
|
sprintfW(ptr, binFmt, value[i]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WARN("unimplemented for values of type %d\n", regType);
|
WARN("unimplemented for values of type %d\n", regType);
|
||||||
|
|
|
@ -6339,10 +6339,7 @@ static void test_appsearch_reglocator(void)
|
||||||
lstrcpyA(path, "#xCDAB3412EF907856");
|
lstrcpyA(path, "#xCDAB3412EF907856");
|
||||||
r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
|
r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
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;
|
size = MAX_PATH;
|
||||||
r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
|
r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
|
||||||
|
|
Loading…
Reference in New Issue