Hans Leidekker : msi: Treat empty string as NULL in MsiGetSummaryInformationW.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 14:41:50 CDT 2010


Module: wine
Branch: stable
Commit: 2d5351ff824f71005837d1d709216810b24599e4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d5351ff824f71005837d1d709216810b24599e4

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Sep 29 09:58:12 2010 +0200

msi: Treat empty string as NULL in MsiGetSummaryInformationW.
(cherry picked from commit 259b5fdfa6036a1f4d782d215c507c9aaeb33eb4)

---

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




More information about the wine-cvs mailing list