Commit 4a227c62 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Multiply by 512 in dialog_vcl_add_drives().

The main motivation here is to avoid overflow, and multiplying in one place seems simpler.
parent d7bbe884
...@@ -3107,14 +3107,12 @@ static LONGLONG vcl_get_cost( msi_dialog *dialog ) ...@@ -3107,14 +3107,12 @@ static LONGLONG vcl_get_cost( msi_dialog *dialog )
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature, if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost))) MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost)))
{ {
/* each_cost is in 512-byte units */ total_cost += each_cost;
total_cost += each_cost * 512;
} }
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature, if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost))) MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost)))
{ {
/* each_cost is in 512-byte units */ total_cost -= each_cost;
total_cost -= each_cost * 512;
} }
} }
return total_cost; return total_cost;
...@@ -3131,7 +3129,7 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) ...@@ -3131,7 +3129,7 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control )
DWORD size, flags; DWORD size, flags;
int i = 0; int i = 0;
cost = vcl_get_cost(dialog); cost = vcl_get_cost(dialog) * 512;
StrFormatByteSizeW(cost, cost_text, MAX_PATH); StrFormatByteSizeW(cost, cost_text, MAX_PATH);
size = GetLogicalDriveStringsW( 0, NULL ); size = GetLogicalDriveStringsW( 0, NULL );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment