mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Removed :\ from drive names
This commit is contained in:
parent
35377f6d55
commit
3c788193d7
1 changed files with 9 additions and 5 deletions
|
|
@ -368,8 +368,9 @@ class function TDriveWatcher.GetDrivesList: TDrivesList;
|
|||
var
|
||||
Drive : PDrive;
|
||||
DriveNum: Integer;
|
||||
DriveBits: set of 0..25;
|
||||
DriveBits: DWORD;
|
||||
WinDriveType: UINT;
|
||||
DriveLetter: Char;
|
||||
DrivePath: String;
|
||||
begin
|
||||
Result := TDrivesList.Create;
|
||||
|
|
@ -377,8 +378,11 @@ begin
|
|||
DWORD(DriveBits) := GetLogicalDrives;
|
||||
for DriveNum := 0 to 25 do
|
||||
begin
|
||||
if not (DriveNum in DriveBits) then Continue;
|
||||
DrivePath := Char(DriveNum + Ord('a')) + ':\';
|
||||
if ((DriveBits shr DriveNum) and $1) = 0 then
|
||||
Continue;
|
||||
|
||||
DriveLetter := Char(DriveNum + Ord('a'));
|
||||
DrivePath := DriveLetter + ':\';
|
||||
WinDriveType := GetDriveType(PChar(DrivePath));
|
||||
if WinDriveType = DRIVE_NO_ROOT_DIR then Continue;
|
||||
New(Drive);
|
||||
|
|
@ -387,7 +391,7 @@ begin
|
|||
begin
|
||||
DeviceId := EmptyStr;
|
||||
Path := DrivePath;
|
||||
DisplayName := Path;
|
||||
DisplayName := DriveLetter;
|
||||
DriveLabel := EmptyStr;
|
||||
FileSystem := EmptyStr;
|
||||
IsMediaAvailable := True;
|
||||
|
|
@ -398,7 +402,7 @@ begin
|
|||
case WinDriveType of
|
||||
DRIVE_REMOVABLE:
|
||||
begin
|
||||
if Path[1] in ['a'..'b'] then
|
||||
if DriveLetter in ['a', 'b'] then
|
||||
DriveType := dtFloppy
|
||||
else
|
||||
DriveType := dtFlash;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue