msi: Treat empty string as NULL in MsiGetSummaryInformationW.

This commit is contained in:
Hans Leidekker 2010-09-29 09:58:12 +02:00 committed by Alexandre Julliard
parent 2b2fa04ca4
commit 259b5fdfa6
2 changed files with 13 additions and 2 deletions

View File

@ -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;

View File

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