From 48d97683b30c0cbaf4c229e36c48a69674332526 Mon Sep 17 00:00:00 2001 From: winesync Date: Mon, 14 Mar 2022 21:53:54 +0100 Subject: [PATCH] [WINESYNC] msi: Do not sign extend after multiplying. Signed-off-by: Mark Jansen wine-staging patch by Mark Jansen --- ..._Do_not_sign_extend_after_multiplying.diff | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff diff --git a/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff b/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff new file mode 100644 index 00000000000..6f8e3524a5b --- /dev/null +++ b/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff @@ -0,0 +1,26 @@ +diff --git a/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff b/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff +new file mode 100644 +index 00000000000..307428366a3 +--- /dev/null ++++ b/sdk/tools/winesync/msi_staging/0001-msi__Do_not_sign_extend_after_multiplying.diff +@@ -0,0 +1,20 @@ ++diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c ++index 9d82be8..8e4c151 100644 ++--- a/dll/win32/msi/dialog.c +++++ b/dll/win32/msi/dialog.c ++@@ -3186,13 +3186,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;