VirtualBox

Changeset 26650 in vbox


Ignore:
Timestamp:
Feb 19, 2010 1:42:35 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57860
Message:

pdmifs,DevPS2,DrvMouseQueue,MouseImpl: hungarian changes and some other cleanups.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmifs.h

    r26638 r26650  
    279279
    280280
    281 /** PDMIMOUSEPORT interface ID. */
    282 #define PDMIMOUSEPORT_IID "f8d45ecc-bd6f-4a8d-b262-b85498e7f143"
    283281/** Pointer to a mouse port interface. */
    284282typedef struct PDMIMOUSEPORT *PPDMIMOUSEPORT;
     
    291289    /**
    292290     * Puts a mouse event.
    293      * This is called by the source of mouse events. The event will be passed up until the
    294      * topmost driver, which then calls the registered event handler.
    295      *
    296      * @returns VBox status code.
     291     *
     292     * This is called by the source of mouse events.  The event will be passed up
     293     * until the topmost driver, which then calls the registered event handler.
     294     *
     295     * @returns VBox status code.  Return VERR_TRY_AGAIN if you cannot process the
     296     *          event now and want it to be repeated at a later point.
     297     *
    297298     * @param   pInterface          Pointer to this interface structure.
    298      * @param   i32DeltaX       The X delta.
    299      * @param   i32DeltaY       The Y delta.
    300      * @param   i32DeltaZ       The Z delta.
    301      * @param   i32DeltaW       The W (horizontal scroll button) delta.
    302      * @param   fButtonStates   The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
    303      * @thread  The emulation thread.
    304      */
    305     DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates));
     299     * @param   iDeltaX             The X delta.
     300     * @param   iDeltaY             The Y delta.
     301     * @param   iDeltaZ             The Z delta.
     302     * @param   iDeltaW             The W (horizontal scroll button) delta.
     303     * @param   fButtonStates       The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
     304     */
     305    DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIMOUSEPORT pInterface, int32_t iDeltaX, int32_t iDeltaY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates));
    306306    /**
    307307     * Puts an absolute mouse event.
    308      * This is called by the source of mouse events. The event will be passed up until the
    309      * topmost driver, which then calls the registered event handler.
    310      *
    311      * @returns VBox status code.
     308     *
     309     * This is called by the source of mouse events.  The event will be passed up
     310     * until the topmost driver, which then calls the registered event handler.
     311     *
     312     * @returns VBox status code.  Return VERR_TRY_AGAIN if you cannot process the
     313     *          event now and want it to be repeated at a later point.
     314     *
    312315     * @param   pInterface          Pointer to this interface structure.
    313      * @param   i32cX               The X value, in the range 0 to 0xffff.
    314      * @param   i32cY               The Y value, in the range 0 to 0xffff.
    315      * @param   i32DeltaZ           The Z delta.
    316      * @param   i32DeltaW           The W (horizontal scroll button) delta.
     316     * @param   uX                  The X value, in the range 0 to 0xffff.
     317     * @param   uY                  The Y value, in the range 0 to 0xffff.
     318     * @param   iDeltaZ             The Z delta.
     319     * @param   iDeltaW             The W (horizontal scroll button) delta.
    317320     * @param   fButtonStates       The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
    318      * @thread  The emulation thread.
    319      */
    320     DECLR3CALLBACKMEMBER(int, pfnPutEventAbs,(PPDMIMOUSEPORT pInterface, uint32_t i32cX, uint32_t i32cY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates));
     321     */
     322    DECLR3CALLBACKMEMBER(int, pfnPutEventAbs,(PPDMIMOUSEPORT pInterface, uint32_t uX, uint32_t uY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates));
    321323} PDMIMOUSEPORT;
     324/** PDMIMOUSEPORT interface ID. */
     325#define PDMIMOUSEPORT_IID                       "442136fe-6f3c-49ec-9964-259b378ffa64"
    322326
    323327/** Mouse button defines for PDMIMOUSEPORT::pfnPutEvent.
     
    340344{
    341345    /**
    342      * Notifies the the downstream driver when the guest switches the device into or out of absolute mode.
     346     * Notifies the the downstream driver when the guest switches the device into or
     347     * out of absolute mode.
    343348     *
    344349     * @param   pInterface      Pointer to the this interface.
    345      * @param   fAbs            Whether absolute mode is currently enabled
    346      */
    347     DECLR3CALLBACKMEMBER(void, pfnAbsModeChange,(PPDMIMOUSECONNECTOR pInterface, bool fAbs));
     350     * @param   fEnabled        Whether absolute mode is currently enabled.
     351     */
     352    DECLR3CALLBACKMEMBER(void, pfnAbsModeChange,(PPDMIMOUSECONNECTOR pInterface, bool fEnabled));
    348353
    349354} PDMIMOUSECONNECTOR;
    350 
    351355/** PDMIMOUSECONNECTOR interface ID.  */
    352 #define PDMIMOUSECONNECTOR_IID                  "39e48c1c-1514-4ac6-8a9c-88034d36ae98"
     356#define PDMIMOUSECONNECTOR_IID                  "6b7be703-c1de-40a2-a977-0ef68d8760ca"
    353357
    354358
     
    372376     * @param   pInterface          Pointer to this interface structure.
    373377     * @param   u8KeyCode           The keycode to queue.
    374      * @thread  The emulation thread.
    375378     */
    376379    DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIKEYBOARDPORT pInterface, uint8_t u8KeyCode));
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r26638 r26650  
    162162#define KBD_QUEUE_SIZE 256
    163163
    164 /* Supported mouse protocols */
     164/** Supported mouse protocols */
    165165enum
    166166{
     
    171171};
    172172
    173 /* Mouse flags */
     173/** Mouse flags */
    174174# define MOUSE_REPORT_HORIZONTAL  0x01
    175175
    176 /** Extended mouse button values for Lifebook mode */
     176/** @name Extended mouse button values for Lifebook mode
     177 * @{ */
    177178/** Downwards scrollwheel movement of one step.  Doesn't affect the mouse
    178179 * buttons */
     
    184185/** Rightwards scrollwheel movement of one step. */
    185186# define MOUSE_EXT_HSCROLL_FW   7
     187/** @} */
    186188
    187189typedef struct {
     
    230232    int32_t mouse_dw;
    231233    int32_t mouse_flags;
    232     uint32_t mouse_cx;
     234    uint32_t mouse_cx; /** @todo r=bird: cx/cy? aren't these absolute coordinates? 'c' usually means 'count of'. mouse_abs_x or just mouse_x would probably be clearer. */
    233235    uint32_t mouse_cy;
    234236    uint8_t mouse_buttons;
     
    707709
    708710/**
    709  * Send a single relative packet in 3-byte PS/2 format, optionally with our 
     711 * Send a single relative packet in 3-byte PS/2 format, optionally with our
    710712 * packed button protocol extension, to the PS/2 controller.
    711713 * @param  s               keyboard state object
     
    839841 * Send a single absolute packet in 6-byte lifebook format to the PS/2
    840842 * controller.
    841  * @param  s         keyboard state object
    842  * @param  cx        absolute X value
    843  * @param  cy        absolute y value
    844  * @param  fButtons  the state of the two first mouse buttons
     843 * @param  s            keyboard state object
     844 * @param  fToCmdQueue  Which queue.
    845845 */
    846846static void kbd_mouse_send_abs_packet(KBDState *s, bool fToCmdQueue)
     
    12281228    s->mouse_wrap = 0;
    12291229    s->mouse_type = MOUSE_PROT_PS2;
    1230     s->Mouse.pDrv->pfnAbsModeChange(s->Mouse.pDrv, false);
     1230    if (s->Mouse.pDrv)
     1231        s->Mouse.pDrv->pfnAbsModeChange(s->Mouse.pDrv, false);
    12311232    s->mouse_detect_state = 0;
    12321233    s->mouse_dx = 0;
     
    13311332    qemu_get_8s(f, &s->mouse_wrap);
    13321333    qemu_get_8s(f, &s->mouse_type);
    1333     if (s->mouse_type == MOUSE_PROT_LIFEBOOK)
     1334    if (s->mouse_type == MOUSE_PROT_LIFEBOOK && s->Mouse.pDrv)
    13341335        s->Mouse.pDrv->pfnAbsModeChange(s->Mouse.pDrv, true);
    13351336    qemu_get_8s(f, &s->mouse_detect_state);
     
    16571658
    16581659/**
    1659  * Mouse event handler.
    1660  *
    1661  * @returns VBox status code.
    1662  * @param   pInterface      Pointer to the mouse port interface (KBDState::Mouse.IPort).
    1663  * @param   i32DeltaX       The X delta.
    1664  * @param   i32DeltaY       The Y delta.
    1665  * @param   i32DeltaZ       The Z delta.
    1666  * @param   fButtonStates   The button states.
    1667  */
    1668 static DECLCALLBACK(int) kbdMousePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY,
    1669                                           int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
     1660 * @interface_method_impl{PDMIMOUSEPORT, pfnPutEvent}
     1661 */
     1662static DECLCALLBACK(int) kbdMousePutEvent(PPDMIMOUSEPORT pInterface, int32_t iDeltaX, int32_t iDeltaY,
     1663                                          int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates)
    16701664{
    16711665    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.IPort);
     
    16731667    AssertReleaseRC(rc);
    16741668
    1675     pc_kbd_mouse_event(pThis, i32DeltaX, i32DeltaY, i32DeltaZ, i32DeltaW, fButtonStates);
     1669    pc_kbd_mouse_event(pThis, iDeltaX, iDeltaY, iDeltaZ, iDeltaW, fButtonStates);
    16761670
    16771671    PDMCritSectLeave(&pThis->CritSect);
     
    16801674
    16811675/**
    1682  * Mouse event handler.
    1683  *
    1684  * @returns VBox status code.
    1685  * @param   pInterface      Pointer to the mouse port interface (KBDState::Mouse.IPort).
    1686  * @param   i32cX           The X value.
    1687  * @param   i32cY           The Y value.
    1688  */
    1689 static DECLCALLBACK(int) kbdMousePutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t u32cX, uint32_t u32cY, int32_t dz, int32_t dw, uint32_t fButtons)
     1676 * @interface_method_impl{PDMIMOUSEPORT, pfnPutEventAbs}
     1677 */
     1678static DECLCALLBACK(int) kbdMousePutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t uX, uint32_t uY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtons)
    16901679{
    16911680    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.IPort);
     
    16931682    AssertReleaseRC(rc);
    16941683
    1695     if (u32cX != pThis->mouse_cx || u32cY != pThis->mouse_cy)
    1696         pc_kbd_mouse_event_abs(pThis, u32cX, u32cY);
    1697     if (dz || dw || fButtons != pThis->mouse_buttons)
    1698         pc_kbd_mouse_event(pThis, 0, 0, dz, dw, fButtons);
     1684    if (uX != pThis->mouse_cx || uY != pThis->mouse_cy)
     1685        pc_kbd_mouse_event_abs(pThis, uX, uY);
     1686    if (iDeltaZ || iDeltaW || fButtons != pThis->mouse_buttons)
     1687        pc_kbd_mouse_event(pThis, 0, 0, iDeltaZ, iDeltaW, fButtons);
    16991688
    17001689    PDMCritSectLeave(&pThis->CritSect);
  • trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp

    r26638 r26650  
    7070    PDMQUEUEITEMCORE    Core;
    7171    uint32_t            fAbs;
    72     int32_t             i32DeltaX;
    73     int32_t             i32DeltaY;
    74     int32_t             i32DeltaZ;
    75     int32_t             i32DeltaW;
     72    int32_t             iDeltaX;
     73    int32_t             iDeltaY;
     74    int32_t             iDeltaZ;
     75    int32_t             iDeltaW;
    7676    uint32_t            fButtonStates;
    77     uint32_t            u32cX;
    78     uint32_t            u32cY;
     77    uint32_t            uX;
     78    uint32_t            uY;
    7979} DRVMOUSEQUEUEITEM, *PDRVMOUSEQUEUEITEM;
    8080
     
    104104
    105105/**
    106  * Queues a mouse event.
    107  * Because of the event queueing the EMT context requirement is lifted.
    108  *
    109  * @returns VBox status code.
    110  * @param   pInterface      Pointer to interface structure.
    111  * @param   i32DeltaX       The X delta.
    112  * @param   i32DeltaY       The Y delta.
    113  * @param   i32DeltaZ       The Z delta.
    114  * @param   i32DeltaW       The W delta.
    115  * @param   fButtonStates   The button states.
    116  * @thread  Any thread.
    117  */
    118 static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
     106 * @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent}
     107 */
     108static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t iDeltaX, int32_t iDeltaY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates)
    119109{
    120110    PDRVMOUSEQUEUE pDrv = IMOUSEPORT_2_DRVMOUSEQUEUE(pInterface);
     
    126116    {
    127117        pItem->fAbs = 0;
    128         pItem->i32DeltaX = i32DeltaX;
    129         pItem->i32DeltaY = i32DeltaY;
    130         pItem->i32DeltaZ = i32DeltaZ;
    131         pItem->i32DeltaW = i32DeltaW;
     118        pItem->iDeltaX = iDeltaX;
     119        pItem->iDeltaY = iDeltaY;
     120        pItem->iDeltaZ = iDeltaZ;
     121        pItem->iDeltaW = iDeltaW;
    132122        pItem->fButtonStates = fButtonStates;
     123        pItem->uX = 0;
     124        pItem->uY = 0;
    133125        PDMQueueInsert(pDrv->pQueue, &pItem->Core);
    134126        return VINF_SUCCESS;
     
    138130
    139131/**
    140  * Queues an absolute mouse event.
    141  * Because of the event queueing the EMT context requirement is lifted.
    142  *
    143  * @returns VBox status code.
    144  * @param   pInterface      Pointer to interface structure.
    145  * @param   u32cX           The X value.
    146  * @param   u32cY           The Y value.
    147  * @param   i32DeltaZ       The Z delta.
    148  * @param   i32DeltaW       The W delta.
    149  * @param   fButtonStates   The button states.
    150  * @thread  Any thread.
    151  */
    152 static DECLCALLBACK(int) drvMouseQueuePutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t u32cX, uint32_t u32cY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
     132 * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventAbs}
     133 */
     134static DECLCALLBACK(int) drvMouseQueuePutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t uX, uint32_t uY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates)
    153135{
    154136    PDRVMOUSEQUEUE pDrv = IMOUSEPORT_2_DRVMOUSEQUEUE(pInterface);
     
    160142    {
    161143        pItem->fAbs = 1;
    162         pItem->u32cX = u32cX;
    163         pItem->u32cY = u32cY;
    164         pItem->i32DeltaZ = i32DeltaZ;
    165         pItem->i32DeltaW = i32DeltaW;
     144        pItem->iDeltaX = 0;
     145        pItem->iDeltaY = 0;
     146        pItem->iDeltaZ = iDeltaZ;
     147        pItem->iDeltaW = iDeltaW;
    166148        pItem->fButtonStates = fButtonStates;
     149        pItem->uX = uX;
     150        pItem->uY = uY;
    167151        PDMQueueInsert(pDrv->pQueue, &pItem->Core);
    168152        return VINF_SUCCESS;
     
    208192    int rc;
    209193    if (!pItem->fAbs)
    210         rc = pThis->pUpPort->pfnPutEvent(pThis->pUpPort, pItem->i32DeltaX, pItem->i32DeltaY, pItem->i32DeltaZ, pItem->i32DeltaW, pItem->fButtonStates);
     194        rc = pThis->pUpPort->pfnPutEvent(pThis->pUpPort, pItem->iDeltaX, pItem->iDeltaY, pItem->iDeltaZ, pItem->iDeltaW, pItem->fButtonStates);
    211195    else
    212         rc = pThis->pUpPort->pfnPutEventAbs(pThis->pUpPort, pItem->u32cX, pItem->u32cY, pItem->i32DeltaZ, pItem->i32DeltaW, pItem->fButtonStates);
     196        rc = pThis->pUpPort->pfnPutEventAbs(pThis->pUpPort, pItem->uX,   pItem->uY,      pItem->iDeltaZ, pItem->iDeltaW, pItem->fButtonStates);
    213197    return RT_SUCCESS(rc);
    214198}
  • trunk/src/VBox/Main/MouseImpl.cpp

    r26638 r26650  
    4646} DRVMAINMOUSE, *PDRVMAINMOUSE;
    4747
    48 /** Converts a PDMIMOUSECONNECTOR pointer to a DRVMAINMOUSE pointer. */
    49 #define PPDMIMOUSECONNECTOR_2_MAINMOUSE(pInterface) ( (PDRVMAINMOUSE) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINMOUSE, IConnector)) )
    5048
    5149// constructor / destructor
     
    403401                                          LONG buttonState)
    404402{
    405     HRESULT rc = S_OK;
    406 
    407403    AutoCaller autoCaller(this);
    408404    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     
    414410
    415411    uint32_t mouseXAbs;
    416     rc = convertDisplayWidth(x, &mouseXAbs);
     412    HRESULT rc = convertDisplayWidth(x, &mouseXAbs);
    417413    ComAssertComRCRet(rc, rc);
    418414    if (mouseXAbs > 0xffff)
    419415        mouseXAbs = mLastAbsX;
     416
    420417    uint32_t mouseYAbs;
    421418    rc = convertDisplayHeight(y, &mouseYAbs);
     
    423420    if (mouseYAbs > 0xffff)
    424421        mouseYAbs = mLastAbsY;
     422
    425423    uint32_t fButtons = mouseButtonsToPDM(buttonState);
     424
    426425    /* Older guest additions rely on a small phony movement event on the
    427426     * PS/2 device to notice absolute events. */
     
    435434        rc = getVMMDevMouseCaps(&mouseCaps);
    436435        ComAssertComRCRet(rc, rc);
     436
    437437        /*
    438438         * This method being called implies that the host wants
     
    449449        fNeedsJiggle = !(mouseCaps & VMMDEV_MOUSE_GUEST_USES_VMMDEV);
    450450    }
    451     ComAssertComRCRet (rc, rc);
     451    ComAssertComRCRet(rc, rc);
     452
    452453    mLastAbsX = mouseXAbs;
    453454    mLastAbsY = mouseYAbs;
     455
    454456    if (!(uDevCaps & MOUSE_DEVCAP_ABSOLUTE))
    455457    {
     
    460462         * the way. */
    461463        if (fNeedsJiggle || fButtons != mLastButtons || dz || dw)
     464        {
    462465            rc = reportRelEventToMouseDev(fNeedsJiggle ? 1 : 0, 0, dz, dw,
    463466                                          fButtons);
    464         ComAssertComRCRet (rc, rc);
     467            ComAssertComRCRet(rc, rc);
     468        }
    465469    }
    466470    mLastButtons = fButtons;
     
    471475/////////////////////////////////////////////////////////////////////////////
    472476
    473 /**
    474  * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    475  */
    476 DECLCALLBACK(void *)  Mouse::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    477 {
    478     PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    479     PDRVMAINMOUSE   pDrv    = PDMINS_2_DATA(pDrvIns, PDRVMAINMOUSE);
    480 
    481     PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
    482     PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUSECONNECTOR, &pDrv->IConnector);
    483     return NULL;
    484 }
    485 
    486 
    487 /**
    488  * Destruct a mouse driver instance.
    489  *
    490  * @returns VBox status.
    491  * @param   pDrvIns     The driver instance data.
    492  */
    493 DECLCALLBACK(void) Mouse::drvDestruct(PPDMDRVINS pDrvIns)
    494 {
    495     PDRVMAINMOUSE pData = PDMINS_2_DATA(pDrvIns, PDRVMAINMOUSE);
    496     LogFlow(("Mouse::drvDestruct: iInstance=%d\n", pDrvIns->iInstance));
    497     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
    498 
    499     if (pData->pMouse)
    500     {
    501         AutoWriteLock mouseLock(pData->pMouse COMMA_LOCKVAL_SRC_POS);
    502         pData->pMouse->mpDrv = NULL;
    503     }
    504 }
    505 
    506 
    507 DECLCALLBACK(void) Mouse::mouseAbsModeChange (PPDMIMOUSECONNECTOR pInterface, bool fAbs)
    508 {
    509     PDRVMAINMOUSE pDrv = PPDMIMOUSECONNECTOR_2_MAINMOUSE (pInterface);
    510     if (fAbs)
     477
     478/**
     479 * @interface_method_impl{PDMIMOUSECONNECTOR,pfnAbsModeChange}
     480 */
     481DECLCALLBACK(void) Mouse::mouseAbsModeChange(PPDMIMOUSECONNECTOR pInterface, bool fEnabled)
     482{
     483    PDRVMAINMOUSE pDrv = RT_FROM_MEMBER(pInterface, DRVMAINMOUSE, IConnector);
     484    if (fEnabled)
    511485        pDrv->pMouse->uDevCaps |= MOUSE_DEVCAP_ABSOLUTE;
    512486    else
    513487        pDrv->pMouse->uDevCaps &= ~MOUSE_DEVCAP_ABSOLUTE;
     488
    514489    /** @todo we have to hack around the fact that VMMDev may not be
    515490     * initialised too close to startup.  The real fix is to change the
     
    523498        rc = pDrv->pMouse->getVMMDevMouseCaps(&fMouseCaps);
    524499    AssertComRCReturnVoid(rc);
    525     pDrv->pMouse->getParent()->onMouseCapabilityChange (fAbs, fMouseCaps & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
     500    pDrv->pMouse->getParent()->onMouseCapabilityChange(fEnabled, fMouseCaps & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
     501}
     502
     503
     504/**
     505 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
     506 */
     507DECLCALLBACK(void *)  Mouse::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     508{
     509    PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     510    PDRVMAINMOUSE   pDrv    = PDMINS_2_DATA(pDrvIns, PDRVMAINMOUSE);
     511
     512    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
     513    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUSECONNECTOR, &pDrv->IConnector);
     514    return NULL;
     515}
     516
     517
     518/**
     519 * Destruct a mouse driver instance.
     520 *
     521 * @returns VBox status.
     522 * @param   pDrvIns     The driver instance data.
     523 */
     524DECLCALLBACK(void) Mouse::drvDestruct(PPDMDRVINS pDrvIns)
     525{
     526    PDRVMAINMOUSE pData = PDMINS_2_DATA(pDrvIns, PDRVMAINMOUSE);
     527    LogFlow(("Mouse::drvDestruct: iInstance=%d\n", pDrvIns->iInstance));
     528    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     529
     530    if (pData->pMouse)
     531    {
     532        AutoWriteLock mouseLock(pData->pMouse COMMA_LOCKVAL_SRC_POS);
     533        pData->pMouse->mpDrv = NULL;
     534    }
    526535}
    527536
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