VirtualBox

Changeset 94924 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 8, 2022 7:56:44 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151332
Message:

Main/src-client/MouseImpl.cpp: Adjust to the new rules wrt. to rc -> hrc,vrc usage, ​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/MouseImpl.cpp

    r93444 r94924  
    265265
    266266    unconst(mEventSource).createObject();
    267     HRESULT rc = mEventSource->init();
    268     AssertComRCReturnRC(rc);
     267    HRESULT hrc = mEventSource->init();
     268    AssertComRCReturnRC(hrc);
    269269
    270270    ComPtr<IEvent> ptrEvent;
    271     rc = ::CreateGuestMouseEvent(ptrEvent.asOutParam(), mEventSource,
    272                                  (GuestMouseEventMode_T)0, 0 /*x*/, 0 /*y*/, 0 /*z*/, 0 /*w*/, 0 /*buttons*/);
    273     AssertComRCReturnRC(rc);
     271    hrc = ::CreateGuestMouseEvent(ptrEvent.asOutParam(), mEventSource,
     272                                  (GuestMouseEventMode_T)0, 0 /*x*/, 0 /*y*/, 0 /*z*/, 0 /*w*/, 0 /*buttons*/);
     273    AssertComRCReturnRC(hrc);
    274274    mMouseEvent.init(ptrEvent, mEventSource);
    275275
     
    360360        return E_FAIL;  /* same here */
    361361
    362     int rc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded,
    363                                                      fCapsRemoved);
    364     if (RT_FAILURE(rc))
     362    int vrc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded,
     363                                                      fCapsRemoved);
     364    if (RT_FAILURE(vrc))
    365365        return E_FAIL;
    366366    return pDisplay->i_reportHostCursorCapabilities(fCapsAdded, fCapsRemoved);
     
    633633                                              bool fUsesVMMDevEvent)
    634634{
    635     HRESULT rc;
     635    HRESULT hrc;
    636636    /** If we are using the VMMDev to report absolute position but without
    637637     * VMMDev IRQ support then we need to send a small "jiggle" to the emulated
     
    646646        if (x != mcLastX || y != mcLastY)
    647647        {
    648             rc = i_reportAbsEventToVMMDev(x, y);
     648            hrc = i_reportAbsEventToVMMDev(x, y);
    649649            cJiggle = !fUsesVMMDevEvent;
    650650        }
    651         rc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
     651        hrc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
    652652    }
    653653    else
    654         rc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
     654        hrc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
    655655
    656656    mcLastX = x;
    657657    mcLastY = y;
    658     return rc;
     658    return hrc;
    659659}
    660660
     
    743743                             LONG aButtonState)
    744744{
    745     HRESULT rc;
    746     uint32_t fButtonsAdj;
    747 
    748745    LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
    749746                 dx, dy, dz, dw));
    750747
    751     fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
     748    uint32_t fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
    752749    /* Make sure that the guest knows that we are sending real movement
    753750     * events to the PS/2 device and not just dummy wake-up ones. */
    754751    i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE);
    755     rc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
     752    HRESULT hrc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
    756753
    757754    i_fireMouseEvent(false, dx, dy, dz, dw, aButtonState);
    758755
    759     return rc;
     756    return hrc;
    760757}
    761758
     
    796793        LONG lDummy;
    797794        /* Takes the display lock */
    798         HRESULT rc = pDisplay->i_getScreenResolution(0, &displayWidth,
    799                                                      &displayHeight, &ulDummy, &lDummy, &lDummy);
    800         if (FAILED(rc))
    801             return rc;
     795        HRESULT hrc = pDisplay->i_getScreenResolution(0, &displayWidth,
     796                                                      &displayHeight, &ulDummy, &lDummy, &lDummy);
     797        if (FAILED(hrc))
     798            return hrc;
    802799
    803800        *pxAdj = displayWidth ?   (x * VMMDEV_MOUSE_RANGE + ADJUST_RANGE)
     
    872869    /** @note Or maybe not... races are pretty inherent in everything done in
    873870     *        this object and not really bad as far as I can see. */
    874     HRESULT rc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
    875     if (FAILED(rc)) return rc;
     871    HRESULT hrc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
     872    if (FAILED(hrc)) return hrc;
    876873
    877874    fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
    878875    if (fValid)
    879876    {
    880         rc = i_reportAbsEventToInputDevices(xAdj, yAdj, dz, dw, fButtonsAdj,
    881                                             RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL));
    882         if (FAILED(rc)) return rc;
     877        hrc = i_reportAbsEventToInputDevices(xAdj, yAdj, dz, dw, fButtonsAdj,
     878                                             RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL));
     879        if (FAILED(hrc)) return hrc;
    883880
    884881        i_fireMouseEvent(true, x, y, dz, dw, aButtonState);
    885882    }
    886     rc = i_reportAbsEventToDisplayDevice(x, y);
    887 
    888     return rc;
     883    hrc = i_reportAbsEventToDisplayDevice(x, y);
     884
     885    return hrc;
    889886}
    890887
     
    905902             __FUNCTION__, aCount, aContacts.size(), aScanTime));
    906903
    907     HRESULT rc = S_OK;
     904    HRESULT hrc = S_OK;
    908905
    909906    if ((LONG)aContacts.size() >= aCount)
     
    911908        const LONG64 *paContacts = aCount > 0? &aContacts.front(): NULL;
    912909
    913         rc = i_putEventMultiTouch(aCount, paContacts, aScanTime);
     910        hrc = i_putEventMultiTouch(aCount, paContacts, aScanTime);
    914911    }
    915912    else
    916913    {
    917         rc = E_INVALIDARG;
    918     }
    919 
    920     return rc;
     914        hrc = E_INVALIDARG;
     915    }
     916
     917    return hrc;
    921918}
    922919
     
    967964    LONG  xOrigin = 0;
    968965    LONG  yOrigin = 0;
    969     HRESULT rc = pDisplay->i_getScreenResolution(uScreenId, &cWidth, &cHeight, &cBPP, &xOrigin, &yOrigin);
     966    HRESULT hrc = pDisplay->i_getScreenResolution(uScreenId, &cWidth, &cHeight, &cBPP, &xOrigin, &yOrigin);
    970967    NOREF(cBPP);
    971     ComAssertComRCRetRC(rc);
     968    ComAssertComRCRetRC(hrc);
    972969
    973970    uint64_t* pau64Contacts = NULL;
     
    10341031        else
    10351032        {
    1036             rc = E_OUTOFMEMORY;
     1033            hrc = E_OUTOFMEMORY;
    10371034        }
    10381035    }
    10391036
    1040     if (SUCCEEDED(rc))
    1041     {
    1042         rc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
     1037    if (SUCCEEDED(hrc))
     1038    {
     1039        hrc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
    10431040
    10441041        /* Send the original contact information. */
     
    10481045    RTMemTmpFree(pau64Contacts);
    10491046
    1050     return rc;
     1047    return hrc;
    10511048}
    10521049
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