msi [4/10]: Return ERROR_BAD_CONFIGURATION if the SourceList key does not exist

James Hawkins truiken at gmail.com
Fri Jun 29 16:12:48 CDT 2007


Hi,

Changelog:
* Return ERROR_BAD_CONFIGURATION if the SourceList key does not exist.

 dlls/msi/source.c       |   10 +++++++---
 dlls/msi/tests/source.c |    5 +----
 2 files changed, 8 insertions(+), 7 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 3c73351..70a9552 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -63,12 +63,16 @@ static UINT OpenSourceKey(LPCWSTR szProd
         rc = MSIREG_OpenProductsKey(szProduct, &rootkey, create);
 
     if (rc)
-        return rc;
+        return ERROR_UNKNOWN_PRODUCT;
 
     if (create)
         rc = RegCreateKeyW(rootkey, szSourceList, key);
     else
-        rc = RegOpenKeyW(rootkey,szSourceList, key); 
+    {
+        rc = RegOpenKeyW(rootkey,szSourceList, key);
+        if (rc != ERROR_SUCCESS)
+            rc = ERROR_BAD_CONFIGURATION;
+    }
 
     return rc;
 }
@@ -250,7 +254,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWS
         rc = OpenSourceKey(szProduct, &sourcekey, TRUE, FALSE);
 
     if (rc != ERROR_SUCCESS)
-        return ERROR_UNKNOWN_PRODUCT;
+        return rc;
 
     if (strcmpW(szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW) == 0)
     {
diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c
index 306a3b4..b87d1ba 100644
--- a/dlls/msi/tests/source.c
+++ b/dlls/msi/tests/source.c
@@ -199,10 +199,7 @@ static void test_MsiSourceListGetInfo(vo
     /* user product key exists */
     r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
                               MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size);
-    todo_wine
-    {
-        ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
-    }
+    ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
 
     res = RegCreateKeyA(userkey, "SourceList", &hkey);
     ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
-- 
1.4.1



More information about the wine-patches mailing list