Misha Koshelev : msi: Return appropriate values for empty MsiProductInfo parameters.

Alexandre Julliard julliard at wine.codeweavers.com
Thu May 17 06:42:35 CDT 2007


Module: wine
Branch: master
Commit: d800a082a8352421d98c4d81112535dda7d8105a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d800a082a8352421d98c4d81112535dda7d8105a

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Thu May 17 00:42:20 2007 -0500

msi: Return appropriate values for empty MsiProductInfo parameters.

---

 dlls/msi/msi.c       |    6 +++++-
 dlls/msi/tests/msi.c |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index ae67b75..34721df 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -444,7 +444,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
      * FIXME: Values seem scattered/duplicated in the registry. Is there a system?
      */
 
-    if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
+    if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szProduct[0] || !szAttribute)
         return ERROR_INVALID_PARAMETER;
 
     /* check for special properties */
@@ -505,6 +505,10 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
 
         RegCloseKey(hkey);
     }
+    else if (!szAttribute[0])
+    {
+        return ERROR_UNKNOWN_PROPERTY;
+    }
     else
     {
         static const WCHAR szDisplayVersion[] = {
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 81a5b73..4e5db4f 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -131,7 +131,7 @@ static void test_null(void)
     ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
 
     r = MsiGetProductInfoA("", "", NULL, NULL);
-    todo_wine ok ( r == ERROR_INVALID_PARAMETER, "wrong error %d\n", r);
+    ok ( r == ERROR_INVALID_PARAMETER, "wrong error %d\n", r);
 
     if (lpData)
     {
@@ -157,7 +157,7 @@ static void test_null(void)
     ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
 
     r = MsiGetProductInfoA("{F1C3AF50-8B56-4A69-A00C-00773FE42F30}", "", NULL, NULL);
-    todo_wine ok ( r == ERROR_UNKNOWN_PROPERTY, "wrong error %d\n", r);
+    ok ( r == ERROR_UNKNOWN_PROPERTY, "wrong error %d\n", r);
 
     r = RegCloseKey(hkey);
     ok( r == ERROR_SUCCESS, "wrong error %d\n", r);




More information about the wine-cvs mailing list