VirtualBox

Changeset 73094 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jul 12, 2018 7:15:10 PM (6 years ago)
Author:
vboxsync
Message:

Devices/Storage/DrvDiskIntegrity: Add some missing interfaces to handle being placed inside a driver chain for a CD/DVD drive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp

    r72338 r73094  
    139139 *
    140140 * @implements  PDMIMEDIA
     141 * @implements  PDMIMEDIAPORT
     142 * @implements  PDMIMEDIAEX
     143 * @implements  PDMIMEDIAEXPORT
     144 * @implements  PDMIMEDIAMOUNT
     145 * @implements  PDMIMEDIAMOUNTNOTIFY
    141146 */
    142147typedef struct DRVDISKINTEGRITY
     
    164169    /** Our extended media interface */
    165170    PDMIMEDIAEX             IMediaEx;
     171
     172    /** The mount interface below. */
     173    PPDMIMOUNT              pDrvMount;
     174    /** Our mount interface */
     175    PDMIMOUNT               IMount;
     176
     177    /** The mount notify interface above. */
     178    PPDMIMOUNTNOTIFY        pDrvMountNotify;
     179    /** Our mount notify interface. */
     180    PDMIMOUNTNOTIFY         IMountNotify;
    166181
    167182    /** Flag whether consistency checks are enabled. */
     
    16231638}
    16241639
     1640/* -=-=-=-=- IMount -=-=-=-=- */
     1641
     1642/** @interface_method_impl{PDMIMOUNT,pfnUnmount} */
     1643static DECLCALLBACK(int) drvdiskintUnmount(PPDMIMOUNT pInterface, bool fForce, bool fEject)
     1644{
     1645    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMount);
     1646    return pThis->pDrvMount->pfnUnmount(pThis->pDrvMount, fForce, fEject);
     1647}
     1648
     1649/** @interface_method_impl{PDMIMOUNT,pfnIsMounted} */
     1650static DECLCALLBACK(bool) drvdiskintIsMounted(PPDMIMOUNT pInterface)
     1651{
     1652    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMount);
     1653    return pThis->pDrvMount->pfnIsMounted(pThis->pDrvMount);
     1654}
     1655
     1656/** @interface_method_impl{PDMIMOUNT,pfnLock} */
     1657static DECLCALLBACK(int) drvdiskintLock(PPDMIMOUNT pInterface)
     1658{
     1659    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMount);
     1660    return pThis->pDrvMount->pfnLock(pThis->pDrvMount);
     1661}
     1662
     1663/** @interface_method_impl{PDMIMOUNT,pfnUnlock} */
     1664static DECLCALLBACK(int) drvdiskintUnlock(PPDMIMOUNT pInterface)
     1665{
     1666    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMount);
     1667    return pThis->pDrvMount->pfnUnlock(pThis->pDrvMount);
     1668}
     1669
     1670/** @interface_method_impl{PDMIMOUNT,pfnIsLocked} */
     1671static DECLCALLBACK(bool) drvdiskintIsLocked(PPDMIMOUNT pInterface)
     1672{
     1673    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMount);
     1674    return pThis->pDrvMount->pfnIsLocked(pThis->pDrvMount);
     1675}
     1676
     1677/* -=-=-=-=- IMountNotify -=-=-=-=- */
     1678
     1679/** @interface_method_impl{PDMIMOUNTNOTIFY,pfnMountNotify} */
     1680static DECLCALLBACK(void) drvdiskintMountNotify(PPDMIMOUNTNOTIFY pInterface)
     1681{
     1682    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMountNotify);
     1683    pThis->pDrvMountNotify->pfnMountNotify(pThis->pDrvMountNotify);
     1684}
     1685
     1686/** @interface_method_impl{PDMIMOUNTNOTIFY,pfnUnmountNotify} */
     1687static DECLCALLBACK(void) drvdiskintUnmountNotify(PPDMIMOUNTNOTIFY pInterface)
     1688{
     1689    PDRVDISKINTEGRITY pThis = RT_FROM_MEMBER(pInterface, DRVDISKINTEGRITY, IMountNotify);
     1690    pThis->pDrvMountNotify->pfnUnmountNotify(pThis->pDrvMountNotify);
     1691}
     1692
    16251693/* -=-=-=-=- IBase -=-=-=-=- */
    16261694
     
    16381706    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAEXPORT, &pThis->IMediaExPort);
    16391707    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAEX, pThis->pDrvMediaEx ? &pThis->IMediaEx : NULL);
     1708    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUNT, pThis->pDrvMount ? &pThis->IMount : NULL);
     1709    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUNTNOTIFY, &pThis->IMountNotify);
    16401710    return NULL;
    16411711}
     
    18411911    pThis->IMediaExPort.pfnIoReqStateChanged       = drvdiskintIoReqStateChanged;
    18421912
     1913    /* IMount */
     1914    pThis->IMount.pfnUnmount                       = drvdiskintUnmount;
     1915    pThis->IMount.pfnIsMounted                     = drvdiskintIsMounted;
     1916    pThis->IMount.pfnLock                          = drvdiskintLock;
     1917    pThis->IMount.pfnUnlock                        = drvdiskintUnlock;
     1918    pThis->IMount.pfnIsLocked                      = drvdiskintIsLocked;
     1919
     1920    /* IMountNotify */
     1921    pThis->IMountNotify.pfnMountNotify             = drvdiskintMountNotify;
     1922    pThis->IMountNotify.pfnUnmountNotify           = drvdiskintUnmountNotify;
     1923
    18431924    /* Query the media port interface above us. */
    18441925    pThis->pDrvMediaPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAPORT);
     
    18711952
    18721953    pThis->pDrvMediaEx = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIAEX);
     1954    pThis->pDrvMount   = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMOUNT);
    18731955
    18741956    if (pThis->pDrvMedia->pfnDiscard)
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