Code:
procedure LoadLogicalDrives(Strings: TStrings);
var
S: DWORD;
AllStrings, CurrentString: PChar;
begin
S := 255;
GetMem(AllStrings, Succ(S));
GetLogicalDriveStrings(S, AllStrings);
try
if AllStrings <> nil then
begin
CurrentString := AllStrings;
while True do
begin
Strings.Add(StrPas(CurrentString));
Inc(CurrentString, Succ(StrLen(CurrentString)));
if CurrentString[0] = #0 then
Break;
end;
end;
finally
FreeMem(AllStrings);
end;
end;
Ungetestet, sollte aber funktionieren.
Getestet und korrigiert!!!