James Hawkins : msi: Return the requested ini field.
Module: wine Branch: master Commit: 642cddf1806e95167c053e929f148dca0562430f URL: http://source.winehq.org/git/wine.git/?a=commit;h=642cddf1806e95167c053e929f... Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Oct 20 04:19:22 2008 -0500 msi: Return the requested ini field. --- dlls/msi/appsearch.c | 28 +++++++++++++++++++++++++++- dlls/msi/tests/package.c | 10 ++-------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index b335946..247cee0 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -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; } } diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index b6b3a78..fd9c58f 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -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);
participants (1)
-
Alexandre Julliard