VirtualBox

Changeset 94987 in vbox for trunk/src/VBox/ExtPacks


Ignore:
Timestamp:
May 12, 2022 9:05:55 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151412
Message:

DevBusMouse: Un-broke the code after PDM interface changes. Also avoided possible trouble when Mouse.pDrv is not set in case device is misconfigured and has no driver attached.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp

    r93115 r94987  
    217217    PPDMIMOUSECONNECTOR pDrv = pThisCC->Mouse.pDrv;
    218218    bool fEnabled = !!pThis->mouse_enabled;
    219     pDrv->pfnReportModes(pDrv, fEnabled, false, false);
     219    if (pDrv)   /* pDrv may be NULL if no mouse interface attached. */
     220        pDrv->pfnReportModes(pDrv, fEnabled, false, false);
    220221}
    221222
     
    240241{
    241242    PBMSSTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE);
    242     PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA(pDevIns, PBMSSTATER3);
     243    PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3);
    243244    uint8_t     irq_bit;
    244     RT_NOREF(pvUser, hTimer);
     245    RT_NOREF(pvUser);
    245246    Assert(hTimer == pThis->hMouseTimer);
    246247
     
    520521{
    521522    PBMSSTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE);
    522     PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA(pDevIns, PBMSSTATER3);
     523    PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3);
    523524
    524525    /* Reinitialize the timer. */
     
    633634            else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    634635            {
    635                 Log(("%s/%d: warning: no driver attached to LUN #0!\n", pDevIns->pReg->szName, pDevIns->iInstance));
     636                LogRel(("%s/%d: Warning: no driver attached to LUN #0!\n", pDevIns->pReg->szName, pDevIns->iInstance));
    636637                rc = VINF_SUCCESS;
    637638            }
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