VirtualBox

Ignore:
Timestamp:
Mar 11, 2022 6:24:17 PM (3 years ago)
Author:
vboxsync
Message:

Main: Guest Properties: notify lesteners that property was deleted (additional fixes in r150441, r150442, r150443, r150445), bugref:10185.

File:
1 edited

Legend:

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

    r93453 r94184  
    937937 * @param   pcbBufActual    If @a pcBuf is not large enough, the size needed.
    938938 *                          Optional.
     939 * @param   pfWasDeleted    A flag which indicates that property was deleted.
     940 *                          Optional.
    939941 */
    940942VBGLR3DECL(int) VbglR3GuestPropWait(HGCMCLIENTID idClient,
     
    944946                                    char ** ppszName, char **ppszValue,
    945947                                    uint64_t *pu64Timestamp, char **ppszFlags,
    946                                     uint32_t *pcbBufActual)
     948                                    uint32_t *pcbBufActual, bool *pfWasDeleted)
    947949{
    948950    /*
     
    973975
    974976    /*
    975      * Buffer layout: Name\0Value\0Flags\0.
     977     * Buffer layout: Name\0Value\0Flags\0fWasDeleted\0.
    976978     *
    977979     * If the caller cares about any of these strings, make sure things are
     
    979981     */
    980982    if (    RT_SUCCESS(rc)
    981         &&  (ppszName != NULL || ppszValue != NULL || ppszFlags != NULL))
     983        &&  (ppszName != NULL || ppszValue != NULL || ppszFlags != NULL || pfWasDeleted != NULL))
    982984    {
    983985        /* Validate / skip 'Name'. */
     
    994996
    995997        if (ppszFlags)
     998            *ppszFlags = pszFlags;
     999
     1000        /* Validate / skip 'Flags'. */
     1001        char *pszWasDeleted = RTStrEnd(pszFlags, cbBuf - (pszFlags - (char *)pvBuf)) + 1;
     1002        AssertPtrReturn(pszWasDeleted, VERR_TOO_MUCH_DATA);
     1003        if (pfWasDeleted)
    9961004        {
    997             /* Validate 'Flags'. */
    998             char *pszEos = RTStrEnd(pszFlags, cbBuf - (pszFlags - (char *)pvBuf));
    999             AssertPtrReturn(pszEos, VERR_TOO_MUCH_DATA);
    1000             *ppszFlags = pszFlags;
     1005            AssertReturn(pszWasDeleted[0] == '0' || pszWasDeleted[0] == '1', VERR_PARSE_ERROR);
     1006            *pfWasDeleted = pszWasDeleted[0] == '0' ? false : true;
    10011007        }
     1008
     1009        /* Validate end of buffer string. */
     1010        char *pszEos = RTStrEnd(pszWasDeleted, cbBuf - (pszWasDeleted - (char *)pvBuf));
     1011        AssertPtrReturn(pszEos, VERR_TOO_MUCH_DATA);
    10021012    }
    10031013
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