[PATCH 0/1] MR9908: msi: Don't list drives for which GetVolumeInformationW() or GetDiskFreeSpaceExW() fails.
From: Hans Leidekker <hans@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54160 --- dlls/msi/dialog.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index bfe494de30d..a228f138966 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3121,7 +3121,7 @@ static LONGLONG vcl_get_cost( msi_dialog *dialog ) static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) { ULARGE_INTEGER total, unused; - LONGLONG difference, cost; + LONGLONG cost; WCHAR size_text[MAX_PATH]; WCHAR cost_text[MAX_PATH]; LPWSTR drives, ptr; @@ -3143,8 +3143,8 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) ptr = drives; while (*ptr) { - if (GetVolumeInformationW(ptr, NULL, 0, NULL, 0, &flags, NULL, 0) && - flags & FILE_READ_ONLY_VOLUME) + if (!GetVolumeInformationW(ptr, NULL, 0, NULL, 0, &flags, NULL, 0) || (flags & FILE_READ_ONLY_VOLUME) || + !GetDiskFreeSpaceExW(ptr, &unused, &total, NULL)) { ptr += lstrlenW(ptr) + 1; continue; @@ -3157,9 +3157,6 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) lvitem.cchTextMax = lstrlenW(ptr) + 1; SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvitem ); - GetDiskFreeSpaceExW(ptr, &unused, &total, NULL); - difference = unused.QuadPart - cost; - StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH); lvitem.iSubItem = 1; lvitem.pszText = size_text; @@ -3177,7 +3174,7 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) lvitem.cchTextMax = lstrlenW(cost_text) + 1; SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem ); - StrFormatByteSizeW(difference, size_text, MAX_PATH); + StrFormatByteSizeW(unused.QuadPart - cost, size_text, MAX_PATH); lvitem.iSubItem = 4; lvitem.pszText = size_text; lvitem.cchTextMax = lstrlenW(size_text) + 1; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9908
participants (2)
-
Hans Leidekker -
Hans Leidekker (@hans)