VirtualBox

Changeset 10017 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jun 30, 2008 2:06:54 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32491
Message:

HostServices/SharedInfoService and Additions/common: deal with overflow and missing keys better when querying guest properties

File:
1 edited

Legend:

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

    r10006 r10017  
    154154        rc = Msg.hdr.result;
    155155    uint32_t cbActual;
    156     if (RT_SUCCESS(rc))
    157         rc = VbglHGCMParmUInt32Get(&Msg.size, &cbActual);
    158     if (RT_SUCCESS(rc))
     156    if (RT_SUCCESS(rc) || (VERR_BUFFER_OVERFLOW == rc))
    159157    {
    160         if (pcbActual != NULL)
    161             *pcbActual = cbActual;
    162         if (cbActual > cbValue)
    163             rc = VINF_BUFFER_OVERFLOW;
     158        int rc2 = VbglHGCMParmUInt32Get(&Msg.size, &cbActual);
     159        if (RT_SUCCESS(rc2))
     160        {
     161            if (pcbActual != NULL)
     162                *pcbActual = cbActual;
     163        }
    164164        else
    165             rc = Msg.hdr.result;
    166         if ((cbValue > 0) && (0 == cbActual))  /* No such property */
    167             pszValue[0] = 0;
     165            rc = rc2;
    168166    }
    169167    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