[2/2] msi: Treat empty string as NULL in MsiGetSummaryInformationW.

Hans Leidekker hans at codeweavers.com
Wed Sep 29 02:58:12 CDT 2010


See http://bugs.winehq.org/show_bug.cgi?id=22994
---
 dlls/msi/suminfo.c       |    2 +-
 dlls/msi/tests/suminfo.c |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index 902a61f..b174e5b 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -469,7 +469,7 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
     if( !pHandle )
         return ERROR_INVALID_PARAMETER;
 
-    if( szDatabase )
+    if( szDatabase && szDatabase[0] )
     {
         LPCWSTR persist = uiUpdateCount ? MSIDBOPEN_TRANSACT : MSIDBOPEN_READONLY;
 
diff --git a/dlls/msi/tests/suminfo.c b/dlls/msi/tests/suminfo.c
index a0b225b..07202a3 100644
--- a/dlls/msi/tests/suminfo.c
+++ b/dlls/msi/tests/suminfo.c
@@ -86,7 +86,18 @@ static void test_suminfo(void)
     ok(r == ERROR_INVALID_PARAMETER, "MsiGetSummaryInformation wrong error\n");
 
     r = MsiGetSummaryInformation(hdb, NULL, 0, &hsuminfo);
-    ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
+    ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
+
+    r = MsiCloseHandle(hsuminfo);
+    ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+
+    r = MsiGetSummaryInformation(0, "", 0, &hsuminfo);
+    todo_wine
+    ok(r == ERROR_INSTALL_PACKAGE_INVALID || r == ERROR_INSTALL_PACKAGE_OPEN_FAILED,
+       "MsiGetSummaryInformation failed %u\n", r);
+
+    r = MsiGetSummaryInformation(hdb, "", 0, &hsuminfo);
+    ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
 
     r = MsiSummaryInfoGetPropertyCount(0, NULL);
     ok(r == ERROR_INVALID_HANDLE, "getpropcount failed\n");
-- 
1.7.0.4






More information about the wine-patches mailing list