VirtualBox

source: vbox/trunk/src/VBox/HostServices/HostChannel/HostChannel.h@ 43462

Last change on this file since 43462 was 43462, checked in by vboxsync, 12 years ago

HGCM Host Channel service: implemented a generic Query function.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1/* @file
2 *
3 * Host Channel
4 */
5
6/*
7 * Copyright (C) 2012 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#ifndef __VBOXHOSTCHANNEL__H
19#define __VBOXHOSTCHANNEL__H
20
21#include <iprt/list.h>
22
23#define LOG_GROUP LOG_GROUP_HGCM
24#include <VBox/log.h>
25#include <VBox/HostServices/VBoxHostChannel.h>
26
27#define HOSTCHLOG Log
28
29#ifdef DEBUG_sunlover
30# undef HOSTCHLOG
31# define HOSTCHLOG LogRel
32#endif /* DEBUG_sunlover */
33
34struct VBOXHOSTCHCTX;
35typedef struct VBOXHOSTCHCTX VBOXHOSTCHCTX;
36
37typedef struct VBOXHOSTCHCLIENT
38{
39 RTLISTNODE nodeClient;
40
41 VBOXHOSTCHCTX *pCtx;
42
43 uint32_t u32ClientID;
44
45 RTLISTANCHOR listChannels;
46 uint32_t volatile u32HandleSrc;
47
48 RTLISTANCHOR listEvents;
49
50 bool fAsync; /* Guest is waiting for a message. */
51
52 struct {
53 VBOXHGCMCALLHANDLE callHandle;
54 VBOXHGCMSVCPARM *paParms;
55 } async;
56
57} VBOXHOSTCHCLIENT;
58
59
60/*
61 * The service functions. Locking is between the service thread and the host channel provider thread.
62 */
63int vboxHostChannelLock(void);
64void vboxHostChannelUnlock(void);
65
66int vboxHostChannelInit(void);
67void vboxHostChannelDestroy(void);
68
69int vboxHostChannelClientConnect(VBOXHOSTCHCLIENT *pClient);
70void vboxHostChannelClientDisconnect(VBOXHOSTCHCLIENT *pClient);
71
72int vboxHostChannelAttach(VBOXHOSTCHCLIENT *pClient,
73 uint32_t *pu32Handle,
74 const char *pszName,
75 uint32_t u32Flags);
76int vboxHostChannelDetach(VBOXHOSTCHCLIENT *pClient,
77 uint32_t u32Handle);
78
79int vboxHostChannelSend(VBOXHOSTCHCLIENT *pClient,
80 uint32_t u32Handle,
81 const void *pvData,
82 uint32_t cbData);
83int vboxHostChannelRecv(VBOXHOSTCHCLIENT *pClient,
84 uint32_t u32Handle,
85 void *pvData,
86 uint32_t cbData,
87 uint32_t *pu32DataReceived,
88 uint32_t *pu32DataRemaining);
89int vboxHostChannelControl(VBOXHOSTCHCLIENT *pClient,
90 uint32_t u32Handle,
91 uint32_t u32Code,
92 void *pvParm,
93 uint32_t cbParm,
94 void *pvData,
95 uint32_t cbData,
96 uint32_t *pu32SizeDataReturned);
97
98int vboxHostChannelQueryEvent(VBOXHOSTCHCLIENT *pClient,
99 bool *pfEvent,
100 uint32_t *pu32Handle,
101 uint32_t *pu32Id,
102 void *pvParm,
103 uint32_t cbParm,
104 uint32_t *pcbParmOut);
105
106int vboxHostChannelQuery(VBOXHOSTCHCLIENT *pClient,
107 const char *pszName,
108 uint32_t u32Code,
109 void *pvParm,
110 uint32_t cbParm,
111 void *pvData,
112 uint32_t cbData,
113 uint32_t *pu32SizeDataReturned);
114
115int vboxHostChannelRegister(const char *pszName,
116 const VBOXHOSTCHANNELINTERFACE *pInterface,
117 uint32_t cbInterface);
118int vboxHostChannelUnregister(const char *pszName);
119
120
121void vboxHostChannelReportAsync(VBOXHOSTCHCLIENT *pClient, uint32_t u32ChannelHandle,
122 uint32_t u32Id, const void *pvEvent, uint32_t cbEvent);
123
124#endif /* __VBOXHOSTCHANNEL__H */
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