vbox/src/VBox/Main/src-client/GuestSessionImpl.cpp
/**
 * Determines the protocol version (sets mData.mProtocolVersion).
 *
 * This is called from the init method prior to to establishing a guest
 * session.
 *
 * @return  IPRT status code.
 */
Determines the protocol version (sets mData.mProtocolVersion).
This is called from the init method prior to to establishing a guest
session.

@return  IPRT status code.
Determines the protocol version ( sets mData . mProtocolVersion ) . This is called from the init method prior to to establishing a guest session . @return IPRT status code .
int GuestSession::i_determineProtocolVersion(void)
{
    ComObjPtr<Guest> pGuest = mParent;
    AssertReturn(!pGuest.isNull(), VERR_NOT_SUPPORTED);
    uint32_t uGaVersion = pGuest->i_getAdditionsVersion();
    mData.mProtocolVersion = 1;
    if (uGaVersion >= VBOX_FULL_VERSION_MAKE(4,3,0))
        mData.mProtocolVersion = 2; 
    LogFlowThisFunc(("uGaVersion=%u.%u.%u => mProtocolVersion=%u\n",
                     VBOX_FULL_VERSION_GET_MAJOR(uGaVersion), VBOX_FULL_VERSION_GET_MINOR(uGaVersion),
                     VBOX_FULL_VERSION_GET_BUILD(uGaVersion), mData.mProtocolVersion));
    if (mData.mProtocolVersion < 2)
        LogRelMax(3, (tr("Warning: Guest Additions v%u.%u.%u only supports the older guest control protocol version %u.\n"
                         "         Please upgrade GAs to the current version to get full guest control capabilities.\n"),
                      VBOX_FULL_VERSION_GET_MAJOR(uGaVersion), VBOX_FULL_VERSION_GET_MINOR(uGaVersion),
                      VBOX_FULL_VERSION_GET_BUILD(uGaVersion), mData.mProtocolVersion));
    return VINF_SUCCESS;
}
int GuestSession :: i_determineProtocolVersion ( void ) { ComObjPtr < Guest > pGuest = mParent ; AssertReturn ( ! pGuest . isNull ( ) , VERR_NOT_SUPPORTED ) ; uint32_t uGaVersion = pGuest -> i_getAdditionsVersion ( ) ; mData . mProtocolVersion = 1 ; if ( uGaVersion >= VBOX_FULL_VERSION_MAKE ( 4 , 3 , 0 ) ) mData . mProtocolVersion = 2 ; LogFlowThisFunc ( ( " \n " , VBOX_FULL_VERSION_GET_MAJOR ( uGaVersion ) , VBOX_FULL_VERSION_GET_MINOR ( uGaVersion ) , VBOX_FULL_VERSION_GET_BUILD ( uGaVersion ) , mData . mProtocolVersion ) ) ; if ( mData . mProtocolVersion < 2 ) LogRelMax ( 3 , ( tr ( " \n " " \n " ) , VBOX_FULL_VERSION_GET_MAJOR ( uGaVersion ) , VBOX_FULL_VERSION_GET_MINOR ( uGaVersion ) , VBOX_FULL_VERSION_GET_BUILD ( uGaVersion ) , mData . mProtocolVersion ) ) ; return VINF_SUCCESS ; }
Determines the protocol version (sets mData.mProtocolVersion).
Determines the protocol version ( sets mData . mProtocolVersion ) .
/*
     * We currently do this based on the reported guest additions version,
     * ASSUMING that VBoxService and VBoxDrv are at the same version.
     */ /* Everyone supports version one, if they support anything at all. */ /* Guest control 2.0 was introduced with 4.3.0. */ /* Guest control 2.0. */ /*
     * Inform the user about outdated guest additions (VM release log).
     */