Added patch to fix cost computation in MSI for large values.

This commit is contained in:
Sebastian Lackner 2017-01-14 01:28:20 +01:00
parent 4b0fe0c820
commit b2098faef8
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 8570cb45ae2a6e39df2fe1d9642fb4d987d6b2e0 Mon Sep 17 00:00:00 2001
From: Mark Jansen <learn0more+wine@gmail.com>
Date: Fri, 13 Jan 2017 23:20:52 +0100
Subject: msi: Do not sign extend after multiplying.
Signed-off-by: Mark Jansen <learn0more+wine@gmail.com>
---
dlls/msi/dialog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index fc9c24c90a3..d9a2ab7a614 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3184,13 +3184,13 @@ static LONGLONG msi_vcl_get_cost( msi_dialog *dialog )
MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost)))
{
/* each_cost is in 512-byte units */
- total_cost += each_cost * 512;
+ total_cost += ((LONGLONG)each_cost) * 512;
}
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost)))
{
/* each_cost is in 512-byte units */
- total_cost -= each_cost * 512;
+ total_cost -= ((LONGLONG)each_cost) * 512;
}
}
return total_cost;
--
2.11.0

View File

@ -204,6 +204,7 @@ patch_enable_all ()
enable_mpr_WNetGetUniversalNameW="$1"
enable_mscoree_CorValidateImage="$1"
enable_mshtml_HTMLLocation_put_hash="$1"
enable_msi_msi_vcl_get_cost="$1"
enable_msidb_Implementation="$1"
enable_msvcr120__SetWinRTOutOfMemoryExceptionCallback="$1"
enable_msvcrt_Math_Precision="$1"
@ -810,6 +811,9 @@ patch_enable ()
mshtml-HTMLLocation_put_hash)
enable_mshtml_HTMLLocation_put_hash="$2"
;;
msi-msi_vcl_get_cost)
enable_msi_msi_vcl_get_cost="$2"
;;
msidb-Implementation)
enable_msidb_Implementation="$2"
;;
@ -4962,6 +4966,18 @@ if test "$enable_mshtml_HTMLLocation_put_hash" -eq 1; then
) >> "$patchlist"
fi
# Patchset msi-msi_vcl_get_cost
# |
# | Modified files:
# | * dlls/msi/dialog.c
# |
if test "$enable_msi_msi_vcl_get_cost" -eq 1; then
patch_apply msi-msi_vcl_get_cost/0001-msi-Do-not-sign-extend-after-multiplying.patch
(
echo '+ { "Mark Jansen", "msi: Do not sign extend after multiplying.", 1 },';
) >> "$patchlist"
fi
# Patchset msidb-Implementation
# |
# | Modified files: