try to skip empty drives (#18)

This commit is contained in:
Basile Burg 2015-07-04 06:48:44 +02:00
parent 87a63d517f
commit ff576c985f
1 changed files with 4 additions and 1 deletions

View File

@ -635,13 +635,16 @@ procedure listDrives(aList: TStrings);
{$IFDEF WINDOWS}
var
drv: char;
ltr: string;
ltr, nme: string;
{$ENDIF}
begin
{$IFDEF WINDOWS}
setLength(nme, 255);
for drv := 'A' to 'Z' do
begin
ltr := drv + ':\';
if not GetVolumeInformation(PChar(ltr), PChar(nme), 255, nil, nil, nil, nil, 0) then
continue;
case GetDriveType(PChar(ltr)) of
DRIVE_REMOVABLE,
DRIVE_FIXED,