Fix the disk display error when pCloud virtual disk is installed in Windows OS.

This commit is contained in:
longpanda 2022-11-13 19:29:49 +08:00
parent e645301713
commit 678a2abdf1
5 changed files with 6 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -290,9 +290,9 @@ End:
int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
{
BOOL Ret;
DWORD dwSize;
HANDLE Handle;
BOOL Ret = FALSE;
DWORD dwSize = 0;
HANDLE Handle = INVALID_HANDLE_VALUE;
VOLUME_DISK_EXTENTS DiskExtents;
CHAR PhyPath[128];
@ -305,6 +305,7 @@ int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
return -1;
}
memset(&DiskExtents, 0, sizeof(DiskExtents));
Ret = DeviceIoControl(Handle,
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
NULL,
@ -322,9 +323,10 @@ int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
}
CHECK_CLOSE_HANDLE(Handle);
Log("LogicalDrive:%s PhyDrive:%d Offset:%llu ExtentLength:%llu",
Log("LogicalDrive:%s PhyDrive:%d Num:%d Offset:%llu ExtentLength:%llu",
PhyPath,
DiskExtents.Extents[0].DiskNumber,
DiskExtents.NumberOfDiskExtents,
DiskExtents.Extents[0].StartingOffset.QuadPart,
DiskExtents.Extents[0].ExtentLength.QuadPart
);