VirtualBox

Changeset 91868 in vbox


Ignore:
Timestamp:
Oct 20, 2021 9:05:37 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147671
Message:

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

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

Legend:

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

    r86467 r91868  
    777777{
    778778    RT_NOREF1(fFlags);
    779     PDRVHOSTSERIAL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL);
     779    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
     780    PDRVHOSTSERIAL  pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL);
     781    PCPDMDRVHLPR3   pHlp  = pDrvIns->pHlpR3;
     782
    780783    LogFlow(("%s: iInstance=%d\n", __FUNCTION__, pDrvIns->iInstance));
    781     PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    782784
    783785    /*
     
    806808
    807809    /*
     810     * Validate the config.
     811     */
     812    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "DevicePath", "");
     813
     814    /*
    808815     * Query configuration.
    809816     */
    810817    /* Device */
    811     int rc = CFGMR3QueryStringAlloc(pCfg, "DevicePath", &pThis->pszDevicePath);
     818    int rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "DevicePath", &pThis->pszDevicePath);
    812819    if (RT_FAILURE(rc))
    813820    {
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r82968 r91868  
    887887    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    888888    PDRVNAMEDPIPE pThis = PDMINS_2_DATA(pDrvIns, PDRVNAMEDPIPE);
     889    PCPDMDRVHLPR3 pHlp  = pDrvIns->pHlpR3;
    889890
    890891    /*
     
    924925    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "Location|IsServer", "");
    925926
    926     int rc = CFGMR3QueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
     927    int rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
    927928    if (RT_FAILURE(rc))
    928929        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    929930                                   N_("Configuration error: querying \"Location\" resulted in %Rrc"), rc);
    930     rc = CFGMR3QueryBool(pCfg, "IsServer", &pThis->fIsServer);
     931    rc = pHlp->pfnCFGMQueryBool(pCfg, "IsServer", &pThis->fIsServer);
    931932    if (RT_FAILURE(rc))
    932933        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
  • trunk/src/VBox/Devices/Serial/DrvRawFile.cpp

    r82968 r91868  
    190190    RT_NOREF(fFlags);
    191191    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    192     PDRVRAWFILE pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWFILE);
     192    PDRVRAWFILE     pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWFILE);
     193    PCPDMDRVHLPR3   pHlp  = pDrvIns->pHlpR3;
    193194
    194195    /*
     
    209210     * Read the configuration.
    210211     */
    211     if (!CFGMR3AreValuesValid(pCfg, "Location\0"))
    212         AssertFailedReturn(VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES);
    213 
    214     int rc = CFGMR3QueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
     212    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "Location", "");
     213
     214    int rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
    215215    if (RT_FAILURE(rc))
    216216        AssertMsgFailedReturn(("Configuration error: query \"Location\" resulted in %Rrc.\n", rc), rc);
  • trunk/src/VBox/Devices/Serial/DrvTCP.cpp

    r86114 r91868  
    555555    RT_NOREF(fFlags);
    556556    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    557     PDRVTCP pThis = PDMINS_2_DATA(pDrvIns, PDRVTCP);
     557    PDRVTCP         pThis = PDMINS_2_DATA(pDrvIns, PDRVTCP);
     558    PCPDMDRVHLPR3   pHlp  = pDrvIns->pHlpR3;
    558559
    559560    /*
     
    589590    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "Location|IsServer", "");
    590591
    591     int rc = CFGMR3QueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
     592    int rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "Location", &pThis->pszLocation);
    592593    if (RT_FAILURE(rc))
    593594        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    594595                                   N_("Configuration error: querying \"Location\" resulted in %Rrc"), rc);
    595     rc = CFGMR3QueryBool(pCfg, "IsServer", &pThis->fIsServer);
     596    rc = pHlp->pfnCFGMQueryBool(pCfg, "IsServer", &pThis->fIsServer);
    596597    if (RT_FAILURE(rc))
    597598        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
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