VirtualBox

Changeset 64846 in vbox


Ignore:
Timestamp:
Dec 12, 2016 10:27:26 PM (8 years ago)
Author:
vboxsync
Message:

Devices/Storage/DevFdc: Add missing pfnQueryDeviceLocation, fixes crash after recent changes in the medium driver

File:
1 edited

Legend:

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

    r64274 r64846  
    141141    BlockDriverState *bs;
    142142#else /* VBOX */
     143    /** Pointer to the owning device instance. */
     144    R3PTRTYPE(PPDMDEVINS)           pDevIns;
    143145    /** Pointer to the attached driver's base interface. */
    144146    R3PTRTYPE(PPDMIBASE)            pDrvBase;
     
    26692671
    26702672
     2673/**
     2674 * @interface_method_impl{PDMIMEDIAPORT,pfnQueryDeviceLocation}
     2675 */
     2676static DECLCALLBACK(int) fdQueryDeviceLocation(PPDMIMEDIAPORT pInterface, const char **ppcszController,
     2677                                               uint32_t *piInstance, uint32_t *piLUN)
     2678{
     2679    fdrive_t *pDrv = RT_FROM_MEMBER(pInterface, fdrive_t, IPort);
     2680    PPDMDEVINS pDevIns = pDrv->pDevIns;
     2681
     2682    AssertPtrReturn(ppcszController, VERR_INVALID_POINTER);
     2683    AssertPtrReturn(piInstance, VERR_INVALID_POINTER);
     2684    AssertPtrReturn(piLUN, VERR_INVALID_POINTER);
     2685
     2686    *ppcszController = pDevIns->pReg->szName;
     2687    *piInstance = pDevIns->iInstance;
     2688    *piLUN = pDrv->iLUN;
     2689
     2690    return VINF_SUCCESS;
     2691}
     2692
    26712693/* -=-=-=-=-=-=-=-=- Controller level interfaces -=-=-=-=-=-=-=-=- */
    26722694
     
    29272949        fdrive_t *pDrv = &pThis->drives[i];
    29282950
    2929         pDrv->drive = FDRIVE_DRV_NONE;
    2930         pDrv->iLUN = i;
     2951        pDrv->drive   = FDRIVE_DRV_NONE;
     2952        pDrv->iLUN    = i;
     2953        pDrv->pDevIns = pDevIns;
    29312954
    29322955        pDrv->IBase.pfnQueryInterface       = fdQueryInterface;
    29332956        pDrv->IMountNotify.pfnMountNotify   = fdMountNotify;
    29342957        pDrv->IMountNotify.pfnUnmountNotify = fdUnmountNotify;
     2958        pDrv->IPort.pfnQueryDeviceLocation  = fdQueryDeviceLocation;
    29352959        pDrv->Led.u32Magic = PDMLED_MAGIC;
    29362960    }
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