Hans Leidekker : msi: Open the database read/ write when the update count is greater than zero in MsiGetSummaryInformation .
Alexandre Julliard
julliard at winehq.org
Thu Sep 10 09:07:48 CDT 2009
Module: wine
Branch: master
Commit: 3a7c2d005c244039c5d7e89e7b7e09ecfbea0e03
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a7c2d005c244039c5d7e89e7b7e09ecfbea0e03
Author: Hans Leidekker <hans at meelstraat.net>
Date: Wed Sep 9 20:11:48 2009 +0200
msi: Open the database read/write when the update count is greater than zero in MsiGetSummaryInformation.
---
dlls/msi/suminfo.c | 4 +++-
dlls/msi/tests/install.c | 5 +----
dlls/msi/tests/suminfo.c | 32 ++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index a02f949..ef16665 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -475,7 +475,9 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
if( szDatabase )
{
- ret = MSI_OpenDatabaseW( szDatabase, NULL, &db );
+ LPCWSTR persist = uiUpdateCount ? MSIDBOPEN_TRANSACT : MSIDBOPEN_READONLY;
+
+ ret = MSI_OpenDatabaseW( szDatabase, persist, &db );
if( ret != ERROR_SUCCESS )
return ret;
}
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 3a22ca3..9d1237a 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -4491,10 +4491,7 @@ static void set_transform_summary_info(void)
ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
r = MsiSummaryInfoPersist(suminfo);
- todo_wine
- {
- ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
- }
+ ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
r = MsiCloseHandle(suminfo);
ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
diff --git a/dlls/msi/tests/suminfo.c b/dlls/msi/tests/suminfo.c
index 3afd0d5..f0e7fdd 100644
--- a/dlls/msi/tests/suminfo.c
+++ b/dlls/msi/tests/suminfo.c
@@ -239,6 +239,32 @@ static void test_suminfo(void)
r = MsiCloseHandle(hdb);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+ /* filename, non-zero update count */
+ MsiGetSummaryInformation(0, msifile, 1, &hsuminfo);
+ ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed\n");
+
+ r = MsiSummaryInfoSetProperty(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
+ ok(r == ERROR_SUCCESS, "MsiSummaryInfoSetProperty wrong error\n");
+
+ r = MsiSummaryInfoPersist(hsuminfo);
+ ok(r == ERROR_SUCCESS, "MsiSummaryInfoPersist failed %u\n", r);
+
+ r = MsiCloseHandle(hsuminfo);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed %u\n", r);
+
+ /* filename, zero update count */
+ MsiGetSummaryInformation(0, msifile, 0, &hsuminfo);
+ ok(r == ERROR_SUCCESS, "MsiGetSummaryInformation failed %u\n", r);
+
+ r = MsiSummaryInfoSetProperty(hsuminfo, PID_AUTHOR, VT_LPSTR, 1, &ft, "Mike");
+ todo_wine ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty wrong error, %u\n", r);
+
+ r = MsiSummaryInfoPersist(hsuminfo);
+ ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist wrong error %u\n", r);
+
+ r = MsiCloseHandle(hsuminfo);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+
r = DeleteFile(msifile);
ok(r, "DeleteFile failed\n");
}
@@ -409,6 +435,12 @@ static void test_summary_binary(void)
ok(r == ERROR_SUCCESS, "getpropcount failed\n");
todo_wine ok(count == 10, "prop count incorrect\n");
+ r = MsiSummaryInfoSetProperty( hsuminfo, PID_TITLE, VT_LPSTR, 0, NULL, "Mike" );
+ ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoSetProperty failed %u\n", r);
+
+ r = MsiSummaryInfoPersist( hsuminfo );
+ ok(r == ERROR_FUNCTION_FAILED, "MsiSummaryInfoPersist failed %u\n", r);
+
MsiCloseHandle( hsuminfo );
MsiCloseHandle( hdb );
More information about the wine-cvs
mailing list