VirtualBox

source: vbox/trunk/src/VBox/Main/src-client/SharedClipboardPrivate.cpp@ 78750

Last change on this file since 78750 was 78690, checked in by vboxsync, 6 years ago

Shared Clipboard/URI: Build fix.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.2 KB
Line 
1/* $Id: SharedClipboardPrivate.cpp 78690 2019-05-23 11:15:34Z 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#include <VBox/GuestHost/SharedClipboard-uri.h>
25#include <VBox/HostServices/VBoxClipboardSvc.h>
26
27#include "ConsoleImpl.h"
28#include "SharedClipboardPrivate.h"
29
30SharedClipboard* SharedClipboard::s_pInstance = NULL;
31
32SharedClipboard::SharedClipboard(const ComObjPtr<Console> &pConsole)
33 : m_pConsole(pConsole)
34{
35 LogFlowFuncEnter();
36}
37
38SharedClipboard::~SharedClipboard(void)
39{
40 LogFlowFuncEnter();
41}
42
43int SharedClipboard::hostCall(uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms) const
44{
45 /* Forward the information to the VMM device. */
46 Assert(!m_pConsole.isNull());
47 VMMDev *pVMMDev = m_pConsole->i_getVMMDev();
48 if (!pVMMDev)
49 return VERR_COM_OBJECT_NOT_FOUND;
50
51 return pVMMDev->hgcmHostCall("VBoxSharedClipboard", u32Function, cParms, paParms);
52}
53
54/* static */
55DECLCALLBACK(int) SharedClipboard::hostServiceCallback(void *pvExtension, uint32_t u32Function,
56 void *pvParms, uint32_t cbParms)
57{
58 LogFlowFunc(("pvExtension=%p, u32Function=%RU32, pvParms=%p, cbParms=%RU32\n",
59 pvExtension, u32Function, pvParms, cbParms));
60
61 RT_NOREF(pvParms, cbParms);
62
63 SharedClipboard *pSharedClipboard = reinterpret_cast<SharedClipboard *>(pvExtension);
64 AssertPtrReturn(pSharedClipboard, VERR_INVALID_POINTER);
65
66 int rc;
67
68 switch (u32Function)
69 {
70 default:
71 rc = VERR_NOT_SUPPORTED;
72 break;
73 }
74
75 LogFlowFuncLeaveRC(rc);
76 return rc;
77}
78
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette