VirtualBox

Ignore:
Timestamp:
Jan 22, 2010 11:15:43 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56818
Message:

PDMIBASE refactoring; use UUID as interface IDs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r25770 r25966  
    206206    /** Pointer to the attached audio driver. */
    207207    PPDMIBASE               pDrvBase;
    208     /** The base interface. */
     208    /** The base interface for LUN\#0. */
    209209    PDMIBASE                IBase;
    210210    /** Base port of the I/O space region. */
     
    15381538
    15391539/**
    1540  * Queries an interface to the driver.
    1541  *
    1542  * @returns Pointer to interface.
    1543  * @returns NULL if the interface was not supported by the driver.
    1544  * @param   pInterface          Pointer to this interface structure.
    1545  * @param   enmInterface        The requested interface identification.
    1546  * @thread  Any thread.
     1540 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    15471541 */
    15481542static DECLCALLBACK(void *) ichac97QueryInterface (struct PDMIBASE *pInterface,
    1549                                                    PDMINTERFACE enmInterface)
    1550 {
    1551     PCIAC97LinkState *pThis =
    1552         (PCIAC97LinkState *)((uintptr_t)pInterface
    1553                              - RT_OFFSETOF(PCIAC97LinkState, ac97.IBase));
     1543                                                   const char *pszIID)
     1544{
     1545    PCIAC97LinkState *pThis = RT_FROM_MEMBER(pInterface, PCIAC97LinkState, ac97.IBase);
    15541546    Assert(&pThis->ac97.IBase == pInterface);
    1555     switch (enmInterface)
    1556     {
    1557         case PDMINTERFACE_BASE:
    1558             return &pThis->ac97.IBase;
    1559         default:
    1560             return NULL;
    1561     }
     1547
     1548    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
     1549        return &pThis->ac97.IBase;
     1550    return NULL;
    15621551}
    15631552
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette