VirtualBox

Changeset 53434 in vbox for trunk


Ignore:
Timestamp:
Dec 3, 2014 3:20:59 PM (10 years ago)
Author:
vboxsync
Message:

Additions/common and x11: improve error handling related to mode hint passing.

Location:
trunk/src/VBox/Additions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r53293 r53434  
    23192319            }
    23202320        }
     2321        else
     2322            rc = pInfo->result;
    23212323        if (pcbDataReturned)
    23222324            *pcbDataReturned = sizeof(*pInfo);
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp

    r52308 r53434  
    121121 *
    122122 * @returns VBox status code
     123 * @returns VERR_NOT_SUPPORTED if guest properties are not available on the host.
    123124 * @param   pu32ClientId    Where to put the client id on success. The client id
    124125 *                          must be passed to all the other calls to the service.
     
    139140        if (RT_SUCCESS(rc))
    140141            *pu32ClientId = Info.u32ClientID;
     142        if (rc == VERR_NOT_IMPLEMENTED || rc == VERR_HGCM_SERVICE_NOT_FOUND)
     143            rc = VERR_NOT_SUPPORTED;
    141144    }
    142145    return rc;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r52956 r53434  
    305305 *
    306306 * @returns iprt status value
     307 * @returns VERR_NOT_SUPPORTED if the guest property service is not available.
    307308 * @param   pcScreen   where to store the virtual screen number
    308309 */
     
    343344    return rc;
    344345#else /* !VBOX_WITH_GUEST_PROPS */
    345     return VERR_NOT_IMPLEMENTED;
     346    return VERR_NOT_SUPPORTED;
    346347#endif /* !VBOX_WITH_GUEST_PROPS */
    347348}
     
    404405    return rc;
    405406#else /* !VBOX_WITH_GUEST_PROPS */
    406     return VERR_NOT_IMPLEMENTED;
     407    return VERR_NOT_SUPPORTED;
    407408#endif /* !VBOX_WITH_GUEST_PROPS */
    408409}
     
    488489    return rc;
    489490#else /* !VBOX_WITH_GUEST_PROPS */
    490     return VERR_NOT_IMPLEMENTED;
     491    return VERR_NOT_SUPPORTED;
    491492#endif /* !VBOX_WITH_GUEST_PROPS */
    492493}
  • trunk/src/VBox/Additions/x11/VBoxClient/display.cpp

    r53408 r53434  
    207207    LogRelFlowFunc(("\n"));
    208208    rc = VbglR3VideoModeGetHighestSavedScreen(&cScreens);
    209     if (RT_FAILURE(rc))
     209    if (rc != VINF_SUCCESS && rc != VERR_NOT_SUPPORTED)
    210210        VBClFatalError(("Failed to get the number of saved screen modes, rc=%Rrc\n",
    211211                    rc));
    212     for (i = 0; i < RT_MAX(cScreens + 1, 8); ++i)
    213     {
    214         unsigned cx = 0, cy = 0, cBPP = 0, x = 0, y = 0;
    215         bool fEnabled = true;
    216 
    217         rc = VbglR3RetrieveVideoMode(i, &cx, &cy, &cBPP, &x, &y,
    218                                      &fEnabled);
    219         if (RT_SUCCESS(rc) && i > cScreens) /* Sanity */
    220             VBClFatalError(("Internal error retrieving the number of saved screen modes.\n"));
    221         if (RT_SUCCESS(rc))
    222             setModeX11(pState, cx, cy, cBPP, i, x, y, fEnabled,
    223                        true);
    224     }
     212    if (rc == VINF_SUCCESS)
     213        /* The "8" is to sanity test that VbglR3VideoModeGetHighestSavedScreen()
     214         * worked right. */
     215        for (i = 0; i < RT_MAX(cScreens + 1, 8); ++i)
     216        {
     217            unsigned cx = 0, cy = 0, cBPP = 0, x = 0, y = 0;
     218            bool fEnabled = true;
     219
     220            rc = VbglR3RetrieveVideoMode(i, &cx, &cy, &cBPP, &x, &y,
     221                                         &fEnabled);
     222            /* Sanity test. */
     223            if (   (rc != VINF_SUCCESS && rc != VERR_NOT_FOUND)
     224                || (i > cScreens && rc != VERR_NOT_FOUND))
     225                VBClFatalError(("Internal error retrieving the number of saved screen modes.\n"));
     226            if (rc == VINF_SUCCESS)
     227                setModeX11(pState, cx, cy, cBPP, i, x, y, fEnabled,
     228                           true);
     229        }
    225230    while (true)
    226231    {
     
    261266                                               &fChangeOrigin, true);
    262267            /* Extended display version not supported on host */
    263             if (RT_FAILURE(rc))
     268            if (rc != VINF_SUCCESS)
    264269                VBClFatalError(("Failed to get display change request, rc=%Rrc\n",
    265270                                rc));
    266271            else
    267                 LogRelFlowFunc(("Got extended size hint from host cx=%d, cy=%d, bpp=%d, iDisplay=%d, x=%d, y=%d fEnabled=%d\n",
     272                LogRelFlowFunc(("Got size hint from host cx=%d, cy=%d, bpp=%d, iDisplay=%d, x=%d, y=%d fEnabled=%d\n",
    268273                                cx, cy, cBPP, iDisplay, x, y,
    269274                                fEnabled));
    270             if (RT_FAILURE(rc))
    271                 VBClFatalError(("Failed to retrieve size hint, rc=%Rrc\n", rc));
    272275            if (iDisplay > INT32_MAX)
    273276                VBClFatalError(("Received a size hint for too high display number %u\n",
     
    280283                rc = VbglR3SaveVideoMode(iDisplay, cx, cy, cBPP, x, y,
    281284                                         fEnabled);
    282                 if (   RT_FAILURE(rc)
    283                     && rc != VERR_HGCM_SERVICE_NOT_FOUND
    284                     && rc != VERR_NOT_IMPLEMENTED /* No HGCM */)
     285                if (RT_FAILURE(rc) && rc != VERR_NOT_SUPPORTED)
    285286                    VBClFatalError(("Failed to save size hint, rc=%Rrc\n", rc));
    286287            }
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