From 4295ce4fb63c833cd30b9f351897fd4302cf4c09 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Sun, 16 Dec 2007 20:30:14 -0600 Subject: [PATCH] msi: Return ERROR_INVALID_PARAMETER if the product list is empty and index is not zero. --- dlls/msi/registry.c | 4 ++++ dlls/msi/tests/msi.c | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index c80247ad404..12d2c9abe2f 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -1327,6 +1327,10 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct) if (r != ERROR_SUCCESS) { RegCloseKey(hkeyComp); + + if (index != 0) + return ERROR_INVALID_PARAMETER; + return ERROR_UNKNOWN_COMPONENT; } diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index c46d651dd95..b31d88fa7b3 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -1649,10 +1649,7 @@ static void test_MsiEnumClients(void) /* index > 0, no products exist */ product[0] = '\0'; r = MsiEnumClientsA(component, 1, product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"C:\\imapath", 10); @@ -1722,10 +1719,7 @@ static void test_MsiEnumClients(void) /* index > 0, no products exist */ product[0] = '\0'; r = MsiEnumClientsA(component, 1, product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"C:\\imapath", 10);