Commit 642cddf1 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Return the requested ini field.

parent f1e2041b
......@@ -405,6 +405,32 @@ end:
return ERROR_SUCCESS;
}
static LPWSTR get_ini_field(LPWSTR buf, int field)
{
LPWSTR beg, end;
int i = 1;
if (field == 0)
return strdupW(buf);
beg = buf;
while ((end = strchrW(beg, ',')) && i < field)
{
beg = end + 1;
while (*beg && *beg == ' ')
beg++;
i++;
}
end = strchrW(beg, ',');
if (!end)
end = beg + lstrlenW(beg);
*end = '\0';
return strdupW(beg);
}
static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue,
MSISIGNATURE *sig)
{
......@@ -452,7 +478,7 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue,
FIXME("unimplemented for File (%s)\n", debugstr_w(buf));
break;
case msidbLocatorTypeRawValue:
*appValue = strdupW(buf);
*appValue = get_ini_field(buf, field);
break;
}
}
......
......@@ -6584,18 +6584,12 @@ static void test_appsearch_inilocator(void)
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
}
ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
}
ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP3", 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