Changeset 56912 in vbox
- Timestamp:
- Jul 10, 2015 11:07:03 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101609
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r56910 r56912 1177 1177 pszPartitions = argv[i]; 1178 1178 } 1179 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 1179 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_WINDOWS) 1180 1180 else if (strcmp(argv[i], "-relative") == 0) 1181 1181 { … … 1244 1244 cbSize = DiskLenInfo.Length.QuadPart; 1245 1245 } 1246 if ( fRelative 1247 && !rawdisk.startsWith("\\\\.\\PhysicalDrive", Utf8Str::CaseInsensitive)) 1248 { 1249 RTMsgError("The -relative parameter is invalid for raw disk %s", rawdisk.c_str()); 1250 vrc = VERR_INVALID_PARAMETER; 1251 goto out; 1252 } 1246 1253 } 1247 1254 else … … 1270 1277 #elif defined(RT_OS_LINUX) 1271 1278 struct stat DevStat; 1272 if (!fstat(RTFileToNative(hRawFile), &DevStat))1279 if (!fstat(RTFileToNative(hRawFile), &DevStat)) 1273 1280 { 1274 1281 if (S_ISBLK(DevStat.st_mode)) … … 1646 1653 pszRawName = psz; 1647 1654 uStartOffset = 0; 1655 #elif defined(RT_OS_WINDOWS) 1656 /* Refer to the correct partition and use offset 0. */ 1657 char *psz; 1658 RTStrAPrintf(&psz, "\\\\.\\Harddisk%sPartition%u", 1659 rawdisk.c_str() + 17, 1660 partitions.aPartitions[i].uIndex); 1661 if (!psz) 1662 { 1663 vrc = VERR_NO_STR_MEMORY; 1664 RTMsgError("Cannot create reference to individual partition %u, rc=%Rrc", 1665 partitions.aPartitions[i].uIndex, vrc); 1666 goto out; 1667 } 1668 pszRawName = psz; 1669 uStartOffset = 0; 1648 1670 #else 1649 1671 /** @todo not implemented for other hosts. Treat just like … … 1698 1720 if (!RawDescriptor.pPartDescs[i].cbData) 1699 1721 { 1700 if (RawDescriptor.uPartitioningType == MBR)1722 if (RawDescriptor.uPartitioningType == MBR) 1701 1723 { 1702 1724 RTMsgError("MBR/EPT overlaps with data area"); … … 1706 1728 else 1707 1729 { 1708 if (RawDescriptor.cPartDescs != i+1)1730 if (RawDescriptor.cPartDescs != i+1) 1709 1731 { 1710 1732 RTMsgError("GPT overlaps with data area");
Note:
See TracChangeset
for help on using the changeset viewer.