VirtualBox

Changeset 89232 in vbox for trunk/include


Ignore:
Timestamp:
May 23, 2021 1:02:56 PM (4 years ago)
Author:
vboxsync
Message:

Audio: Need to copy PDMAUDIOHOSTDEV::pszId in PDMAudioHostDevDup. bugref:9890

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudiohostenuminline.h

    r89229 r89232  
    9494        pDev->cbSelf = 0;
    9595
     96        if (pDev->fFlags & PDMAUDIOHOSTDEV_F_ID_ALLOC)
     97        {
     98            RTStrFree(pDev->pszId);
     99            pDev->pszId = NULL;
     100        }
     101
    96102        RTMemFree(pDev);
    97103    }
     
    120126        RTListInit(&pDevDup->ListEntry);
    121127        pDevDup->cbSelf = cbToDup;
     128        if (pDev->pszId)
     129        {
     130            pDevDup->fFlags |= PDMAUDIOHOSTDEV_F_ID_ALLOC;
     131            pDevDup->pszId   = RTStrDup(pDev->pszId);
     132            AssertReturnStmt(pDevDup->pszId, RTMemFree(pDevDup), NULL);
     133        }
    122134    }
    123135
     
    322334/** The max string length for all PDMAUDIOHOSTDEV_F_XXX.
    323335 * @sa PDMAudioHostDevFlagsToString */
    324 #define PDMAUDIOHOSTDEV_MAX_FLAGS_STRING_LEN    sizeof("DEFAULT_OUT DEFAULT_IN HOTPLUG BUGGY IGNORE LOCKED DEAD NO_DUP ")
     336#define PDMAUDIOHOSTDEV_MAX_FLAGS_STRING_LEN sizeof("DEFAULT_OUT DEFAULT_IN HOTPLUG BUGGY IGNORE LOCKED DEAD ID_ALLOC NO_DUP ")
    325337
    326338/**
     
    339351        { RT_STR_TUPLE("DEFAULT_OUT "), PDMAUDIOHOSTDEV_F_DEFAULT_OUT },
    340352        { RT_STR_TUPLE("DEFAULT_IN "),  PDMAUDIOHOSTDEV_F_DEFAULT_IN },
    341         { RT_STR_TUPLE("HOTPLUG "), PDMAUDIOHOSTDEV_F_HOTPLUG },
    342         { RT_STR_TUPLE("BUGGY "),   PDMAUDIOHOSTDEV_F_BUGGY   },
    343         { RT_STR_TUPLE("IGNORE "),  PDMAUDIOHOSTDEV_F_IGNORE  },
    344         { RT_STR_TUPLE("LOCKED "),  PDMAUDIOHOSTDEV_F_LOCKED  },
    345         { RT_STR_TUPLE("DEAD "),    PDMAUDIOHOSTDEV_F_DEAD    },
    346         { RT_STR_TUPLE("NO_DUP "),  PDMAUDIOHOSTDEV_F_NO_DUP  },
     353        { RT_STR_TUPLE("HOTPLUG "),     PDMAUDIOHOSTDEV_F_HOTPLUG },
     354        { RT_STR_TUPLE("BUGGY "),       PDMAUDIOHOSTDEV_F_BUGGY   },
     355        { RT_STR_TUPLE("IGNORE "),      PDMAUDIOHOSTDEV_F_IGNORE  },
     356        { RT_STR_TUPLE("LOCKED "),      PDMAUDIOHOSTDEV_F_LOCKED  },
     357        { RT_STR_TUPLE("DEAD "),        PDMAUDIOHOSTDEV_F_DEAD    },
     358        { RT_STR_TUPLE("ID_ALLOC "),    PDMAUDIOHOSTDEV_F_ID_ALLOC  },
     359        { RT_STR_TUPLE("NO_DUP "),      PDMAUDIOHOSTDEV_F_NO_DUP  },
    347360    };
    348361    size_t offDst = 0;
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r89229 r89232  
    327327/** The device is present but not in an alive state (dead). */
    328328#define PDMAUDIOHOSTDEV_F_DEAD              RT_BIT_32(6)
     329/** Set if the PDMAUDIOHOSTDEV::pszId is allocated. */
     330#define PDMAUDIOHOSTDEV_F_ID_ALLOC          RT_BIT_32(30)
    329331/** Set if the extra backend specific data cannot be duplicated. */
    330332#define PDMAUDIOHOSTDEV_F_NO_DUP            RT_BIT_32(31)
     
    377379    uint8_t             cMaxOutputChannels;
    378380    uint8_t             abAlignment[ARCH_BITS == 32 ? 2 + 12 : 2];
    379     /** Device identifier, OS specific, can be NULL.  It it isn't, it'll point to
    380      *  the non-public part (or into szName if creative). */
    381     const char         *pszId;
     381    /** Device identifier, OS specific, can be NULL.
     382     * This can either point into some non-public part of this structure or to a
     383     * RTStrAlloc allocation.  PDMAUDIOHOSTDEV_F_ID_ALLOC is set in the latter
     384     * case. */
     385    char               *pszId;
    382386    /** Friendly name of the device, if any. Could be truncated. */
    383387    char                szName[64];
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