VirtualBox

Ignore:
Timestamp:
May 12, 2016 7:11:42 PM (9 years ago)
Author:
vboxsync
Message:

DnD/VBoxClient: Exit gracefully if DnD is not available on the host.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r60662 r60967  
    719719int DragInstance::init(uint32_t u32ScreenID)
    720720{
    721     int rc;
     721    int rc = VbglR3DnDConnect(&m_dndCtx);
     722    /* Note: Can return VINF_PERMISSION_DENIED if HGCM host service is not available. */
     723    if (rc != VINF_SUCCESS)
     724        return rc;
    722725
    723726    do
    724727    {
    725         rc = VbglR3DnDConnect(&m_dndCtx);
    726         if (RT_FAILURE(rc))
    727             break;
    728 
    729728        rc = RTSemEventCreate(&m_eventQueueEvent);
    730729        if (RT_FAILURE(rc))
     
    29642963         * another screen number than zero. Maybe in the future it will become
    29652964         * necessary if VBox supports multiple X11 screens. */
    2966         rc = m_pCurDnD->init(0);
    2967         if (RT_FAILURE(rc))
    2968             break;
     2965        rc = m_pCurDnD->init(0 /* uScreenID */);
     2966        /* Note: Can return VINF_PERMISSION_DENIED if HGCM host service is not available. */
     2967        if (rc != VINF_SUCCESS)
     2968        {
     2969            if (RT_FAILURE(rc))
     2970                LogRel(("DnD: Unable to connect to drag and drop service, rc=%Rrc\n", rc));
     2971            else if (rc == VINF_PERMISSION_DENIED)
     2972                LogRel(("DnD: Not available on host, terminating\n"));
     2973            break;
     2974        }
    29692975
    29702976        LogRel(("DnD: Started\n"));
     
    31023108        } while (!ASMAtomicReadBool(&m_fSrvStopping));
    31033109
     3110        LogRel(("DnD: Stopped with rc=%Rrc\n", rc));
     3111
    31043112    } while (0);
    31053113
    3106     LogRel(("DnD: Stopped with rc=%Rrc\n", rc));
    31073114    return rc;
    31083115}
     
    31833190
    31843191    int rc = VbglR3DnDConnect(&dndCtx);
    3185     if (RT_FAILURE(rc))
    3186         LogRel(("DnD: Unable to connect to drag and drop service, rc=%Rrc\n", rc));
    3187     /* Not RT_FAILURE: VINF_PERMISSION_DENIED is host service not present. */
     3192    /* Note: Can return VINF_PERMISSION_DENIED if HGCM host service is not available. */
    31883193    if (rc != VINF_SUCCESS)
    31893194        return rc;
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