msi: Make sure to ignore UI level flags in dialog and files as well.

Misha Koshelev mk144210 at bcm.tmc.edu
Tue Feb 6 23:53:24 CST 2007


So I was working on a conformance fix for my patch that fixed bug 6992,
and I noticed that the same problem (UI level property is used without
regard for flags) is made in dialog.c and files.c as well. So I added a
define in MSIPRIV.H for the mask (since the flags run from 0-5 I made it
0x7 instead of 0xf) and change action.c, dialog.c, and files.c.

Changelog:

	* msi: Make sure to ignore UI level flags in dialog and files as well.
-------------- next part --------------
From 1c7d0fce1dd8240c18147a46f5e39e8961fbe15c Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at bcm.tmc.edu>
Date: Tue, 6 Feb 2007 23:50:05 -0600
Subject: msi: Make sure to ignore UI level flags in dialog and files as well.
---
 dlls/msi/action.c  |    2 +-
 dlls/msi/dialog.c  |    2 +-
 dlls/msi/files.c   |    2 +-
 dlls/msi/msipriv.h |    3 +++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 6c2fdf4..1a8fa5a 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -642,7 +642,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *pac
     msi_apply_transforms( package );
     msi_apply_patches( package );
 
-    if ( (msi_get_property_int(package, szUILevel, 0) & 0xf) >= INSTALLUILEVEL_REDUCED )
+    if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) >= INSTALLUILEVEL_REDUCED )
     {
         package->script->InWhatSequence |= SEQUENCE_UI;
         rc = ACTION_ProcessUISequence(package);
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 86f9e00..421105c 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3542,7 +3542,7 @@ UINT msi_spawn_error_dialog( MSIPACKAGE 
         'M','S','I','E','r','r','o','r','D','i','a','l','o','g','R','e','s','u','l','t',0
     };
 
-    if ( msi_get_property_int(package, szUILevel, 0) == INSTALLUILEVEL_NONE )
+    if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE )
         return ERROR_SUCCESS;
 
     if ( !error_dialog )
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 9af403f..e370b1e 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -77,7 +77,7 @@ static UINT msi_change_media( MSIPACKAGE
     static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
     static const WCHAR error_prop[] = {'E','r','r','o','r','D','i','a','l','o','g',0};
 
-    if ( msi_get_property_int(package, szUILevel, 0) == INSTALLUILEVEL_NONE && !gUIHandlerA )
+    if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE && !gUIHandlerA )
         return ERROR_SUCCESS;
 
     error = generate_error_string( package, 1302, 1, mi->disk_prompt );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 815b70c..a70934a 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -45,6 +45,9 @@ #define MSIWORDCOUNT_SHORTFILENAMES     
 #define MSIWORDCOUNT_COMPRESSED         0x0002
 #define MSIWORDCOUNT_ADMINISTRATIVE     0x0004
 #define MSIWORDCOUNT_PRIVILEGES         0x0008
+ 
+/* Install UI level mask for AND operation to exclude flags */
+#define INSTALLUILEVEL_MASK             0x0007
 
 #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
 
-- 
1.4.1



More information about the wine-patches mailing list