VirtualBox

Changeset 42004 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jul 3, 2012 5:19:38 PM (12 years ago)
Author:
vboxsync
Message:

vbgl: close driver only when openned on uninit

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/Init.cpp

    r41852 r42004  
    283283
    284284    vbglTerminateCommon ();
    285     vbglDriverClose(&g_vbgldata.driver);
     285    /* driver open could fail, which does not prevent VbglInit from succeeding,
     286     * close the driver only if it is opened */
     287    if (vbglDriverIsOpened(&g_vbgldata.driver))
     288        vbglDriverClose(&g_vbgldata.driver);
    286289    RTSemFastMutexDestroy(g_vbgldata.mutexDriverInit);
    287290    g_vbgldata.mutexDriverInit = NIL_RTSEMFASTMUTEX;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp

    r33540 r42004  
    170170# endif
    171171
     172bool vbglDriverIsOpened (VBGLDRIVER *pDriver)
     173{
     174# ifdef RT_OS_WINDOWS
     175    return pDriver->pFileObject != NULL;
     176# elif defined (RT_OS_OS2)
     177    return pDriver->u32Session != UINT32_MAX;
     178# else
     179    return pDriver->pvOpaque != NULL;
     180# endif
     181}
     182
    172183int vbglDriverOpen (VBGLDRIVER *pDriver)
    173184{
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.h

    r41430 r42004  
    8888
    8989/**
     90 * Answers whether the VBoxGuest driver is opened
     91 *
     92 * @param pDriver      Pointer to the driver structure.
     93 *
     94 * @return true - if opened, false - otherwise
     95 */
     96bool vbglDriverIsOpened (VBGLDRIVER *pDriver);
     97
     98/**
    9099 * Call VBoxGuest driver.
    91100 *
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