VirtualBox

Ignore:
Timestamp:
Oct 20, 2021 9:07:44 AM (3 years ago)
Author:
vboxsync
Message:

Devices/Network: Change the network drivers to access the CFGM API through the driver helper callback table only, bugref:10074

File:
1 edited

Legend:

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

    r82968 r91872  
    854854    RT_NOREF(fFlags);
    855855    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    856     PDRVTAP pThis = PDMINS_2_DATA(pDrvIns, PDRVTAP);
     856    PDRVTAP         pThis = PDMINS_2_DATA(pDrvIns, PDRVTAP);
     857    PCPDMDRVHLPR3   pHlp  = pDrvIns->pHlpR3;
    857858
    858859    /*
     
    897898     * Validate the config.
    898899     */
    899     if (!CFGMR3AreValuesValid(pCfg, "Device\0InitProg\0TermProg\0FileHandle\0TAPSetupApplication\0TAPTerminateApplication\0MAC"))
    900         return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, "");
     900    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "Device"
     901                                           "|FileHandle"
     902                                           "|TAPSetupApplication"
     903                                           "|TAPTerminateApplication"
     904                                           "|MAC",
     905                                           "");
    901906
    902907    /*
     
    920925    int rc;
    921926#if defined(RT_OS_SOLARIS)   /** @todo Other platforms' TAP code should be moved here from ConsoleImpl. */
    922     rc = CFGMR3QueryStringAlloc(pCfg, "TAPSetupApplication", &pThis->pszSetupApplication);
     927    rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "TAPSetupApplication", &pThis->pszSetupApplication);
    923928    if (RT_SUCCESS(rc))
    924929    {
     
    930935        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Configuration error: failed to query \"TAPTerminateApplication\""));
    931936
    932     rc = CFGMR3QueryStringAlloc(pCfg, "TAPTerminateApplication", &pThis->pszTerminateApplication);
     937    rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "TAPTerminateApplication", &pThis->pszTerminateApplication);
    933938    if (RT_SUCCESS(rc))
    934939    {
     
    940945        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Configuration error: failed to query \"TAPTerminateApplication\""));
    941946
    942     rc = CFGMR3QueryStringAlloc(pCfg, "Device", &pThis->pszDeviceName);
     947    rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Device", &pThis->pszDeviceName);
    943948    if (RT_FAILURE(rc))
    944949        pThis->fStatic = false;
     
    963968
    964969    uint64_t u64File;
    965     rc = CFGMR3QueryU64(pCfg, "FileHandle", &u64File);
     970    rc = pHlp->pfnCFGMQueryU64(pCfg, "FileHandle", &u64File);
    966971    if (RT_FAILURE(rc))
    967972        return PDMDRV_SET_ERROR(pDrvIns, rc,
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