Changeset 85945 in vbox for trunk/src/VBox/Storage
- Timestamp:
- Aug 28, 2020 9:14:21 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 140140
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r85903 r85945 3769 3769 char **ppszRawPartition) 3770 3770 { 3771 # if 1 3772 /* 3773 * Ask the drive handle for its device number rather than mess about extracting 3774 * it from the path (discovered this later when doing the path verification). 3775 */ 3776 int rc = VINF_SUCCESS; 3777 DWORD cbReturned = 0; 3778 STORAGE_DEVICE_NUMBER DevNum; 3779 RT_ZERO(DevNum); 3780 if (DeviceIoControl((HANDLE)RTFileToNative(hRawDrive), IOCTL_STORAGE_GET_DEVICE_NUMBER, 3781 NULL /*pvInBuffer*/, 0 /*cbInBuffer*/, &DevNum, sizeof(DevNum), &cbReturned, NULL /*pOverlapped*/)) 3782 RTStrAPrintf(ppszRawPartition, "\\\\.\\Harddisk%uPartition%u", DevNum.DeviceNumber, idxPartition); 3783 else 3784 rc = vdIfError(pImage->pIfError, RTErrConvertFromWin32(GetLastError()), RT_SRC_POS, 3785 N_("VMDK: Image path: '%s'. IOCTL_STORAGE_GET_DEVICE_NUMBER failed on '%s': %u"), 3786 pImage->pszFilename, pszRawDrive, GetLastError()); 3787 return rc; 3788 3789 # else 3771 3790 /* 3772 3791 * First variant is \\.\PhysicalDriveX -> \\.\HarddiskXPartition{idxPartition} … … 3829 3848 pImage->pszFilename, pszRawDrive, idxPartition, rc); 3830 3849 return rc; 3850 # endif 3831 3851 } 3832 3852 #endif /* RT_OS_WINDOWS */
Note:
See TracChangeset
for help on using the changeset viewer.