1 | /* $Id: SharedClipboardPrivate.cpp 78944 2019-06-03 19:23:38Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Private Shared Clipboard code.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
|
---|
19 | #include "LoggingNew.h"
|
---|
20 |
|
---|
21 | #include <VMMDev.h>
|
---|
22 |
|
---|
23 | #include <VBox/err.h>
|
---|
24 |
|
---|
25 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
|
---|
26 | # include <VBox/GuestHost/SharedClipboard-uri.h>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #include "ConsoleImpl.h"
|
---|
30 | #include "SharedClipboardPrivate.h"
|
---|
31 |
|
---|
32 | SharedClipboard* SharedClipboard::s_pInstance = NULL;
|
---|
33 |
|
---|
34 | SharedClipboard::SharedClipboard(const ComObjPtr<Console> &pConsole)
|
---|
35 | : m_pConsole(pConsole)
|
---|
36 | {
|
---|
37 | LogFlowFuncEnter();
|
---|
38 | }
|
---|
39 |
|
---|
40 | SharedClipboard::~SharedClipboard(void)
|
---|
41 | {
|
---|
42 | LogFlowFuncEnter();
|
---|
43 | }
|
---|
44 |
|
---|
45 | int SharedClipboard::hostCall(uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms) const
|
---|
46 | {
|
---|
47 | /* Forward the information to the VMM device. */
|
---|
48 | Assert(!m_pConsole.isNull());
|
---|
49 | VMMDev *pVMMDev = m_pConsole->i_getVMMDev();
|
---|
50 | if (!pVMMDev)
|
---|
51 | return VERR_COM_OBJECT_NOT_FOUND;
|
---|
52 |
|
---|
53 | return pVMMDev->hgcmHostCall("VBoxSharedClipboard", u32Function, cParms, paParms);
|
---|
54 | }
|
---|
55 |
|
---|
56 | /* static */
|
---|
57 | DECLCALLBACK(int) SharedClipboard::hostServiceCallback(void *pvExtension, uint32_t u32Function,
|
---|
58 | void *pvParms, uint32_t cbParms)
|
---|
59 | {
|
---|
60 | LogFlowFunc(("pvExtension=%p, u32Function=%RU32, pvParms=%p, cbParms=%RU32\n",
|
---|
61 | pvExtension, u32Function, pvParms, cbParms));
|
---|
62 |
|
---|
63 | RT_NOREF(u32Function, pvParms, cbParms);
|
---|
64 |
|
---|
65 | SharedClipboard *pThis = reinterpret_cast<SharedClipboard *>(pvExtension);
|
---|
66 | AssertPtrReturn(pThis, VERR_INVALID_POINTER);
|
---|
67 |
|
---|
68 | int rc = VINF_SUCCESS;
|
---|
69 |
|
---|
70 | LogFlowFuncLeaveRC(rc);
|
---|
71 | return rc;
|
---|
72 | }
|
---|
73 |
|
---|