VirtualBox

Changeset 25984 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 23, 2010 12:19:47 AM (15 years ago)
Author:
vboxsync
Message:

pdmifs.h: the penultimate batch of refactored interface ID code.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AudioSnifferInterface.cpp

    r25966 r25984  
    126126    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    127127        return &pDrvIns->IBase;
    128     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR) == 0)
    129         return &pDrv->Connector;
     128    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIAUDIOSNIFFERCONNECTOR, &pDrv->Connector);
    130129    return NULL;
    131130}
     
    181180     * Get the Audio Sniffer Port interface of the above driver/device.
    182181     */
    183     pThis->pUpPort = (PPDMIAUDIOSNIFFERPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_AUDIO_SNIFFER_PORT);
     182    pThis->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIAUDIOSNIFFERPORT);
    184183    if (!pThis->pUpPort)
    185184    {
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r25981 r25984  
    17871787        Assert(pBase);
    17881788
    1789         PPDMIACPIPORT pPort =
    1790             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     1789        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    17911790
    17921791        vrc = getVMMDev()->getVMMDevPort()->pfnCpuHotUnplug(getVMMDev()->getVMMDevPort(), idCpuCore, idCpuPackage);
     
    20832082    {
    20842083        Assert(pBase);
    2085         PPDMIACPIPORT pPort =
    2086             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2084        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    20872085        vrc = pPort ? pPort->pfnPowerButtonPress(pPort) : VERR_INVALID_POINTER;
    20882086    }
     
    21282126    {
    21292127        Assert(pBase);
    2130         PPDMIACPIPORT pPort =
    2131             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2128        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    21322129        vrc = pPort ? pPort->pfnGetPowerButtonHandled(pPort, &handled) : VERR_INVALID_POINTER;
    21332130    }
     
    21752172    {
    21762173        Assert(pBase);
    2177         PPDMIACPIPORT pPort =
    2178             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2174        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    21792175        vrc = pPort ? pPort->pfnGetGuestEnteredACPIMode(pPort, &entered) : VERR_INVALID_POINTER;
    21802176    }
     
    22092205    {
    22102206        Assert(pBase);
    2211         PPDMIACPIPORT pPort =
    2212             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2207        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    22132208        vrc = pPort ? pPort->pfnSleepButtonPress(pPort) : VERR_INVALID_POINTER;
    22142209    }
     
    81378132    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    81388133        return &pDrvIns->IBase;
    8139     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_CONNECTORS) == 0)
    8140         return &pThis->ILedConnectors;
     8134    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDCONNECTORS, &pThis->ILedConnectors);
    81418135    return NULL;
    81428136}
     
    82248218     * query the LEDs we want.
    82258219     */
    8226     pData->pLedPorts = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
    8227     if (!pData->pLedPorts)
    8228     {
    8229         AssertMsgFailed(("Configuration error: No led ports interface above!\n"));
    8230         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    8231     }
     8220    pData->pLedPorts = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
     8221    AssertMsgReturn(pData->pLedPorts, ("Configuration error: No led ports interface above!\n"),
     8222                    VERR_PDM_MISSING_INTERFACE_ABOVE);
    82328223
    82338224    for (unsigned i = pData->iFirstLUN; i <= pData->iLastLUN; ++i)
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r25973 r25984  
    661661    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    662662        return &pDrvIns->IBase;
    663     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_VMMDEV_CONNECTOR) == 0)
    664         return &pDrv->Connector;
    665 #ifdef VBOX_WITH_HGCM
    666     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HGCM_CONNECTOR) == 0)
    667         return &pDrv->HGCMConnector;
     663    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIVMMDEVCONNECTOR, &pDrv->Connector);
     664#ifdef VBOX_WITH_HGCM
     665    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHGCMCONNECTOR, &pDrv->HGCMConnector);
    668666#endif
    669667    return NULL;
     
    751749     * Get the IVMMDevPort interface of the above driver/device.
    752750     */
    753     pData->pUpPort = (PPDMIVMMDEVPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_VMMDEV_PORT);
    754     if (!pData->pUpPort)
    755     {
    756         AssertMsgFailed(("Configuration error: No VMMDev port interface above!\n"));
    757         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    758     }
    759 
    760 #ifdef VBOX_WITH_HGCM
    761     pData->pHGCMPort = (PPDMIHGCMPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_HGCM_PORT);
    762     if (!pData->pHGCMPort)
    763     {
    764         AssertMsgFailed(("Configuration error: No HGCM port interface above!\n"));
    765         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    766     }
     751    pData->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIVMMDEVPORT);
     752    AssertMsgReturn(pData->pUpPort, ("Configuration error: No VMMDev port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
     753
     754#ifdef VBOX_WITH_HGCM
     755    pData->pHGCMPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIHGCMPORT);
     756    AssertMsgReturn(pData->pHGCMPort, ("Configuration error: No HGCM port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    767757#endif
    768758
     
    791781
    792782        LogRel(("Shared Folders service loaded.\n"));
    793         pLedPort = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
    794         if (!pLedPort)
    795         {
    796             AssertMsgFailed(("Configuration error: No LED port interface above!\n"));
    797             return VERR_PDM_MISSING_INTERFACE_ABOVE;
    798         }
     783        pLedPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
     784        AssertMsgReturn(pLedPort, ("Configuration error: No LED port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    799785        rc = pLedPort->pfnQueryStatusLed(pLedPort, 0, &pLed);
    800786        if (RT_SUCCESS(rc) && pLed)
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