msi: Show the available drives in the VolumeCostList control

James Hawkins truiken at gmail.com
Tue Sep 12 15:20:26 CDT 2006


Hi,

Changelog:
* Show the available drives in the VolumeCostList control.

 dlls/msi/dialog.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index aa0e2ae..4698112 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2328,6 +2328,39 @@ 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;
+    do
+    {
+        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 = strchrW( ptr, '\0' );
+        i++;
+    } while (  *(++ptr) != '\0' );
+
+    msi_free( drives );
+}
+
 static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec )
 {
     msi_control *control;
@@ -2341,6 +2374,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;
 }
-- 
1.4.2


More information about the wine-patches mailing list