From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/msi/registry.c | 12 ++++++++++-- dlls/msi/tests/msi.c | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 4f49284cb6a..ce35cb3313f 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -953,8 +953,16 @@ UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR szDescriptor, LPWSTR szProduct, } if (szFeature) { - memcpy( szFeature, &szDescriptor[20], len*sizeof(WCHAR) ); - szFeature[len] = 0; + if (!len) /* Single feature was not encoded, figure it out */ + { + if (MsiEnumFeaturesW( szProduct, 0, szFeature, NULL ) != ERROR_SUCCESS) + return ERROR_INVALID_PARAMETER; + } + else + { + memcpy( szFeature, &szDescriptor[20], len*sizeof(WCHAR) ); + szFeature[len] = 0; + } }
len = p - szDescriptor + 1; diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 724665a70c0..f6fa21e745a 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -3375,7 +3375,7 @@ static void test_MsiProvideQualifiedComponentEx(void) memcpy( desc + lstrlenA(desc), "<\0", sizeof("<\0") ); len = 0; r = pMsiDecomposeDescriptorA( desc, prod2, feature, comp2, &len ); - todo_wine ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r ); + ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r ); } else win_skip("MsiDecomposeDescriptorA is not available on this platform\n"); @@ -3498,7 +3498,7 @@ static void test_MsiProvideQualifiedComponentEx(void) ok( r == ERROR_SUCCESS, "got %u\n", r ); ok( len == strlen(desc), "got %lu\n", len ); ok( !strcmp(prod2, prod), "got %s\n", debugstr_a(prod2) ); - todo_wine ok( !strcmp(feature, "feature"), "got %s\n", debugstr_a(feature) ); + ok( !strcmp(feature, "feature"), "got %s\n", debugstr_a(feature) ); ok( !strcmp(comp2, comp2), "got %s\n", debugstr_a(comp) ); } else