VirtualBox

Changeset 100609 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 17, 2023 4:45:11 PM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158439
Message:

Shared Clipboard/Main + FE/Qt: Added clipboard error propagation from the host service via a newly added ClipboardErrorEvent. For that we now have a generic (private) Shared Clipboard handling class within Main, which does the HGCM service callback dispatching. The VRDP console object, which was in charge for this before, now is daisy-chained to this new class as a service extension. FE/QT in turn then shows the error(s) via the notification center [build fix]. bugref:9437

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r100606 r100609  
    11921192
    11931193#ifdef VBOX_WITH_SHARED_CLIPBOARD
    1194 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    11951194    /* Service extension for the Shared Clipboard HGCM service. */
    11961195    HGCMSVCEXTHANDLE                    m_hHgcmSvcExtShCl;
    1197 # endif
    11981196#endif
    11991197
  • trunk/src/VBox/Main/src-client/GuestShClPrivate.cpp

    r100606 r100609  
    9191int GuestShCl::lock(void)
    9292{
    93     int rc = RTCritSectEnter(&m_CritSect);
    94     AssertRC(rc);
    95     return rc;
     93    int vrc = RTCritSectEnter(&m_CritSect);
     94    AssertRC(vrc);
     95    return vrc;
    9696}
    9797
     
    103103int GuestShCl::unlock(void)
    104104{
    105     int rc = RTCritSectLeave(&m_CritSect);
    106     AssertRC(rc);
    107     return rc;
     105    int vrc = RTCritSectLeave(&m_CritSect);
     106    AssertRC(vrc);
     107    return vrc;
    108108}
    109109
     
    117117int GuestShCl::RegisterServiceExtension(PFNHGCMSVCEXT pfnExtension, void *pvExtension)
    118118{
     119    AssertPtrReturn(pfnExtension, VERR_INVALID_POINTER);
     120
    119121    lock();
    120122
     
    139141int GuestShCl::UnregisterServiceExtension(PFNHGCMSVCEXT pfnExtension)
    140142{
     143    AssertPtrReturn(pfnExtension, VERR_INVALID_POINTER);
     144
    141145    lock();
    142146
    143147    PSHCLSVCEXT pExt = &this->m_SvcExtVRDP; /* Currently we only have one extension only. */
    144148
    145     Assert(pExt->pfnExt);
    146     Assert(pExt->pfnExt == pfnExtension);
     149    AssertReturnStmt(pExt->pfnExt == pfnExtension, unlock(), VERR_INVALID_PARAMETER);
     150    AssertPtr(pExt->pfnExt);
    147151
    148152    RT_BZERO(pExt, sizeof(SHCLSVCEXT));
     
    228232    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
    229233
    230     int rc = VINF_SUCCESS;
     234    int vrc = VINF_SUCCESS;
    231235
    232236    switch (u32Function)
     
    235239        case VBOX_SHCL_GUEST_FN_REPLY:
    236240        {
    237             rc = pThis->reportError("foo", VERR_ADDRESS_CONFLICT, "bar");
     241            vrc = pThis->reportError("foo", VERR_ADDRESS_CONFLICT, "bar");
    238242            break;
    239243        }
    240244# endif
    241245        case VBOX_SHCL_GUEST_FN_ERROR:
    242             rc = pThis->reportError("foo", VERR_ADDRESS_CONFLICT, "bar");
     246            vrc = pThis->reportError("foo", VERR_ADDRESS_CONFLICT, "bar");
    243247            break;
    244248
     
    251255    if (pExt->pfnExt)
    252256    {
    253         int rc2 = pExt->pfnExt(pExt->pvExt, u32Function, pvParms, cbParms);
    254         if (RT_SUCCESS(rc))
    255             rc = rc2;
     257        int vrc2 = pExt->pfnExt(pExt->pvExt, u32Function, pvParms, cbParms);
     258        if (RT_SUCCESS(vrc))
     259            vrc = vrc2;
    256260    }
    257261
    258     LogFlowFuncLeaveRC(rc);
    259     return rc; /* Goes back to host service. */
     262    LogFlowFuncLeaveRC(vrc);
     263    return vrc; /* Goes back to host service. */
    260264}
    261265#endif /* VBOX_WITH_SHARED_CLIPBOARD */
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