]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix the disk display error when pCloud virtual disk is installed in Windows OS.
authorlongpanda <admin@ventoy.net>
Sun, 13 Nov 2022 11:29:49 +0000 (19:29 +0800)
committerlongpanda <admin@ventoy.net>
Sun, 13 Nov 2022 11:29:49 +0000 (19:29 +0800)
INSTALL/Ventoy2Disk.exe
INSTALL/Ventoy2Disk_ARM.exe
INSTALL/Ventoy2Disk_ARM64.exe
INSTALL/Ventoy2Disk_X64.exe
Ventoy2Disk/Ventoy2Disk/PhyDrive.c

index 616aea31807a7e3a54e3d6b0106b58fdbdce63b4..752803aa2656df920215201b51c6b526122083ef 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index f72d179c22b9240fbf5bf7aa5a18d46166c44107..39978371eab2397e32f72582861bb4bd13fb7d37 100644 (file)
Binary files a/INSTALL/Ventoy2Disk_ARM.exe and b/INSTALL/Ventoy2Disk_ARM.exe differ
index d920a7fa76748f0826888d7b47a6a6bd00fe04d8..2bbf0ae8b4c7e957050783a79e4a7ee19737e71d 100644 (file)
Binary files a/INSTALL/Ventoy2Disk_ARM64.exe and b/INSTALL/Ventoy2Disk_ARM64.exe differ
index b1119fcc5a3bac9425c8c00c0b5f1d11ddf95248..abdd455808ea327d848d7de2377ad6cda294235f 100644 (file)
Binary files a/INSTALL/Ventoy2Disk_X64.exe and b/INSTALL/Ventoy2Disk_X64.exe differ
index 3df7c7e87d8745ba16c53266a34cbeddc863359d..485d9ff29a8114ff9e51c229dd8614288e785cf0 100644 (file)
@@ -290,9 +290,9 @@ End:
 \r
 int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)\r
 {\r
-    BOOL Ret;\r
-    DWORD dwSize;\r
-    HANDLE Handle;\r
+    BOOL Ret = FALSE;\r
+    DWORD dwSize = 0;\r
+    HANDLE Handle = INVALID_HANDLE_VALUE;\r
     VOLUME_DISK_EXTENTS DiskExtents;\r
     CHAR PhyPath[128];\r
 \r
@@ -305,6 +305,7 @@ int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
         return -1;\r
     }\r
 \r
+    memset(&DiskExtents, 0, sizeof(DiskExtents));\r
     Ret = DeviceIoControl(Handle,\r
         IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,\r
         NULL,\r
@@ -322,9 +323,10 @@ int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
     }\r
     CHECK_CLOSE_HANDLE(Handle);\r
 \r
-    Log("LogicalDrive:%s PhyDrive:%d Offset:%llu ExtentLength:%llu",\r
+    Log("LogicalDrive:%s PhyDrive:%d Num:%d Offset:%llu ExtentLength:%llu",\r
         PhyPath,\r
         DiskExtents.Extents[0].DiskNumber,\r
+        DiskExtents.NumberOfDiskExtents,\r
         DiskExtents.Extents[0].StartingOffset.QuadPart,\r
         DiskExtents.Extents[0].ExtentLength.QuadPart\r
         );\r