diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2020-09-01 16:55:10 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2020-09-01 16:55:10 +0000 |
commit | 01b509f774f681a8e0efc138e7cd3c4b7e1bab42 (patch) | |
tree | 008ad03ea9166e70f477434cd43ed8854a2f1689 /src/VBox/HostServices | |
parent | 99790460f17693fa1de7dd66c9a99b10b42081d4 (diff) | |
download | VirtualBox-svn-01b509f774f681a8e0efc138e7cd3c4b7e1bab42.tar.gz |
Shared Clipboard/Host Service: No need to go forth and back between common service and backend-specific code when calling ShClBackendWriteData(). Just call ShClSvcGuestDataReceived() from the common service code after calling ShClBackendWriteData() instead.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@85983 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/HostServices')
4 files changed, 20 insertions, 12 deletions
diff --git a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp index cd850bbb8b9..4bf160cdadf 100644 --- a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp +++ b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp @@ -269,13 +269,15 @@ int ShClBackendWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFOR { RT_NOREF(pCmdCtx); + LogFlowFuncEnter(); + ShClSvcLock(); writeToPasteboard(pClient->State.pCtx->hPasteboard, pClient->State.pCtx->idGuestOwnership, pvData, cbData, fFormat); ShClSvcUnlock(); - return VINF_SUCCESS; + LogFlowFuncLeaveRC(VINF_SUCCESS); } #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS diff --git a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp index d8c889acf3b..56039afbce5 100644 --- a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp +++ b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp @@ -831,12 +831,14 @@ int ShClBackendReadData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, int ShClBackendWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData) { + RT_NOREF(pClient, pCmdCtx, uFormat, pvData, cbData); + LogFlowFuncEnter(); - int rc = ShClSvcGuestDataReceived(pClient, pCmdCtx, uFormat, pvData, cbData); + /* Nothing to do here yet. */ - LogFlowFuncLeaveRC(rc); - return rc; + LogFlowFuncLeave(); + return VINF_SUCCESS; } #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS diff --git a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp index 54affd67c54..20e09b6b593 100644 --- a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp +++ b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp @@ -236,17 +236,14 @@ int ShClBackendReadData(PSHCLCLIENT pClient, int ShClBackendWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData) { - AssertPtrReturn(pClient, VERR_INVALID_POINTER); - AssertPtrReturn(pCmdCtx, VERR_INVALID_POINTER); - AssertPtrReturn(pvData, VERR_INVALID_POINTER); + RT_NOREF(pClient, pCmdCtx, uFormat, pvData, cbData); - LogFlowFunc(("pClient=%p, pv=%p, cb=%RU32, uFormat=%02X\n", - pClient, pvData, cbData, uFormat)); + LogFlowFuncEnter(); - int rc = ShClSvcGuestDataReceived(pClient, pCmdCtx, uFormat, pvData, cbData); + /* Nothing to do here yet. */ - LogFlowFuncLeaveRC(rc); - return rc; + LogFlowFuncLeave(); + return VINF_SUCCESS; } /** diff --git a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp index f9bdeff0f6b..939350099c9 100644 --- a/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp +++ b/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp @@ -1726,8 +1726,15 @@ int shClSvcClientWriteData(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM rc = VINF_SUCCESS; } else + { + /* Let the backend implementation know. */ rc = ShClBackendWriteData(pClient, &cmdCtx, uFormat, pvData, cbData); + int rc2; /* Don't return internals back to the guest. */ + rc2 = ShClSvcGuestDataReceived(pClient, &cmdCtx, uFormat, pvData, cbData); /* To complete pending events, if any. */ + AssertRC(rc2); + } + LogFlowFuncLeaveRC(rc); return rc; } |