Changeset 15366 in vbox for trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
- Timestamp:
- Dec 12, 2008 1:50:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r14967 r15366 117 117 { 118 118 if (pPreHdr->u32Signature != VDI_IMAGE_SIGNATURE) 119 return VERR_VD I_INVALID_SIGNATURE;119 return VERR_VD_VDI_INVALID_SIGNATURE; 120 120 121 121 if ( VDI_GET_VERSION_MAJOR(pPreHdr->u32Version) != VDI_IMAGE_VERSION_MAJOR 122 122 && pPreHdr->u32Version != 0x00000002) /* old version. */ 123 return VERR_VD I_UNSUPPORTED_VERSION;123 return VERR_VD_VDI_UNSUPPORTED_VERSION; 124 124 125 125 return VINF_SUCCESS; … … 246 246 LogRel(("VDI: v1 header size wrong (%d < %d)\n", 247 247 pHeader->u.v1.cbHeader, sizeof(VDIHEADER1))); 248 return VERR_VD I_INVALID_HEADER;248 return VERR_VD_VDI_INVALID_HEADER; 249 249 } 250 250 … … 253 253 LogRel(("VDI: v1 blocks offset wrong (%d < %d)\n", 254 254 getImageBlocksOffset(pHeader), sizeof(VDIPREHEADER) + sizeof(VDIHEADER1))); 255 return VERR_VD I_INVALID_HEADER;255 return VERR_VD_VDI_INVALID_HEADER; 256 256 } 257 257 … … 260 260 LogRel(("VDI: v1 image data offset wrong (%d < %d)\n", 261 261 getImageDataOffset(pHeader), getImageBlocksOffset(pHeader) + getImageBlocks(pHeader) * sizeof(VDIIMAGEBLOCKPOINTER))); 262 return VERR_VD I_INVALID_HEADER;262 return VERR_VD_VDI_INVALID_HEADER; 263 263 } 264 264 … … 267 267 default: 268 268 /* Unsupported. */ 269 return VERR_VD I_UNSUPPORTED_VERSION;269 return VERR_VD_VDI_UNSUPPORTED_VERSION; 270 270 } 271 271 … … 342 342 } 343 343 344 return fFailed ? VERR_VD I_INVALID_HEADER : VINF_SUCCESS;344 return fFailed ? VERR_VD_VDI_INVALID_HEADER : VINF_SUCCESS; 345 345 } 346 346 … … 381 381 && strlen(pszComment) >= VDI_IMAGE_COMMENT_SIZE) 382 382 { 383 rc = vdiError(pImage, VERR_VD I_COMMENT_TOO_LONG, RT_SRC_POS, N_("VDI: comment is too long for '%s'"), pImage->pszFilename);383 rc = vdiError(pImage, VERR_VD_VDI_COMMENT_TOO_LONG, RT_SRC_POS, N_("VDI: comment is too long for '%s'"), pImage->pszFilename); 384 384 goto out; 385 385 } … … 656 656 break; 657 657 default: 658 rc = vdiError(pImage, VERR_VD I_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VDI: unsupported major version %u in '%s'"), GET_MAJOR_HEADER_VERSION(&pImage->Header), pImage->pszFilename);658 rc = vdiError(pImage, VERR_VD_VDI_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VDI: unsupported major version %u in '%s'"), GET_MAJOR_HEADER_VERSION(&pImage->Header), pImage->pszFilename); 659 659 goto out; 660 660 } … … 663 663 if (RT_FAILURE(rc)) 664 664 { 665 rc = vdiError(pImage, VERR_VD I_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VDI: invalid header in '%s'"), pImage->pszFilename);665 rc = vdiError(pImage, VERR_VD_VDI_INVALID_HEADER, RT_SRC_POS, N_("VDI: invalid header in '%s'"), pImage->pszFilename); 666 666 goto out; 667 667 } … … 707 707 break; 708 708 default: 709 rc = VERR_VD I_UNSUPPORTED_VERSION;709 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 710 710 break; 711 711 } … … 1030 1030 1031 1031 if (pImage->paBlocks[uBlock] == VDI_IMAGE_BLOCK_FREE) 1032 rc = VERR_VD I_BLOCK_FREE;1032 rc = VERR_VD_BLOCK_FREE; 1033 1033 else if (pImage->paBlocks[uBlock] == VDI_IMAGE_BLOCK_ZERO) 1034 1034 { … … 1069 1069 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1070 1070 { 1071 rc = VERR_VD I_IMAGE_READ_ONLY;1071 rc = VERR_VD_IMAGE_READ_ONLY; 1072 1072 goto out; 1073 1073 } … … 1138 1138 *pcbPreRead = offWrite % getImageBlockSize(&pImage->Header); 1139 1139 *pcbPostRead = getImageBlockSize(&pImage->Header) - cbToWrite - *pcbPreRead; 1140 rc = VERR_VD I_BLOCK_FREE;1140 rc = VERR_VD_BLOCK_FREE; 1141 1141 } 1142 1142 } … … 1201 1201 *penmImageType = vdiTranslateTypeVDI2VD(getImageType(&pImage->Header)); 1202 1202 else 1203 rc = VERR_VD I_NOT_OPENED;1203 rc = VERR_VD_NOT_OPENED; 1204 1204 1205 1205 LogFlowFunc(("returns %Rrc enmImageType=%u\n", rc, *penmImageType)); … … 1267 1267 } 1268 1268 else 1269 rc = VERR_VD I_GEOMETRY_NOT_SET;1270 } 1271 else 1272 rc = VERR_VD I_NOT_OPENED;1269 rc = VERR_VD_GEOMETRY_NOT_SET; 1270 } 1271 else 1272 rc = VERR_VD_NOT_OPENED; 1273 1273 1274 1274 LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors)); … … 1290 1290 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1291 1291 { 1292 rc = VERR_VD I_IMAGE_READ_ONLY;1292 rc = VERR_VD_IMAGE_READ_ONLY; 1293 1293 goto out; 1294 1294 } … … 1298 1298 } 1299 1299 else 1300 rc = VERR_VD I_NOT_OPENED;1300 rc = VERR_VD_NOT_OPENED; 1301 1301 1302 1302 out: … … 1332 1332 } 1333 1333 else 1334 rc = VERR_VD I_GEOMETRY_NOT_SET;1335 } 1336 else 1337 rc = VERR_VD I_NOT_OPENED;1334 rc = VERR_VD_GEOMETRY_NOT_SET; 1335 } 1336 else 1337 rc = VERR_VD_NOT_OPENED; 1338 1338 1339 1339 LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors)); … … 1356 1356 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1357 1357 { 1358 rc = VERR_VD I_IMAGE_READ_ONLY;1358 rc = VERR_VD_IMAGE_READ_ONLY; 1359 1359 goto out; 1360 1360 } … … 1374 1374 } 1375 1375 else 1376 rc = VERR_VD I_NOT_OPENED;1376 rc = VERR_VD_NOT_OPENED; 1377 1377 1378 1378 out: … … 1466 1466 } 1467 1467 else 1468 rc = VERR_VD I_NOT_OPENED;1468 rc = VERR_VD_NOT_OPENED; 1469 1469 1470 1470 LogFlowFunc(("returns %Rrc comment=\"%s\"\n", rc, pszComment)); … … 1483 1483 if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY) 1484 1484 { 1485 rc = VERR_VD I_IMAGE_READ_ONLY;1485 rc = VERR_VD_IMAGE_READ_ONLY; 1486 1486 goto out; 1487 1487 } … … 1493 1493 { 1494 1494 LogFunc(("pszComment is too long, %d bytes!\n", cchComment)); 1495 rc = VERR_VD I_COMMENT_TOO_LONG;1495 rc = VERR_VD_VDI_COMMENT_TOO_LONG; 1496 1496 goto out; 1497 1497 } … … 1510 1510 } 1511 1511 else 1512 rc = VERR_VD I_UNSUPPORTED_VERSION;1513 } 1514 else 1515 rc = VERR_VD I_NOT_OPENED;1512 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 1513 } 1514 else 1515 rc = VERR_VD_NOT_OPENED; 1516 1516 1517 1517 out: … … 1535 1535 } 1536 1536 else 1537 rc = VERR_VD I_NOT_OPENED;1537 rc = VERR_VD_NOT_OPENED; 1538 1538 1539 1539 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 1562 1562 { 1563 1563 LogFunc(("Version is not supported!\n")); 1564 rc = VERR_VD I_UNSUPPORTED_VERSION;1564 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 1565 1565 } 1566 1566 } 1567 1567 else 1568 rc = VERR_VD I_IMAGE_READ_ONLY;1569 } 1570 else 1571 rc = VERR_VD I_NOT_OPENED;1568 rc = VERR_VD_IMAGE_READ_ONLY; 1569 } 1570 else 1571 rc = VERR_VD_NOT_OPENED; 1572 1572 1573 1573 LogFlowFunc(("returns %Rrc\n", rc)); … … 1590 1590 } 1591 1591 else 1592 rc = VERR_VD I_NOT_OPENED;1592 rc = VERR_VD_NOT_OPENED; 1593 1593 1594 1594 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 1617 1617 { 1618 1618 LogFunc(("Version is not supported!\n")); 1619 rc = VERR_VD I_UNSUPPORTED_VERSION;1619 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 1620 1620 } 1621 1621 } 1622 1622 else 1623 rc = VERR_VD I_IMAGE_READ_ONLY;1624 } 1625 else 1626 rc = VERR_VD I_NOT_OPENED;1623 rc = VERR_VD_IMAGE_READ_ONLY; 1624 } 1625 else 1626 rc = VERR_VD_NOT_OPENED; 1627 1627 1628 1628 LogFlowFunc(("returns %Rrc\n", rc)); … … 1645 1645 } 1646 1646 else 1647 rc = VERR_VD I_NOT_OPENED;1647 rc = VERR_VD_NOT_OPENED; 1648 1648 1649 1649 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 1672 1672 { 1673 1673 LogFunc(("Version is not supported!\n")); 1674 rc = VERR_VD I_UNSUPPORTED_VERSION;1674 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 1675 1675 } 1676 1676 } 1677 1677 else 1678 rc = VERR_VD I_IMAGE_READ_ONLY;1679 } 1680 else 1681 rc = VERR_VD I_NOT_OPENED;1678 rc = VERR_VD_IMAGE_READ_ONLY; 1679 } 1680 else 1681 rc = VERR_VD_NOT_OPENED; 1682 1682 1683 1683 LogFlowFunc(("returns %Rrc\n", rc)); … … 1700 1700 } 1701 1701 else 1702 rc = VERR_VD I_NOT_OPENED;1702 rc = VERR_VD_NOT_OPENED; 1703 1703 1704 1704 LogFlowFunc(("returns %Rrc (%RTuuid)\n", rc, pUuid)); … … 1724 1724 { 1725 1725 LogFunc(("Version is not supported!\n")); 1726 rc = VERR_VD I_UNSUPPORTED_VERSION;1726 rc = VERR_VD_VDI_UNSUPPORTED_VERSION; 1727 1727 } 1728 1728 } 1729 1729 else 1730 rc = VERR_VD I_IMAGE_READ_ONLY;1731 } 1732 else 1733 rc = VERR_VD I_NOT_OPENED;1730 rc = VERR_VD_IMAGE_READ_ONLY; 1731 } 1732 else 1733 rc = VERR_VD_NOT_OPENED; 1734 1734 1735 1735 LogFlowFunc(("returns %Rrc\n", rc));
Note:
See TracChangeset
for help on using the changeset viewer.