VirtualBox

Ignore:
Timestamp:
May 20, 2008 11:41:40 AM (17 years ago)
Author:
vboxsync
Message:

Additions/x11: do not attempt to access the VBox device from the mouse driver unless it initialises properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/xmouse/VBoxUtils.c

    r8155 r8950  
    2929#include "compiler.h"
    3030
     31/* This is an ugly hack, but I can't see anywhere to save this information
     32   in the driver context. */
     33/** Have we ever failed to open the VBox device? */
     34static Bool gDeviceOpenFailed = FALSE;
     35
    3136int VBoxMouseInit(void)
    3237{
    33     int rc = VbglR3Init();
     38    int rc;
     39    if (gDeviceOpenFailed)
     40        return 1;
     41    rc = VbglR3Init();
    3442    if (RT_FAILURE(rc))
    3543    {
    36         ErrorF("VbglR3Init failed.\n");
     44        ErrorF("Failed to open the VirtualBox device, falling back to compatibility mouse mode.\n");
     45        gDeviceOpenFailed = TRUE;
    3746        return 1;
    3847    }
     
    4352        ErrorF("Error sending mouse pointer capabilities to VMM! rc = %d (%s)\n",
    4453               errno, strerror(errno));
     54        gDeviceOpenFailed = TRUE;
     55        VbglR3Term();
    4556        return 1;
    4657    }
     
    5667    uint32_t pointerYPos;
    5768
     69    if (gDeviceOpenFailed)
     70        return 2;
    5871    AssertPtrReturn(puAbsXPos, VERR_INVALID_PARAMETER);
    5972    AssertPtrReturn(puAbsYPos, VERR_INVALID_PARAMETER);
     
    7285int VBoxMouseFini(void)
    7386{
     87    if (gDeviceOpenFailed)
     88        return VINF_SUCCESS;
    7489    int rc = VbglR3SetMouseStatus(0);
    7590    VbglR3Term();
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