VirtualBox

vbox的更動 4032 路徑 trunk/src/VBox/Devices/VMMDev


忽略:
時間撮記:
2007-8-4 上午11:21:11 (17 年 以前)
作者:
vboxsync
訊息:

Implemented shared folder status light

位置:
trunk/src/VBox/Devices/VMMDev
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r3871 r4032  
    14611461            return &pData->HGCMPort;
    14621462#endif
     1463        case PDMINTERFACE_LED_PORTS:
     1464            /* Currently only for shared folders */
     1465            return &pData->SharedFolders.ILeds;
    14631466        default:
    14641467            return NULL;
     
    16611664
    16621665    return;
     1666}
     1667
     1668/**
     1669 * Gets the pointer to the status LED of a unit.
     1670 *
     1671 * @returns VBox status code.
     1672 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     1673 * @param   iLUN            The unit which status LED we desire.
     1674 * @param   ppLed           Where to store the LED pointer.
     1675 */
     1676static DECLCALLBACK(int) vmmdevQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed)
     1677{
     1678    VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1679    if (iLUN == 0) /* LUN 0 is shared folders */
     1680    {
     1681        *ppLed = &pData->SharedFolders.Led;
     1682        return VINF_SUCCESS;
     1683    }
     1684    return VERR_PDM_LUN_NOT_FOUND;
    16631685}
    16641686
     
    18961918    pData->Port.pfnRequestSeamlessChange  = vmmdevRequestSeamlessChange;
    18971919
     1920    /* Shared folder LED */
     1921    pData->SharedFolders.Led.u32Magic                 = PDMLED_MAGIC;
     1922    pData->SharedFolders.ILeds.pfnQueryStatusLed      = vmmdevQueryStatusLed;
    18981923
    18991924#ifdef VBOX_HGCM
     
    19271952    else
    19281953        AssertMsgFailedReturn(("Failed to attach LUN #0! rc=%Vrc\n", rc), rc);
     1954
     1955    /*
     1956     * Attach status driver for shared folders (optional).
     1957     */
     1958    PPDMIBASE pBase;
     1959    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pData->Base, &pBase, "Status Port");
     1960    if (VBOX_SUCCESS(rc))
     1961        pData->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
     1962            pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     1963    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
     1964    {
     1965        AssertMsgFailed(("Failed to attach to status driver. rc=%Vrc\n", rc));
     1966        return rc;
     1967    }
    19291968
    19301969    /*
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r3793 r4032  
    159159#endif /* VBOX_HGCM */
    160160
     161    /* Shared folders LED */
     162    struct
     163    {
     164        /** The LED. */
     165        PDMLED                              Led;
     166        /** The LED ports. */
     167        PDMILEDPORTS                        ILeds;
     168        /** Partner of ILeds. */
     169        HCPTRTYPE(PPDMILEDCONNECTORS)       pLedsConnector;
     170    } SharedFolders;
     171
    161172} VMMDevState;
    162173
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette