Du kannst das ganze verkürzen...
Delphi-Quellcode:
type
TDrives = record
Device: LongWord;
Drive: String;
end;
var
Drives: array of TDrives;
procedure TForm1.FormCreate(Sender: TObject);
var
LogicalDrives: DWORD;
I: Integer;
begin
LogicalDrives := GetLogicalDrives;
for I := 0 to 25 do
if LogicalDrives and (1 shl I) <> 0 then
begin
SetLength(Drives, Length(Drives) + 1);
with Drives[High(Drives)] do
begin
Drive := Chr(I + Ord('A')) + ':\';
Device := GetDriveType(PChar(Drive));
end; {end with}
end; {end if}
end; {end procedure}