Module: wine Branch: master Commit: 4a227c62a59a55aff9bacf1473c7f478f5c83294 URL: https://gitlab.winehq.org/wine/wine/-/commit/4a227c62a59a55aff9bacf1473c7f47...
Author: Zebediah Figura zfigura@codeweavers.com Date: Sat Mar 2 15:27:31 2024 -0600
msi: Multiply by 512 in dialog_vcl_add_drives().
The main motivation here is to avoid overflow, and multiplying in one place seems simpler.
---
dlls/msi/dialog.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index f70b127a7a5..57c9cc9bc9e 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3107,14 +3107,12 @@ static LONGLONG vcl_get_cost( msi_dialog *dialog ) if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature, MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost))) { - /* each_cost is in 512-byte units */ - total_cost += each_cost * 512; + total_cost += each_cost; } 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 -= each_cost; } } return total_cost; @@ -3131,7 +3129,7 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) DWORD size, flags; int i = 0;
- cost = vcl_get_cost(dialog); + cost = vcl_get_cost(dialog) * 512; StrFormatByteSizeW(cost, cost_text, MAX_PATH);
size = GetLogicalDriveStringsW( 0, NULL );