Commit 678a2abd authored by longpanda's avatar longpanda
Browse files

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

parent e6453017
No preview for this file type
......@@ -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
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment