Module: wine Branch: master Commit: 259b5fdfa6036a1f4d782d215c507c9aaeb33eb4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=259b5fdfa6036a1f4d782d215c...
Author: Hans Leidekker hans@codeweavers.com Date: Wed Sep 29 09:58:12 2010 +0200
msi: Treat empty string as NULL in MsiGetSummaryInformationW.
---
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");