Module: wine Branch: master Commit: 75ee2262cc3f49e7718cb114ae159bf3eaf6d167 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=75ee2262cc3f49e7718cb114...
Author: James Hawkins truiken@gmail.com Date: Tue Sep 12 13:20:26 2006 -0700
msi: Show the available drives in the VolumeCostList control.
---
dlls/msi/dialog.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index aa0e2ae..0b63966 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -2328,6 +2328,38 @@ static void msi_dialog_vcl_add_columns( } }
+static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control ) +{ + LPWSTR drives, ptr; + LVITEMW lvitem; + DWORD size; + int i = 0; + + size = GetLogicalDriveStringsW( 0, NULL ); + if ( !size ) return; + + drives = msi_alloc( (size + 1) * sizeof(WCHAR) ); + if ( !drives ) return; + + GetLogicalDriveStringsW( size, drives ); + + ptr = drives; + while (*ptr) + { + lvitem.mask = LVIF_TEXT; + lvitem.iItem = i; + lvitem.iSubItem = 0; + lvitem.pszText = ptr; + lvitem.cchTextMax = lstrlenW(ptr) + 1; + SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvitem ); + + ptr += lstrlenW(ptr) + 1; + i++; + } + + msi_free( drives ); +} + static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; @@ -2341,6 +2373,7 @@ static UINT msi_dialog_volumecost_list( return ERROR_FUNCTION_FAILED;
msi_dialog_vcl_add_columns( dialog, control, rec ); + msi_dialog_vcl_add_drives( dialog, control );
return ERROR_SUCCESS; }