msi: Return ERROR_INVALID_PARAMETER if the product list is empty and index is not zero.

oldstable
James Hawkins 2007-12-16 20:30:14 -06:00 committed by Alexandre Julliard
parent 88d51ad122
commit 4295ce4fb6
2 changed files with 6 additions and 8 deletions

View File

@ -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;
}

View File

@ -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);