VirtualBox

Changeset 4195 in vbox


Ignore:
Timestamp:
Aug 16, 2007 10:54:20 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23687
Message:

Don't crash if there ain't no driver attached.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r4071 r4195  
    896896    int                rc;
    897897
     898    if (!s->pDrv)
     899        return;
    898900    rc = s->pDrv->pfnQueryBatteryStatus (s->pDrv, &fPresent, &hostRemainingCapacity,
    899901                                         &hostBatteryState, &hostPresentRate);
     
    943945    int                rc;
    944946
     947    if (!s->pDrv)
     948        return 0;
    945949    rc = s->pDrv->pfnQueryBatteryStatus (s->pDrv, &fPresent, &hostRemainingCapacity,
    946950                                         &hostBatteryState, &hostPresentRate);
     
    961965
    962966    /* query the current power source from the host driver */
     967    if (!s->pDrv)
     968        return AC_ONLINE;
    963969    int rc = s->pDrv->pfnQueryPowerSource (s->pDrv, &ps);
    964970    AssertRC (rc);
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