VirtualBox

Changeset 39855 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Jan 24, 2012 4:40:14 PM (13 years ago)
Author:
vboxsync
Message:

Various drivers: Use PDMIBASE_2_PDMDRV instead of cooking your own stuff.

Location:
trunk/src/VBox/Devices/Serial
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r35353 r39855  
    5151/** Converts a pointer to DRVNAMEDPIPE::IMedia to a PDRVNAMEDPIPE. */
    5252#define PDMISTREAM_2_DRVNAMEDPIPE(pInterface) ( (PDRVNAMEDPIPE)((uintptr_t)pInterface - RT_OFFSETOF(DRVNAMEDPIPE, IStream)) )
    53 
    54 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */
    55 #define PDMIBASE_2_DRVINS(pInterface)   ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )
    5653
    5754
     
    286283static DECLCALLBACK(void *) drvNamedPipeQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    287284{
    288     PPDMDRVINS      pDrvIns = PDMIBASE_2_DRVINS(pInterface);
     285    PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    289286    PDRVNAMEDPIPE   pThis   = PDMINS_2_DATA(pDrvIns, PDRVNAMEDPIPE);
    290287    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
  • trunk/src/VBox/Devices/Serial/DrvRawFile.cpp

    r37596 r39855  
    3939#define PDMISTREAM_2_DRVRAWFILE(pInterface) ( (PDRVRAWFILE)((uintptr_t)pInterface - RT_OFFSETOF(DRVRAWFILE, IStream)) )
    4040
    41 /** Converts a pointer to PDMDRVINS::IBase to a PPDMDRVINS. */
    42 #define PDMIBASE_2_DRVINS(pInterface)   ( (PPDMDRVINS)((uintptr_t)pInterface - RT_OFFSETOF(PDMDRVINS, IBase)) )
    43 
    4441
    4542/*******************************************************************************
     
    9895static DECLCALLBACK(void *) drvRawFileQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    9996{
    100     PPDMDRVINS  pDrvIns = PDMIBASE_2_DRVINS(pInterface);
     97    PPDMDRVINS  pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    10198    PDRVRAWFILE pThis   = PDMINS_2_DATA(pDrvIns, PDRVRAWFILE);
    10299
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