VirtualBox

source: vbox/trunk/include/VBox/HostServices/GuestControlSvc.h@ 28218

最後變更 在這個檔案從28218是 28218,由 vboxsync 提交於 15 年 前

Guest Control: Update (HGCM low level callbacks, bugfixes).

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 5.3 KB
 
1/** @file
2 * Guest control service:
3 * Common header for host service and guest clients.
4 */
5
6/*
7 * Copyright (C) 2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.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 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 *
30 * Sun Microsystems, Inc. confidential
31 * All rights reserved
32 */
33
34#ifndef ___VBox_HostService_GuestControlService_h
35#define ___VBox_HostService_GuestControlService_h
36
37#include <VBox/types.h>
38#include <VBox/VMMDev.h>
39#include <VBox/VBoxGuest2.h>
40#include <VBox/hgcmsvc.h>
41#include <VBox/log.h>
42#include <iprt/assert.h>
43#include <iprt/string.h>
44
45/** Everything defined in this file lives in this namespace. */
46namespace guestControl {
47
48/******************************************************************************
49* Typedefs, constants and inlines *
50******************************************************************************/
51
52/**
53 * Data structure to pass to the service extension callback. We use this to
54 * notify the host of changes to properties.
55 */
56typedef struct _HOSTCALLBACKDATA
57{
58 /** Magic number to identify the structure */
59 uint32_t u32Magic;
60
61} HOSTCALLBACKDATA, *PHOSTCALLBACKDATA;
62
63enum
64{
65 /** Magic number for sanity checking the HOSTCALLBACKDATA structure */
66 HOSTCALLBACKMAGIC = 0x26011982
67};
68
69/**
70 * Process status when executed in the guest.
71 */
72enum eProcessStatus
73{
74 PROC_STATUS_STARTED = 1,
75
76 PROC_STATUS_TERMINATED = 2
77};
78
79/**
80 * The service functions which are callable by host.
81 */
82enum eHostFn
83{
84 /**
85 * The host wants to execute something in the guest. This can be a command line
86 * or starting a program.
87 */
88 HOST_EXEC_CMD = 1,
89 /**
90 * Sends input data for stdin to a running process executed by HOST_EXEC_CMD.
91 */
92 HOST_EXEC_SEND_STDIN = 2,
93 /**
94 * Gets the current status of a running process, e.g.
95 * new data on stdout/stderr, process terminated etc.
96 */
97 HOST_EXEC_GET_STATUS = 3
98};
99
100/**
101 * The service functions which are called by guest. The numbers may not change,
102 * so we hardcode them.
103 */
104enum eGuestFn
105{
106 /**
107 * TODO
108 */
109 GUEST_GET_HOST_MSG = 1,
110 /**
111 * TODO
112 */
113 GUEST_EXEC_SEND_STDOUT = 3,
114 /**
115 * TODO
116 */
117 GUEST_EXEC_SEND_STDERR = 4,
118 /**
119 * TODO
120 */
121 GUEST_EXEC_SEND_STATUS = 5
122};
123
124/**
125 * Sub host commands. These commands are stored as first (=0) parameter in a GUEST_GET_HOST_MSG
126 * so that the guest can react dynamically to requests from the host.
127 */
128enum eGetHostMsgFn
129{
130 /**
131 * The host wants to execute something in the guest. This can be a command line
132 * or starting a program.
133 */
134 GETHOSTMSG_EXEC_CMD = 1,
135 /**
136 * Sends input data for stdin to a running process executed by HOST_EXEC_CMD.
137 */
138 GETHOSTMSG_EXEC_STDIN = 2
139};
140
141/*
142 * HGCM parameter structures.
143 */
144#pragma pack (1)
145typedef struct _VBoxGuestCtrlHGCMMsgType
146{
147 VBoxGuestHGCMCallInfo hdr;
148
149 /**
150 * The returned command the host wants to
151 * execute on the guest.
152 */
153 HGCMFunctionParameter msg; /* OUT uint32_t */
154
155 HGCMFunctionParameter num_parms; /* OUT uint32_t */
156
157} VBoxGuestCtrlHGCMMsgType;
158
159typedef struct _VBoxGuestCtrlHGCMMsgExecCmd
160{
161 VBoxGuestHGCMCallInfo hdr;
162
163 HGCMFunctionParameter cmd;
164
165 HGCMFunctionParameter flags;
166
167 HGCMFunctionParameter num_args;
168
169 HGCMFunctionParameter args;
170
171 HGCMFunctionParameter num_env;
172 /** Size (in bytes) of environment block, including terminating zeros. */
173 HGCMFunctionParameter cb_env;
174
175 HGCMFunctionParameter env;
176
177 HGCMFunctionParameter std_in;
178
179 HGCMFunctionParameter std_out;
180
181 HGCMFunctionParameter std_err;
182
183 HGCMFunctionParameter username;
184
185 HGCMFunctionParameter password;
186
187 HGCMFunctionParameter timeout;
188
189} VBoxGuestCtrlHGCMMsgExecCmd;
190
191typedef struct _VBoxGuestCtrlHGCMMsgExecStatus
192{
193 VBoxGuestHGCMCallInfo hdr;
194
195 HGCMFunctionParameter pid;
196
197 HGCMFunctionParameter status;
198
199 HGCMFunctionParameter flags;
200
201 HGCMFunctionParameter data;
202
203} VBoxGuestCtrlHGCMMsgExecStatus;
204#pragma pack ()
205
206/* Structure for buffering execution requests in the host service. */
207typedef struct _VBoxGuestCtrlParamBuffer
208{
209 uint32_t uParmCount;
210 VBOXHGCMSVCPARM *pParms;
211} VBOXGUESTCTRPARAMBUFFER, *PVBOXGUESTCTRPARAMBUFFER;
212
213} /* namespace guestControl */
214
215#endif /* ___VBox_HostService_GuestControlService_h defined */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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