VirtualBox

Changeset 55193 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 10, 2015 8:15:18 PM (10 years ago)
Author:
vboxsync
Message:

Additions/common/VBoxVideo: make invalid or unknown-to-the-host QueryConf requests easier to detect.

File:
1 edited

Legend:

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

    r55191 r55193  
    466466
    467467
     468/** Sanity test on first call.  We do not worry about concurrency issues. */
     469static int testQueryConf(PHGSMIGUESTCOMMANDCONTEXT pCtx)
     470{
     471    static bool cOnce = false;
     472    uint32_t ulValue = 0;
     473    int rc;
     474
     475    if (cOnce)
     476        return VINF_SUCCESS;
     477    cOnce = true;
     478    rc = VBoxQueryConfHGSMI(pCtx, UINT32_MAX, &ulValue);
     479    if (RT_SUCCESS(rc) && ulValue == UINT32_MAX)
     480        return VINF_SUCCESS;
     481    cOnce = false;
     482    if (RT_FAILURE(rc))
     483        return rc;
     484    return VERR_INTERNAL_ERROR;
     485}
     486
     487
    468488/**
    469489 * Query the host for an HGSMI configuration parameter via an HGSMI command.
     
    481501    LogFunc(("u32Index = %d\n", u32Index));
    482502
     503    rc = testQueryConf(pCtx);
     504    if (RT_FAILURE(rc))
     505        return rc;
    483506    /* Allocate the IO buffer. */
    484507    p = (VBVACONF32 *)VBoxHGSMIBufferAlloc(pCtx,
     
    489512        /* Prepare data to be sent to the host. */
    490513        p->u32Index = u32Index;
    491         p->u32Value = 0;
     514        p->u32Value = UINT32_MAX;
    492515        rc = VBoxHGSMIBufferSubmit(pCtx, p);
    493516        if (RT_SUCCESS(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