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/DevSB16.cpp

    r24265 r25966  
    3636#include <iprt/assert.h>
    3737#include <iprt/string.h>
     38#include <iprt/uuid.h>
    3839#include "../vl_vbox.h"
    3940
     
    188189    PTMTIMER  pTimer;
    189190    PPDMIBASE pDrvBase;
     191    /** LUN\#0: Base interface. */
    190192    PDMIBASE  IBase;
    191193#endif
     
    17701772}
    17711773
     1774/**
     1775 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
     1776 */
    17721777static DECLCALLBACK(void *) sb16QueryInterface (struct PDMIBASE *pInterface,
    1773                                                 PDMINTERFACE enmInterface)
    1774 {
    1775     SB16State *pThis = (SB16State *)((uintptr_t)pInterface
    1776                      - RT_OFFSETOF(SB16State, IBase));
     1778                                                const char *pszIID)
     1779{
     1780    SB16State *pThis = RT_FROM_MEMBER(pInterface, SB16State, IBase);
    17771781    Assert(&pThis->IBase == pInterface);
    1778     switch (enmInterface)
    1779     {
    1780         case PDMINTERFACE_BASE:
    1781             return &pThis->IBase;
    1782         default:
    1783             return NULL;
    1784     }
     1782
     1783    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
     1784        return &pThis->IBase;
     1785    return NULL;
    17851786}
    17861787
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