mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity
This commit is contained in:
@@ -7346,11 +7346,13 @@ int GetDiskDeviceDriveLetter (PWSTR deviceName)
|
|||||||
StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\");
|
StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\");
|
||||||
StringCchCatW (link, MAX_PATH, drive);
|
StringCchCatW (link, MAX_PATH, drive);
|
||||||
|
|
||||||
ResolveSymbolicLink (link, target, sizeof(target));
|
if ( ResolveSymbolicLink (link, target, sizeof(target))
|
||||||
|
&& (wcscmp (device, target) == 0)
|
||||||
if (wcscmp (device, target) == 0)
|
)
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user