VirtualBox

Changeset 37924 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 13, 2011 3:21:10 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72833
Message:

Main/StorageController: better error message for checkPortAndDeviceValid()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r35638 r37924  
    476476        {
    477477            /* AHCI SATA supports a maximum of 30 ports. */
    478             if ((aPortCount < 1) || (aPortCount > 30))
     478            if (aPortCount < 1 || aPortCount > 30)
    479479                return setError(E_INVALIDARG,
    480480                                tr("Invalid port count: %lu (must be in range [%lu, %lu])"),
     
    692692                        tr("Invalid controller type"));
    693693
    694     if ((aPortNumber < 0) || (aPortNumber >= 30))
     694    if (aPortNumber < 0 || aPortNumber >= 30)
    695695        return setError(E_INVALIDARG,
    696                         tr("Invalid port number: %l (must be in range [%lu, %lu])"),
     696                        tr("Invalid port number: %ld (must be in range [%lu, %lu])"),
    697697                        aPortNumber, 0, 29);
    698698
     
    764764    if (FAILED(rc)) return rc;
    765765
    766     if (   (aControllerPort < 0)
    767         || (aControllerPort >= (LONG)portCount)
    768         || (aDevice < 0)
    769         || (aDevice >= (LONG)devicesPerPort)
     766    if (   aControllerPort < 0
     767        || aControllerPort >= (LONG)portCount
     768        || aDevice < 0
     769        || aDevice >= (LONG)devicesPerPort
    770770       )
    771771        return setError(E_INVALIDARG,
    772                         tr("The port and/or count parameter are out of range [%lu:%lu]"),
    773                         portCount,
    774                         devicesPerPort);
     772                        tr("The port and/or device parameter are out of range: port=%d (must be in range [0, %u]), device=%u (must be in range [0, %u])"),
     773                        (int)aControllerPort, (int)portCount-1, (int)aDevice, (int)devicesPerPort-1);
    775774
    776775    return S_OK;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette