- status: open --> closed-fixed
- assigned_to: Andrew Haines
- Group: --> Won't_Fix
CreateMachineID references local SUBSTed drives with the midDrives option. This is not good as SUBSTed drive come and go at any time.
To fix this...
add the following variables:
device : array [0..2] of AnsiChar;
subst : array [0..1023] of AnsiChar;
and modify the last section of the CreateMachineID function to:
if (midDrives in MachineInfo) then
begin
// include drive specific information
for Drive := 'C' to 'Z' do
begin
if (GetDriveType(PAnsiChar(Drive + ':\')) = DRIVE_FIXED) then
begin
// detect SUBST drives and ignore
device[0] := Drive;
device[1] := ':';
device[2] := #0;
FillChar(subst, Sizeof(subst), 0);
QueryDosDevice(device, subst, 1024);
// SUBST drives return a \??\ prefix
if (Copy(StrPas(subst), 1, 4) <> '\??\') then
begin
FillChar(Buf, Sizeof(Buf), 0);
Buf[0] := Byte(Drive);
{!!.16} {removed cluster information}
GetVolumeInformation(PAnsiChar(Drive + ':\'), nil, 0,
PDWord(@Buf[1]){serial number}, I{not used}, I{not used}, nil, 0);
UpdateTMD(Context, Buf, 5);
end;
end;
end;
end;