Module: wine Branch: master Commit: fced2fee2f153ce1e7f7ec4cff343870829e4f89 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fced2fee2f153ce1e7f7ec4cff...
Author: James Hawkins truiken@gmail.com Date: Sun Dec 16 20:28:09 2007 -0600
msi: Check the user component key for the clients.
---
dlls/msi/registry.c | 6 +++--- dlls/msi/tests/msi.c | 50 ++++++++++++++++++-------------------------------- 2 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index daa01e3..d81fb4e 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -1317,9 +1317,9 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct) if (!szComponent || !*szComponent || !szProduct) return ERROR_INVALID_PARAMETER;
- r = MSIREG_OpenComponentsKey(szComponent,&hkeyComp,FALSE); - if( r != ERROR_SUCCESS ) - return ERROR_NO_MORE_ITEMS; + r = MSIREG_OpenUserDataComponentKey(szComponent, &hkeyComp, FALSE); + if (r != ERROR_SUCCESS) + return ERROR_UNKNOWN_COMPONENT;
sz = SQUISH_GUID_SIZE; r = RegEnumValueW(hkeyComp, index, szValName, &sz, NULL, NULL, NULL, NULL); diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 61c7ddf..3cd7c29 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -1628,10 +1628,7 @@ static void test_MsiEnumClients(void) /* all params correct, component missing */ product[0] = '\0'; r = MsiEnumClientsA(component, 0, product); - todo_wine - { - ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r); - } + ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r); ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product);
lstrcpyA(keypath, "Software\Microsoft\Windows\CurrentVersion\"); @@ -1666,20 +1663,14 @@ static void test_MsiEnumClients(void)
/* product value exists */ r = MsiEnumClientsA(component, 0, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
/* try index 0 again */ product[0] = '\0'; r = MsiEnumClientsA(component, 0, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
/* try index 1, second product value does not exist */ product[0] = '\0'; @@ -1696,27 +1687,22 @@ static void test_MsiEnumClients(void) todo_wine { 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); } - ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product);
/* start the enumeration over */ product[0] = '\0'; r = MsiEnumClientsA(component, 0, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode) || !lstrcmpA(product, prodcode2), - "Expected %s or %s, got %s\n", prodcode, prodcode2, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode) || !lstrcmpA(product, prodcode2), + "Expected %s or %s, got %s\n", prodcode, prodcode2, product); + /* correctly query second product */ product[0] = '\0'; r = MsiEnumClientsA(component, 1, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode) || !lstrcmpA(product, prodcode2), - "Expected %s or %s, got %s\n", prodcode, prodcode2, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode) || !lstrcmpA(product, prodcode2), + "Expected %s or %s, got %s\n", prodcode, prodcode2, product);
RegDeleteValueA(compkey, prod_squashed); RegDeleteValueA(compkey, prod2_squashed); @@ -1733,10 +1719,7 @@ static void test_MsiEnumClients(void) /* user local component key exists */ product[0] = '\0'; r = MsiEnumClientsA(component, 0, product); - todo_wine - { - ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r); - } + ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r); ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product);
/* index > 0, no products exist */ @@ -1772,7 +1755,10 @@ static void test_MsiEnumClients(void) /* try index 1, second product value does not exist */ product[0] = '\0'; r = MsiEnumClientsA(component, 1, product); - ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + todo_wine + { + ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + } ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product);
res = RegSetValueExA(compkey, prod2_squashed, 0, REG_SZ, (const BYTE *)"C:\another", 10);