VirtualBox

Changeset 25981 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jan 22, 2010 6:42:01 PM (15 years ago)
Author:
vboxsync
Message:

pdmifs.h: yet another batch of refactored interface ID code.

Location:
trunk/src/VBox/Devices/Network
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r25966 r25981  
    44694469    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    44704470        return &pThis->IBase;
    4471     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0)
    4472         return &pThis->INetworkPort;
    4473     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONFIG) == 0)
    4474         return &pThis->INetworkConfig;
     4471    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
     4472    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    44754473    if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    44764474        return &pThis->ILeds;
     
    50735071                                       N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
    50745072        }
    5075         pState->pDrv = (PPDMINETWORKCONNECTOR)
    5076             pState->pDrvBase->pfnQueryInterface(pState->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     5073        pState->pDrv = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKCONNECTOR);
    50775074        if (!pState->pDrv)
    50785075        {
     
    52915288#endif
    52925289        }
    5293         pState->pDrv = (PPDMINETWORKCONNECTOR)pState->pDrvBase->pfnQueryInterface(pState->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     5290        pState->pDrv = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKCONNECTOR);
    52945291        if (!pState->pDrv)
    52955292        {
  • trunk/src/VBox/Devices/Network/DevINIP.cpp

    r25966 r25981  
    399399    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    400400        return &pThis->IBase;
    401     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0)
    402         return &pThis->INetworkPort;
     401    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
    403402    return NULL;
    404403}
     
    530529    else
    531530    {
    532         pThis->pDrv = (PPDMINETWORKCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     531        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONNECTOR);
    533532        if (!pThis->pDrv)
    534533        {
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r25966 r25981  
    44894489    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    44904490        return &pThis->IBase;
    4491     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0)
    4492         return &pThis->INetworkPort;
    4493     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONFIG) == 0)
    4494         return &pThis->INetworkConfig;
     4491    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
     4492    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    44954493    if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    44964494        return &pThis->ILeds;
     
    48244822#endif
    48254823        }
    4826         pThis->pDrv = (PPDMINETWORKCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     4824        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONNECTOR);
    48274825        if (!pThis->pDrv)
    48284826        {
     
    52175215#endif
    52185216        }
    5219         pThis->pDrv = (PPDMINETWORKCONNECTOR)
    5220             pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     5217        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONNECTOR);
    52215218        if (!pThis->pDrv)
    52225219        {
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r25966 r25981  
    588588    Assert(&pThis->VPCI.IBase == pInterface);
    589589
    590     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0)
    591         return &pThis->INetworkPort;
    592     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONFIG) == 0)
    593         return &pThis->INetworkConfig;
     590    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
     591    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    594592    return vpciQueryInterface(pInterface, pszIID);
    595593}
     
    15641562                                       N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
    15651563        }
    1566         pState->pDrv = (PPDMINETWORKCONNECTOR)
    1567             pState->pDrvBase->pfnQueryInterface(pState->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     1564        pState->pDrv = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKCONNECTOR);
    15681565        if (!pState->pDrv)
    15691566        {
     
    17461743#endif
    17471744        }
    1748         pState->pDrv = (PPDMINETWORKCONNECTOR)pState->pDrvBase->pfnQueryInterface(pState->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR);
     1745        pState->pDrv = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKCONNECTOR);
    17491746        if (!pState->pDrv)
    17501747        {
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r25966 r25981  
    588588    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    589589        return &pDrvIns->IBase;
    590     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONNECTOR) == 0)
    591         return &pThis->INetworkConnector;
     590    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONNECTOR, &pThis->INetworkConnector);
    592591    return NULL;
    593592}
     
    820819     * Query the network port interface.
    821820     */
    822     pThis->pPort = (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_PORT);
     821    pThis->pPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKPORT);
    823822    if (!pThis->pPort)
    824823    {
     
    826825        return VERR_PDM_MISSING_INTERFACE_ABOVE;
    827826    }
    828     pThis->pConfigIf = (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_CONFIG);
     827    pThis->pConfigIf = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKCONFIG);
    829828
    830829    /*
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r25966 r25981  
    815815    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    816816        return &pDrvIns->IBase;
    817     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONNECTOR) == 0)
    818         return &pThis->INetworkConnector;
     817    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONNECTOR, &pThis->INetworkConnector);
    819818    return NULL;
    820819}
     
    10261025     * Query the network port interface.
    10271026     */
    1028     pThis->pPort =
    1029                 (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase,
    1030                                                                       PDMINTERFACE_NETWORK_PORT);
     1027    pThis->pPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKPORT);
    10311028    if (!pThis->pPort)
    10321029        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE,
    10331030                                N_("Configuration error: the above device/driver didn't "
    10341031                                "export the network port interface"));
    1035     pThis->pConfig = (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase,
    1036                                                                              PDMINTERFACE_NETWORK_CONFIG);
     1032    pThis->pConfig = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKCONFIG);
    10371033    if (!pThis->pConfig)
    10381034        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE,
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r25966 r25981  
    260260    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    261261        return &pDrvIns->IBase;
    262     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONNECTOR) == 0)
    263         return &pThis->INetworkConnector;
    264     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0)
    265         return &pThis->INetworkPort;
    266     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONFIG) == 0)
    267         return &pThis->INetworkConfig;
     262    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONNECTOR, &pThis->INetworkConnector);
     263    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
     264    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    268265    return NULL;
    269266}
     
    308305    else if (RT_SUCCESS(rc))
    309306    {
    310         pThis->pConnector = (PPDMINETWORKCONNECTOR)pBaseDown->pfnQueryInterface(pBaseDown, PDMINTERFACE_NETWORK_CONNECTOR);
     307        pThis->pConnector = PDMIBASE_QUERY_INTERFACE(pBaseDown, PDMINETWORKCONNECTOR);
    311308        if (!pThis->pConnector)
    312309        {
     
    409406     * Query the network port interface.
    410407     */
    411     pThis->pPort = (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_PORT);
     408    pThis->pPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKPORT);
    412409    if (!pThis->pPort)
    413410    {
     
    419416     * Query the network config interface.
    420417     */
    421     pThis->pConfig = (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_CONFIG);
     418    pThis->pConfig = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKCONFIG);
    422419    if (!pThis->pConfig)
    423420    {
     
    435432    else if (RT_SUCCESS(rc))
    436433    {
    437         pThis->pConnector = (PPDMINETWORKCONNECTOR)pBaseDown->pfnQueryInterface(pBaseDown, PDMINTERFACE_NETWORK_CONNECTOR);
     434        pThis->pConnector = PDMIBASE_QUERY_INTERFACE(pBaseDown, PDMINETWORKCONNECTOR);
    438435        if (!pThis->pConnector)
    439436        {
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r25966 r25981  
    786786    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    787787        return &pDrvIns->IBase;
    788     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONNECTOR) == 0)
    789         return &pThis->INetworkConnector;
     788    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONNECTOR, &pThis->INetworkConnector);
    790789    return NULL;
    791790}
     
    922921     * Query the network port interface.
    923922     */
    924     pThis->pPort = (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_PORT);
     923    pThis->pPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMINETWORKPORT);
    925924    if (!pThis->pPort)
    926925        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE,
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