VirtualBox

Changeset 29532 in vbox for trunk


Ignore:
Timestamp:
May 17, 2010 11:39:06 AM (15 years ago)
Author:
vboxsync
Message:

VBox/err.h,Main/Global.cpp: Updated COM<->VBox status code conversion.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r29345 r29532  
    14831483
    14841484
    1485 /** @name VBox Webservice Status Codes
    1486  * @{
    1487  */
    1488 /** Object not found. */
    1489 #define VERR_COM_OBJECT_NOT_FOUND                  (-4601)
    1490 /** Invalid machine state. */
    1491 #define VERR_COM_INVALID_VM_STATE                  (-4602)
    1492 /** VM error. */
    1493 #define VERR_COM_VM_ERROR                          (-4603)
    1494 /** File error. */
    1495 #define VERR_COM_FILE_ERROR                        (-4604)
     1485/** @name VBox COM error codes
     1486 * @remarks There
     1487 * @{  */
     1488/** Unexpected turn of events. */
     1489#define VERR_COM_UNEXPECTED                         (-4600)
     1490/** The base of the VirtualBox COM status codes (the lower value)
     1491 * corresponding 1:1 to VBOX_E_XXX.  This is the lowest value. */
     1492#define VERR_COM_VBOX_LOWEST                        (-4699)
     1493/** Object corresponding to the supplied arguments does not exist. */
     1494#define VERR_COM_OBJECT_NOT_FOUND                   (VERR_COM_VBOX_LOWEST + 1)
     1495/** Current virtual machine state prevents the operation. */
     1496#define VERR_COM_INVALID_VM_STATE                   (VERR_COM_VBOX_LOWEST + 2)
     1497/** Virtual machine error occurred attempting the operation. */
     1498#define VERR_COM_VM_ERROR                           (VERR_COM_VBOX_LOWEST + 3)
     1499/** File not accessible or erroneous file contents. */
     1500#define VERR_COM_FILE_ERROR                         (VERR_COM_VBOX_LOWEST + 4)
    14961501/** IPRT error. */
    1497 #define VERR_COM_IPRT_ERROR                        (-4605)
    1498 /** PDM error. */
    1499 #define VERR_COM_PDM_ERROR                         (-4606)
    1500 /** Invalid object state. */
    1501 #define VERR_COM_INVALID_OBJECT_STATE              (-4607)
    1502 /** Host error. */
    1503 #define VERR_COM_HOST_ERROR                        (-4608)
    1504 /** Not supported. */
    1505 #define VERR_COM_NOT_SUPPORTED                     (-4609)
    1506 /** XML error. */
    1507 #define VERR_COM_XML_ERROR                         (-4610)
    1508 /** Invalid session state. */
    1509 #define VERR_COM_INVALID_SESSION_STATE             (-4611)
    1510 /** Invalid session state. */
    1511 #define VERR_COM_OBJECT_IN_USE                     (-4612)
     1502#define VERR_COM_IPRT_ERROR                         (VERR_COM_VBOX_LOWEST + 5)
     1503/** Pluggable Device Manager error. */
     1504#define VERR_COM_PDM_ERROR                          (VERR_COM_VBOX_LOWEST + 6)
     1505/** Current object state prohibits operation. */
     1506#define VERR_COM_INVALID_OBJECT_STATE               (VERR_COM_VBOX_LOWEST + 7)
     1507/** Host operating system related error. */
     1508#define VERR_COM_HOST_ERROR                         (VERR_COM_VBOX_LOWEST + 8)
     1509/** Requested operation is not supported. */
     1510#define VERR_COM_NOT_SUPPORTED                      (VERR_COM_VBOX_LOWEST + 9)
     1511/** Invalid XML found. */
     1512#define VERR_COM_XML_ERROR                          (VERR_COM_VBOX_LOWEST + 10)
     1513/** Current session state prohibits operation. */
     1514#define VERR_COM_INVALID_SESSION_STATE              (VERR_COM_VBOX_LOWEST + 11)
     1515/** Object being in use prohibits operation. */
     1516#define VERR_COM_OBJECT_IN_USE                      (VERR_COM_VBOX_LOWEST + 12)
     1517/** Returned by callback methods which does not need to be called
     1518 * again because the client does not actually make use of them. */
     1519#define VERR_COM_DONT_CALL_AGAIN                    (VERR_COM_VBOX_LOWEST + 13)
    15121520/** @} */
    15131521
  • trunk/src/VBox/Main/Global.cpp

    r29184 r29532  
    406406    {
    407407        case S_OK:                              return VINF_SUCCESS;
     408
     409        /* Standard COM status codes. See also RTErrConvertFromDarwinCOM */
     410        case E_UNEXPECTED:                      return VERR_COM_UNEXPECTED;
     411        case E_NOTIMPL:                         return VERR_NOT_IMPLEMENTED;
     412        case E_OUTOFMEMORY:                     return VERR_NO_MEMORY;
     413        case E_INVALIDARG:                      return VERR_INVALID_PARAMETER;
     414        case E_NOINTERFACE:                     return VERR_NOT_SUPPORTED;
     415        case E_POINTER:                         return VERR_INVALID_POINTER;
     416#ifdef E_HANDLE
     417        case E_HANDLE:                          return VERR_INVALID_HANDLE;
     418#endif
     419        case E_ABORT:                           return VERR_CANCELLED;
    408420        case E_FAIL:                            return VERR_GENERAL_FAILURE;
    409         case E_INVALIDARG:                      return VERR_INVALID_PARAMETER;
    410         case E_POINTER:                         return VERR_INVALID_POINTER;
    411 
     421        case E_ACCESSDENIED:                    return VERR_ACCESS_DENIED;
     422
     423        /* VirtualBox status codes */
    412424        case VBOX_E_OBJECT_NOT_FOUND:           return VERR_COM_OBJECT_NOT_FOUND;
    413425        case VBOX_E_INVALID_VM_STATE:           return VERR_COM_INVALID_VM_STATE;
     
    422434        case VBOX_E_INVALID_SESSION_STATE:      return VERR_COM_INVALID_SESSION_STATE;
    423435        case VBOX_E_OBJECT_IN_USE:              return VERR_COM_OBJECT_IN_USE;
     436        case VBOX_E_DONT_CALL_AGAIN:            return VERR_COM_DONT_CALL_AGAIN;
    424437
    425438        default:
    426439            if (SUCCEEDED(aComStatus))
    427440                return VINF_SUCCESS;
     441            /** @todo Check for the win32 facility and use the
     442             *        RTErrConvertFromWin32 function on windows. */
    428443            return VERR_UNRESOLVED_ERROR;
    429444    }
     
    437452    {
    438453        case VINF_SUCCESS:                      return S_OK;
     454
     455        /* Standard COM status codes. */
     456        case VERR_COM_UNEXPECTED:               return E_UNEXPECTED;
     457        case VERR_NOT_IMPLEMENTED:              return E_NOTIMPL;
     458        case VERR_NO_MEMORY:                    return E_OUTOFMEMORY;
     459        case VERR_INVALID_PARAMETER:            return E_INVALIDARG;
     460        case VERR_NOT_SUPPORTED:                return E_NOINTERFACE;
     461        case VERR_INVALID_POINTER:              return E_POINTER;
     462#ifdef E_HANDLE
     463        case VERR_INVALID_HANDLE:               return E_HANDLE;
     464#endif
     465        case VERR_CANCELLED:                    return E_ABORT;
    439466        case VERR_GENERAL_FAILURE:              return E_FAIL;
    440         case VERR_UNRESOLVED_ERROR:             return E_FAIL;
    441         case VERR_INVALID_PARAMETER:            return E_INVALIDARG;
    442         case VERR_INVALID_POINTER:              return E_POINTER;
    443 
     467        case VERR_ACCESS_DENIED:                return E_ACCESSDENIED;
     468
     469        /* VirtualBox COM status codes */
    444470        case VERR_COM_OBJECT_NOT_FOUND:         return VBOX_E_OBJECT_NOT_FOUND;
    445471        case VERR_COM_INVALID_VM_STATE:         return VBOX_E_INVALID_VM_STATE;
     
    454480        case VERR_COM_INVALID_SESSION_STATE:    return VBOX_E_INVALID_SESSION_STATE;
    455481        case VERR_COM_OBJECT_IN_USE:            return VBOX_E_OBJECT_IN_USE;
     482        case VERR_COM_DONT_CALL_AGAIN:          return VBOX_E_DONT_CALL_AGAIN;
     483
     484        /* Other errors. */
     485        case VERR_UNRESOLVED_ERROR:             return E_FAIL;
    456486
    457487        default:
Note: See TracChangeset for help on using the changeset viewer.

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