VirtualBox

source: vbox/trunk/include/VBox/RemoteDesktop/VRDE.h@ 34744

Last change on this file since 34744 was 34744, checked in by vboxsync, 14 years ago

VRDP: audio input channel: another parameter for VRDEAudioInOpen.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 51.6 KB
Line 
1/** @file
2 * VBox Remote Desktop Extension (VRDE) - Public APIs.
3 */
4
5/*
6 * Copyright (C) 2006-2010 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_RemoteDesktop_VRDE_h
27#define ___VBox_RemoteDesktop_VRDE_h
28
29#include <iprt/cdefs.h>
30#include <iprt/types.h>
31
32/** @defgroup grp_vrdp VRDE
33 * VirtualBox Remote Desktop Extension (VRDE) interface that lets to use
34 * a Remote Desktop server like RDP.
35 * @{
36 */
37
38RT_C_DECLS_BEGIN
39
40/* Forward declaration of the VRDE server instance handle. */
41#ifdef __cplusplus
42class VRDEServer;
43typedef class VRDEServerType *HVRDESERVER;
44#else
45struct VRDEServer;
46typedef struct VRDEServerType *HVRDESERVER;
47#endif /* __cplusplus */
48
49/* Callback based VRDE server interface declarations. */
50
51/** The color mouse pointer information. */
52typedef struct _VRDECOLORPOINTER
53{
54 uint16_t u16HotX;
55 uint16_t u16HotY;
56 uint16_t u16Width;
57 uint16_t u16Height;
58 uint16_t u16MaskLen;
59 uint16_t u16DataLen;
60 /* The 1BPP mask and the 24BPP bitmap follow. */
61} VRDECOLORPOINTER;
62
63/** Audio format information packed in a 32 bit value. */
64typedef uint32_t VRDEAUDIOFORMAT;
65
66/** Constructs 32 bit value for given frequency, number of channel and bits per sample. */
67#define VRDE_AUDIO_FMT_MAKE(freq, c, bps, s) ((((s) & 0x1) << 28) + (((bps) & 0xFF) << 20) + (((c) & 0xF) << 16) + ((freq) & 0xFFFF))
68
69/** Decode frequency. */
70#define VRDE_AUDIO_FMT_SAMPLE_FREQ(a) ((a) & 0xFFFF)
71/** Decode number of channels. */
72#define VRDE_AUDIO_FMT_CHANNELS(a) (((a) >> 16) & 0xF)
73/** Decode number signess. */
74#define VRDE_AUDIO_FMT_SIGNED(a) (((a) >> 28) & 0x1)
75/** Decode number of bits per sample. */
76#define VRDE_AUDIO_FMT_BITS_PER_SAMPLE(a) (((a) >> 20) & 0xFF)
77/** Decode number of bytes per sample. */
78#define VRDE_AUDIO_FMT_BYTES_PER_SAMPLE(a) ((VRDE_AUDIO_FMT_BITS_PER_SAMPLE(a) + 7) / 8)
79
80
81/*
82 * Audio input.
83 */
84
85/* Audio input notifications. */
86#define VRDE_AUDIOIN_BEGIN 1
87#define VRDE_AUDIOIN_DATA 2
88#define VRDE_AUDIOIN_END 3
89
90
91/*
92 * Remote USB protocol.
93 */
94
95/* The initial version 1. */
96#define VRDE_USB_VERSION_1 (1)
97/* Version 2: look for VRDE_USB_VERSION_2 comments in the code. */
98#define VRDE_USB_VERSION_2 (2)
99/* Version 3: look for VRDE_USB_VERSION_3 comments in the code. */
100#define VRDE_USB_VERSION_3 (3)
101
102/* The default VRDE server version of Remote USB Protocol. */
103#define VRDE_USB_VERSION VRDE_USB_VERSION_3
104
105
106/** USB backend operations. */
107#define VRDE_USB_REQ_OPEN (0)
108#define VRDE_USB_REQ_CLOSE (1)
109#define VRDE_USB_REQ_RESET (2)
110#define VRDE_USB_REQ_SET_CONFIG (3)
111#define VRDE_USB_REQ_CLAIM_INTERFACE (4)
112#define VRDE_USB_REQ_RELEASE_INTERFACE (5)
113#define VRDE_USB_REQ_INTERFACE_SETTING (6)
114#define VRDE_USB_REQ_QUEUE_URB (7)
115#define VRDE_USB_REQ_REAP_URB (8)
116#define VRDE_USB_REQ_CLEAR_HALTED_EP (9)
117#define VRDE_USB_REQ_CANCEL_URB (10)
118
119/** USB service operations. */
120#define VRDE_USB_REQ_DEVICE_LIST (11)
121#define VRDE_USB_REQ_NEGOTIATE (12)
122
123/** An operation completion status is a byte. */
124typedef uint8_t VRDEUSBSTATUS;
125
126/** USB device identifier is an 32 bit value. */
127typedef uint32_t VRDEUSBDEVID;
128
129/** Status codes. */
130#define VRDE_USB_STATUS_SUCCESS ((VRDEUSBSTATUS)0)
131#define VRDE_USB_STATUS_ACCESS_DENIED ((VRDEUSBSTATUS)1)
132#define VRDE_USB_STATUS_DEVICE_REMOVED ((VRDEUSBSTATUS)2)
133
134/*
135 * Data structures to use with VRDEUSBRequest.
136 * The *RET* structures always represent the layout of VRDE data.
137 * The *PARM* structures normally the same as VRDE layout.
138 * However the VRDE_USB_REQ_QUEUE_URB_PARM has a pointer to
139 * URB data in place where actual data will be in VRDE layout.
140 *
141 * Since replies (*RET*) are asynchronous, the 'success'
142 * replies are not required for operations which return
143 * only the status code (VRDEUSBREQRETHDR only):
144 * VRDE_USB_REQ_OPEN
145 * VRDE_USB_REQ_RESET
146 * VRDE_USB_REQ_SET_CONFIG
147 * VRDE_USB_REQ_CLAIM_INTERFACE
148 * VRDE_USB_REQ_RELEASE_INTERFACE
149 * VRDE_USB_REQ_INTERFACE_SETTING
150 * VRDE_USB_REQ_CLEAR_HALTED_EP
151 *
152 */
153
154/* VRDE layout has no alignments. */
155#pragma pack(1)
156/* Common header for all VRDE USB packets. After the reply hdr follows *PARM* or *RET* data. */
157typedef struct _VRDEUSBPKTHDR
158{
159 /* Total length of the reply NOT including the 'length' field. */
160 uint32_t length;
161 /* The operation code for which the reply was sent by the client. */
162 uint8_t code;
163} VRDEUSBPKTHDR;
164
165/* Common header for all return structures. */
166typedef struct _VRDEUSBREQRETHDR
167{
168 /* Device status. */
169 VRDEUSBSTATUS status;
170 /* Device id. */
171 VRDEUSBDEVID id;
172} VRDEUSBREQRETHDR;
173
174
175/* VRDE_USB_REQ_OPEN
176 */
177typedef struct _VRDE_USB_REQ_OPEN_PARM
178{
179 uint8_t code;
180 VRDEUSBDEVID id;
181} VRDE_USB_REQ_OPEN_PARM;
182
183typedef struct _VRDE_USB_REQ_OPEN_RET
184{
185 VRDEUSBREQRETHDR hdr;
186} VRDE_USB_REQ_OPEN_RET;
187
188
189/* VRDE_USB_REQ_CLOSE
190 */
191typedef struct _VRDE_USB_REQ_CLOSE_PARM
192{
193 uint8_t code;
194 VRDEUSBDEVID id;
195} VRDE_USB_REQ_CLOSE_PARM;
196
197/* The close request has no returned data. */
198
199
200/* VRDE_USB_REQ_RESET
201 */
202typedef struct _VRDE_USB_REQ_RESET_PARM
203{
204 uint8_t code;
205 VRDEUSBDEVID id;
206} VRDE_USB_REQ_RESET_PARM;
207
208typedef struct _VRDE_USB_REQ_RESET_RET
209{
210 VRDEUSBREQRETHDR hdr;
211} VRDE_USB_REQ_RESET_RET;
212
213
214/* VRDE_USB_REQ_SET_CONFIG
215 */
216typedef struct _VRDE_USB_REQ_SET_CONFIG_PARM
217{
218 uint8_t code;
219 VRDEUSBDEVID id;
220 uint8_t configuration;
221} VRDE_USB_REQ_SET_CONFIG_PARM;
222
223typedef struct _VRDE_USB_REQ_SET_CONFIG_RET
224{
225 VRDEUSBREQRETHDR hdr;
226} VRDE_USB_REQ_SET_CONFIG_RET;
227
228
229/* VRDE_USB_REQ_CLAIM_INTERFACE
230 */
231typedef struct _VRDE_USB_REQ_CLAIM_INTERFACE_PARM
232{
233 uint8_t code;
234 VRDEUSBDEVID id;
235 uint8_t iface;
236} VRDE_USB_REQ_CLAIM_INTERFACE_PARM;
237
238typedef struct _VRDE_USB_REQ_CLAIM_INTERFACE_RET
239{
240 VRDEUSBREQRETHDR hdr;
241} VRDE_USB_REQ_CLAIM_INTERFACE_RET;
242
243
244/* VRDE_USB_REQ_RELEASE_INTERFACE
245 */
246typedef struct _VRDE_USB_REQ_RELEASE_INTERFACE_PARM
247{
248 uint8_t code;
249 VRDEUSBDEVID id;
250 uint8_t iface;
251} VRDE_USB_REQ_RELEASE_INTERFACE_PARM;
252
253typedef struct _VRDE_USB_REQ_RELEASE_INTERFACE_RET
254{
255 VRDEUSBREQRETHDR hdr;
256} VRDE_USB_REQ_RELEASE_INTERFACE_RET;
257
258
259/* VRDE_USB_REQ_INTERFACE_SETTING
260 */
261typedef struct _VRDE_USB_REQ_INTERFACE_SETTING_PARM
262{
263 uint8_t code;
264 VRDEUSBDEVID id;
265 uint8_t iface;
266 uint8_t setting;
267} VRDE_USB_REQ_INTERFACE_SETTING_PARM;
268
269typedef struct _VRDE_USB_REQ_INTERFACE_SETTING_RET
270{
271 VRDEUSBREQRETHDR hdr;
272} VRDE_USB_REQ_INTERFACE_SETTING_RET;
273
274
275/* VRDE_USB_REQ_QUEUE_URB
276 */
277
278#define VRDE_USB_TRANSFER_TYPE_CTRL (0)
279#define VRDE_USB_TRANSFER_TYPE_ISOC (1)
280#define VRDE_USB_TRANSFER_TYPE_BULK (2)
281#define VRDE_USB_TRANSFER_TYPE_INTR (3)
282#define VRDE_USB_TRANSFER_TYPE_MSG (4)
283
284#define VRDE_USB_DIRECTION_SETUP (0)
285#define VRDE_USB_DIRECTION_IN (1)
286#define VRDE_USB_DIRECTION_OUT (2)
287
288typedef struct _VRDE_USB_REQ_QUEUE_URB_PARM
289{
290 uint8_t code;
291 VRDEUSBDEVID id;
292 uint32_t handle; /* Distinguishes that particular URB. Later used in CancelURB and returned by ReapURB */
293 uint8_t type;
294 uint8_t ep;
295 uint8_t direction;
296 uint32_t urblen; /* Length of the URB. */
297 uint32_t datalen; /* Length of the data. */
298 void *data; /* In RDP layout the data follow. */
299} VRDE_USB_REQ_QUEUE_URB_PARM;
300
301/* The queue URB has no explicit return. The reap URB reply will be
302 * eventually the indirect result.
303 */
304
305
306/* VRDE_USB_REQ_REAP_URB
307 * Notificationg from server to client that server expects an URB
308 * from any device.
309 * Only sent if negotiated URB return method is polling.
310 * Normally, the client will send URBs back as soon as they are ready.
311 */
312typedef struct _VRDE_USB_REQ_REAP_URB_PARM
313{
314 uint8_t code;
315} VRDE_USB_REQ_REAP_URB_PARM;
316
317
318#define VRDE_USB_XFER_OK (0)
319#define VRDE_USB_XFER_STALL (1)
320#define VRDE_USB_XFER_DNR (2)
321#define VRDE_USB_XFER_CRC (3)
322/* VRDE_USB_VERSION_2: New error codes. */
323#define VRDE_USB_XFER_BS (4)
324#define VRDE_USB_XFER_DTM (5)
325#define VRDE_USB_XFER_PCF (6)
326#define VRDE_USB_XFER_UPID (7)
327#define VRDE_USB_XFER_DO (8)
328#define VRDE_USB_XFER_DU (9)
329#define VRDE_USB_XFER_BO (10)
330#define VRDE_USB_XFER_BU (11)
331#define VRDE_USB_XFER_ERR (12) /* VBox protocol error. */
332
333#define VRDE_USB_REAP_FLAG_CONTINUED (0x0)
334#define VRDE_USB_REAP_FLAG_LAST (0x1)
335/* VRDE_USB_VERSION_3: Fragmented URBs. */
336#define VRDE_USB_REAP_FLAG_FRAGMENT (0x2)
337
338#define VRDE_USB_REAP_VALID_FLAGS (VRDE_USB_REAP_FLAG_LAST)
339/* VRDE_USB_VERSION_3: Fragmented URBs. */
340#define VRDE_USB_REAP_VALID_FLAGS_3 (VRDE_USB_REAP_FLAG_LAST | VRDE_USB_REAP_FLAG_FRAGMENT)
341
342typedef struct _VRDEUSBREQREAPURBBODY
343{
344 VRDEUSBDEVID id; /* From which device the URB arrives. */
345 uint8_t flags; /* VRDE_USB_REAP_FLAG_* */
346 uint8_t error; /* VRDE_USB_XFER_* */
347 uint32_t handle; /* Handle of returned URB. Not 0. */
348 uint32_t len; /* Length of data actually transferred. */
349 /* 'len' bytes of data follow if direction of this URB was VRDE_USB_DIRECTION_IN. */
350} VRDEUSBREQREAPURBBODY;
351
352typedef struct _VRDE_USB_REQ_REAP_URB_RET
353{
354 /* The REAP URB has no header, only completed URBs are returned. */
355 VRDEUSBREQREAPURBBODY body;
356 /* Another body may follow, depending on flags. */
357} VRDE_USB_REQ_REAP_URB_RET;
358
359
360/* VRDE_USB_REQ_CLEAR_HALTED_EP
361 */
362typedef struct _VRDE_USB_REQ_CLEAR_HALTED_EP_PARM
363{
364 uint8_t code;
365 VRDEUSBDEVID id;
366 uint8_t ep;
367} VRDE_USB_REQ_CLEAR_HALTED_EP_PARM;
368
369typedef struct _VRDE_USB_REQ_CLEAR_HALTED_EP_RET
370{
371 VRDEUSBREQRETHDR hdr;
372} VRDE_USB_REQ_CLEAR_HALTED_EP_RET;
373
374
375/* VRDE_USB_REQ_CANCEL_URB
376 */
377typedef struct _VRDE_USB_REQ_CANCEL_URB_PARM
378{
379 uint8_t code;
380 VRDEUSBDEVID id;
381 uint32_t handle;
382} VRDE_USB_REQ_CANCEL_URB_PARM;
383
384/* The cancel URB request has no return. */
385
386
387/* VRDE_USB_REQ_DEVICE_LIST
388 *
389 * Server polls USB devices on client by sending this request
390 * periodically. Client sends back a list of all devices
391 * connected to it. Each device is assigned with an identifier,
392 * that is used to distinguish the particular device.
393 */
394typedef struct _VRDE_USB_REQ_DEVICE_LIST_PARM
395{
396 uint8_t code;
397} VRDE_USB_REQ_DEVICE_LIST_PARM;
398
399/* Data is a list of the following variable length structures. */
400typedef struct _VRDEUSBDEVICEDESC
401{
402 /* Offset of the next structure. 0 if last. */
403 uint16_t oNext;
404
405 /* Identifier of the device assigned by client. */
406 VRDEUSBDEVID id;
407
408 /** USB version number. */
409 uint16_t bcdUSB;
410 /** Device class. */
411 uint8_t bDeviceClass;
412 /** Device subclass. */
413 uint8_t bDeviceSubClass;
414 /** Device protocol */
415 uint8_t bDeviceProtocol;
416 /** Vendor ID. */
417 uint16_t idVendor;
418 /** Product ID. */
419 uint16_t idProduct;
420 /** Revision, integer part. */
421 uint16_t bcdRev;
422 /** Manufacturer string. */
423 uint16_t oManufacturer;
424 /** Product string. */
425 uint16_t oProduct;
426 /** Serial number string. */
427 uint16_t oSerialNumber;
428 /** Physical USB port the device is connected to. */
429 uint16_t idPort;
430
431} VRDEUSBDEVICEDESC;
432
433typedef struct _VRDE_USB_REQ_DEVICE_LIST_RET
434{
435 VRDEUSBDEVICEDESC body;
436 /* Other devices may follow.
437 * The list ends with (uint16_t)0,
438 * which means that an empty list consists of 2 zero bytes.
439 */
440} VRDE_USB_REQ_DEVICE_LIST_RET;
441
442typedef struct _VRDEUSBREQNEGOTIATEPARM
443{
444 uint8_t code;
445
446 /* Remote USB Protocol version. */
447 /* VRDE_USB_VERSION_3: the 32 bit field is splitted to 16 bit version and 16 bit flags.
448 * Version 1 and 2 servers therefore have 'flags' == 0.
449 * Version 3+ servers can send some capabilities in this field, this way it is possible to add
450 * a new capability without increasing the protocol version.
451 */
452 uint16_t version;
453 uint16_t flags;
454
455} VRDEUSBREQNEGOTIATEPARM;
456
457#define VRDE_USB_CAPS_FLAG_ASYNC (0x0)
458#define VRDE_USB_CAPS_FLAG_POLL (0x1)
459/* VRDE_USB_VERSION_2: New flag. */
460#define VRDE_USB_CAPS2_FLAG_VERSION (0x2) /* The client is negotiating the protocol version. */
461
462
463#define VRDE_USB_CAPS_VALID_FLAGS (VRDE_USB_CAPS_FLAG_POLL)
464/* VRDE_USB_VERSION_2: A set of valid flags. */
465#define VRDE_USB_CAPS2_VALID_FLAGS (VRDE_USB_CAPS_FLAG_POLL | VRDE_USB_CAPS2_FLAG_VERSION)
466
467typedef struct _VRDEUSBREQNEGOTIATERET
468{
469 uint8_t flags;
470} VRDEUSBREQNEGOTIATERET;
471
472typedef struct _VRDEUSBREQNEGOTIATERET_2
473{
474 uint8_t flags;
475 uint32_t u32Version; /* This field presents only if the VRDE_USB_CAPS2_FLAG_VERSION flag is set. */
476} VRDEUSBREQNEGOTIATERET_2;
477#pragma pack()
478
479#define VRDE_CLIPBOARD_FORMAT_NULL (0x0)
480#define VRDE_CLIPBOARD_FORMAT_UNICODE_TEXT (0x1)
481#define VRDE_CLIPBOARD_FORMAT_BITMAP (0x2)
482#define VRDE_CLIPBOARD_FORMAT_HTML (0x4)
483
484#define VRDE_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE (0)
485#define VRDE_CLIPBOARD_FUNCTION_DATA_READ (1)
486#define VRDE_CLIPBOARD_FUNCTION_DATA_WRITE (2)
487
488
489/** Indexes of information values. */
490
491/** Whether a client is connected at the moment.
492 * uint32_t
493 */
494#define VRDE_QI_ACTIVE (0)
495
496/** How many times a client connected up to current moment.
497 * uint32_t
498 */
499#define VRDE_QI_NUMBER_OF_CLIENTS (1)
500
501/** When last connection was established.
502 * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
503 */
504#define VRDE_QI_BEGIN_TIME (2)
505
506/** When last connection was terminated or current time if connection still active.
507 * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
508 */
509#define VRDE_QI_END_TIME (3)
510
511/** How many bytes were sent in last (current) connection.
512 * uint64_t
513 */
514#define VRDE_QI_BYTES_SENT (4)
515
516/** How many bytes were sent in all connections.
517 * uint64_t
518 */
519#define VRDE_QI_BYTES_SENT_TOTAL (5)
520
521/** How many bytes were received in last (current) connection.
522 * uint64_t
523 */
524#define VRDE_QI_BYTES_RECEIVED (6)
525
526/** How many bytes were received in all connections.
527 * uint64_t
528 */
529#define VRDE_QI_BYTES_RECEIVED_TOTAL (7)
530
531/** Login user name supplied by the client.
532 * UTF8 nul terminated string.
533 */
534#define VRDE_QI_USER (8)
535
536/** Login domain supplied by the client.
537 * UTF8 nul terminated string.
538 */
539#define VRDE_QI_DOMAIN (9)
540
541/** The client name supplied by the client.
542 * UTF8 nul terminated string.
543 */
544#define VRDE_QI_CLIENT_NAME (10)
545
546/** IP address of the client.
547 * UTF8 nul terminated string.
548 */
549#define VRDE_QI_CLIENT_IP (11)
550
551/** The client software version number.
552 * uint32_t.
553 */
554#define VRDE_QI_CLIENT_VERSION (12)
555
556/** Public key exchange method used when connection was established.
557 * Values: 0 - RDP4 public key exchange scheme.
558 * 1 - X509 sertificates were sent to client.
559 * uint32_t.
560 */
561#define VRDE_QI_ENCRYPTION_STYLE (13)
562
563/** TCP port where the server listens.
564 * Values: 0 - VRDE server failed to start.
565 * -1 - .
566 * int32_t.
567 */
568#define VRDE_QI_PORT (14)
569
570
571/** Hints what has been intercepted by the application. */
572#define VRDE_CLIENT_INTERCEPT_AUDIO (0x1)
573#define VRDE_CLIENT_INTERCEPT_USB (0x2)
574#define VRDE_CLIENT_INTERCEPT_CLIPBOARD (0x4)
575
576
577/** The version of the VRDE server interface. */
578#define VRDE_INTERFACE_VERSION_1 (1)
579#define VRDE_INTERFACE_VERSION_2 (2)
580#define VRDE_INTERFACE_VERSION_3 (3)
581
582/** The header that does not change when the interface changes. */
583typedef struct _VRDEINTERFACEHDR
584{
585 /** The version of the interface. */
586 uint64_t u64Version;
587
588 /** The size of the structure. */
589 uint64_t u64Size;
590
591} VRDEINTERFACEHDR;
592
593/** The VRDE server entry points. Interface version 1. */
594typedef struct _VRDEENTRYPOINTS_1
595{
596 /** The header. */
597 VRDEINTERFACEHDR header;
598
599 /** Destroy the server instance.
600 *
601 * @param hServer The server instance handle.
602 *
603 * @return IPRT status code.
604 */
605 DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
606
607 /** The server should start to accept clients connections.
608 *
609 * @param hServer The server instance handle.
610 * @param fEnable Whether to enable or disable client connections.
611 * When is false, all existing clients are disconnected.
612 *
613 * @return IPRT status code.
614 */
615 DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
616 bool fEnable));
617
618 /** The server should disconnect the client.
619 *
620 * @param hServer The server instance handle.
621 * @param u32ClientId The client identifier.
622 * @param fReconnect Whether to send a "REDIRECT to the same server" packet to the
623 * client before disconnecting.
624 *
625 * @return IPRT status code.
626 */
627 DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
628 uint32_t u32ClientId,
629 bool fReconnect));
630
631 /**
632 * Inform the server that the display was resized.
633 * The server will query information about display
634 * from the application via callbacks.
635 *
636 * @param hServer Handle of VRDE server instance.
637 */
638 DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
639
640 /**
641 * Send a update.
642 *
643 * @param hServer Handle of VRDE server instance.
644 * @param uScreenId The screen index.
645 * @param pvUpdate Pointer to VBoxGuest.h::VRDEORDERHDR structure with extra data.
646 * @param cbUpdate Size of the update data.
647 */
648 DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
649 unsigned uScreenId,
650 void *pvUpdate,
651 uint32_t cbUpdate));
652
653 /**
654 * Set the mouse pointer shape.
655 *
656 * @param hServer Handle of VRDE server instance.
657 * @param pPointer The pointer shape information.
658 */
659 DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
660 const VRDECOLORPOINTER *pPointer));
661
662 /**
663 * Hide the mouse pointer.
664 *
665 * @param hServer Handle of VRDE server instance.
666 */
667 DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
668
669 /**
670 * Queues the samples to be sent to clients.
671 *
672 * @param hServer Handle of VRDE server instance.
673 * @param pvSamples Address of samples to be sent.
674 * @param cSamples Number of samples.
675 * @param format Encoded audio format for these samples.
676 *
677 * @note Initialized to NULL when the application audio callbacks are NULL.
678 */
679 DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
680 const void *pvSamples,
681 uint32_t cSamples,
682 VRDEAUDIOFORMAT format));
683
684 /**
685 * Sets the sound volume on clients.
686 *
687 * @param hServer Handle of VRDE server instance.
688 * @param left 0..0xFFFF volume level for left channel.
689 * @param right 0..0xFFFF volume level for right channel.
690 *
691 * @note Initialized to NULL when the application audio callbacks are NULL.
692 */
693 DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
694 uint16_t u16Left,
695 uint16_t u16Right));
696
697 /**
698 * Sends a USB request.
699 *
700 * @param hServer Handle of VRDE server instance.
701 * @param u32ClientId An identifier that allows the server to find the corresponding client.
702 * The identifier is always passed by the server as a parameter
703 * of the FNVRDEUSBCALLBACK. Note that the value is the same as
704 * in the VRDESERVERCALLBACK functions.
705 * @param pvParm Function specific parameters buffer.
706 * @param cbParm Size of the buffer.
707 *
708 * @note Initialized to NULL when the application USB callbacks are NULL.
709 */
710 DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
711 uint32_t u32ClientId,
712 void *pvParm,
713 uint32_t cbParm));
714
715 /**
716 * Called by the application when (VRDE_CLIPBOARD_FUNCTION_*):
717 * - (0) guest announces available clipboard formats;
718 * - (1) guest requests clipboard data;
719 * - (2) guest responds to the client's request for clipboard data.
720 *
721 * @param hServer The VRDE server handle.
722 * @param u32Function The cause of the call.
723 * @param u32Format Bitmask of announced formats or the format of data.
724 * @param pvData Points to: (1) buffer to be filled with clients data;
725 * (2) data from the host.
726 * @param cbData Size of 'pvData' buffer in bytes.
727 * @param pcbActualRead Size of the copied data in bytes.
728 *
729 * @note Initialized to NULL when the application clipboard callbacks are NULL.
730 */
731 DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
732 uint32_t u32Function,
733 uint32_t u32Format,
734 void *pvData,
735 uint32_t cbData,
736 uint32_t *pcbActualRead));
737
738 /**
739 * Query various information from the VRDE server.
740 *
741 * @param hServer The VRDE server handle.
742 * @param index VRDE_QI_* identifier of information to be returned.
743 * @param pvBuffer Address of memory buffer to which the information must be written.
744 * @param cbBuffer Size of the memory buffer in bytes.
745 * @param pcbOut Size in bytes of returned information value.
746 *
747 * @remark The caller must check the *pcbOut. 0 there means no information was returned.
748 * A value greater than cbBuffer means that information is too big to fit in the
749 * buffer, in that case no information was placed to the buffer.
750 */
751 DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
752 uint32_t index,
753 void *pvBuffer,
754 uint32_t cbBuffer,
755 uint32_t *pcbOut));
756} VRDEENTRYPOINTS_1;
757
758/** The VRDE server entry points. Interface version 2.
759 * A new entry point VRDERedirect has been added relative to version 1.
760 */
761typedef struct _VRDEENTRYPOINTS_2
762{
763 /** The header. */
764 VRDEINTERFACEHDR header;
765
766 /** Destroy the server instance.
767 *
768 * @param hServer The server instance handle.
769 *
770 * @return IPRT status code.
771 */
772 DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
773
774 /** The server should start to accept clients connections.
775 *
776 * @param hServer The server instance handle.
777 * @param fEnable Whether to enable or disable client connections.
778 * When is false, all existing clients are disconnected.
779 *
780 * @return IPRT status code.
781 */
782 DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
783 bool fEnable));
784
785 /** The server should disconnect the client.
786 *
787 * @param hServer The server instance handle.
788 * @param u32ClientId The client identifier.
789 * @param fReconnect Whether to send a "REDIRECT to the same server" packet to the
790 * client before disconnecting.
791 *
792 * @return IPRT status code.
793 */
794 DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
795 uint32_t u32ClientId,
796 bool fReconnect));
797
798 /**
799 * Inform the server that the display was resized.
800 * The server will query information about display
801 * from the application via callbacks.
802 *
803 * @param hServer Handle of VRDE server instance.
804 */
805 DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
806
807 /**
808 * Send a update.
809 *
810 * @param hServer Handle of VRDE server instance.
811 * @param uScreenId The screen index.
812 * @param pvUpdate Pointer to VBoxGuest.h::VRDEORDERHDR structure with extra data.
813 * @param cbUpdate Size of the update data.
814 */
815 DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
816 unsigned uScreenId,
817 void *pvUpdate,
818 uint32_t cbUpdate));
819
820 /**
821 * Set the mouse pointer shape.
822 *
823 * @param hServer Handle of VRDE server instance.
824 * @param pPointer The pointer shape information.
825 */
826 DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
827 const VRDECOLORPOINTER *pPointer));
828
829 /**
830 * Hide the mouse pointer.
831 *
832 * @param hServer Handle of VRDE server instance.
833 */
834 DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
835
836 /**
837 * Queues the samples to be sent to clients.
838 *
839 * @param hServer Handle of VRDE server instance.
840 * @param pvSamples Address of samples to be sent.
841 * @param cSamples Number of samples.
842 * @param format Encoded audio format for these samples.
843 *
844 * @note Initialized to NULL when the application audio callbacks are NULL.
845 */
846 DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
847 const void *pvSamples,
848 uint32_t cSamples,
849 VRDEAUDIOFORMAT format));
850
851 /**
852 * Sets the sound volume on clients.
853 *
854 * @param hServer Handle of VRDE server instance.
855 * @param left 0..0xFFFF volume level for left channel.
856 * @param right 0..0xFFFF volume level for right channel.
857 *
858 * @note Initialized to NULL when the application audio callbacks are NULL.
859 */
860 DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
861 uint16_t u16Left,
862 uint16_t u16Right));
863
864 /**
865 * Sends a USB request.
866 *
867 * @param hServer Handle of VRDE server instance.
868 * @param u32ClientId An identifier that allows the server to find the corresponding client.
869 * The identifier is always passed by the server as a parameter
870 * of the FNVRDEUSBCALLBACK. Note that the value is the same as
871 * in the VRDESERVERCALLBACK functions.
872 * @param pvParm Function specific parameters buffer.
873 * @param cbParm Size of the buffer.
874 *
875 * @note Initialized to NULL when the application USB callbacks are NULL.
876 */
877 DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
878 uint32_t u32ClientId,
879 void *pvParm,
880 uint32_t cbParm));
881
882 /**
883 * Called by the application when (VRDE_CLIPBOARD_FUNCTION_*):
884 * - (0) guest announces available clipboard formats;
885 * - (1) guest requests clipboard data;
886 * - (2) guest responds to the client's request for clipboard data.
887 *
888 * @param hServer The VRDE server handle.
889 * @param u32Function The cause of the call.
890 * @param u32Format Bitmask of announced formats or the format of data.
891 * @param pvData Points to: (1) buffer to be filled with clients data;
892 * (2) data from the host.
893 * @param cbData Size of 'pvData' buffer in bytes.
894 * @param pcbActualRead Size of the copied data in bytes.
895 *
896 * @note Initialized to NULL when the application clipboard callbacks are NULL.
897 */
898 DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
899 uint32_t u32Function,
900 uint32_t u32Format,
901 void *pvData,
902 uint32_t cbData,
903 uint32_t *pcbActualRead));
904
905 /**
906 * Query various information from the VRDE server.
907 *
908 * @param hServer The VRDE server handle.
909 * @param index VRDE_QI_* identifier of information to be returned.
910 * @param pvBuffer Address of memory buffer to which the information must be written.
911 * @param cbBuffer Size of the memory buffer in bytes.
912 * @param pcbOut Size in bytes of returned information value.
913 *
914 * @remark The caller must check the *pcbOut. 0 there means no information was returned.
915 * A value greater than cbBuffer means that information is too big to fit in the
916 * buffer, in that case no information was placed to the buffer.
917 */
918 DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
919 uint32_t index,
920 void *pvBuffer,
921 uint32_t cbBuffer,
922 uint32_t *pcbOut));
923
924 /**
925 * The server should redirect the client to the specified server.
926 *
927 * @param hServer The server instance handle.
928 * @param u32ClientId The client identifier.
929 * @param pszServer The server to redirect the client to.
930 * @param pszUser The username to use for the redirection.
931 * Can be NULL.
932 * @param pszDomain The domain. Can be NULL.
933 * @param pszPassword The password. Can be NULL.
934 * @param u32SessionId The ID of the session to redirect to.
935 * @param pszCookie The routing token used by a load balancer to
936 * route the redirection. Can be NULL.
937 */
938 DECLR3CALLBACKMEMBER(void, VRDERedirect,(HVRDESERVER hServer,
939 uint32_t u32ClientId,
940 const char *pszServer,
941 const char *pszUser,
942 const char *pszDomain,
943 const char *pszPassword,
944 uint32_t u32SessionId,
945 const char *pszCookie));
946} VRDEENTRYPOINTS_2;
947
948/** The VRDE server entry points. Interface version 3.
949 * A new entry point VRDE has been added relative to version 2.
950 */
951typedef struct _VRDEENTRYPOINTS_3
952{
953 /* The header. */
954 VRDEINTERFACEHDR header;
955
956 /*
957 * Same as version 2.
958 */
959
960 DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
961
962 DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
963 bool fEnable));
964
965 DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
966 uint32_t u32ClientId,
967 bool fReconnect));
968
969 DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
970
971 DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
972 unsigned uScreenId,
973 void *pvUpdate,
974 uint32_t cbUpdate));
975
976 DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
977 const VRDECOLORPOINTER *pPointer));
978
979 DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
980
981 DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
982 const void *pvSamples,
983 uint32_t cSamples,
984 VRDEAUDIOFORMAT format));
985
986 DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
987 uint16_t u16Left,
988 uint16_t u16Right));
989
990 DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
991 uint32_t u32ClientId,
992 void *pvParm,
993 uint32_t cbParm));
994
995 DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
996 uint32_t u32Function,
997 uint32_t u32Format,
998 void *pvData,
999 uint32_t cbData,
1000 uint32_t *pcbActualRead));
1001
1002 DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
1003 uint32_t index,
1004 void *pvBuffer,
1005 uint32_t cbBuffer,
1006 uint32_t *pcbOut));
1007
1008 DECLR3CALLBACKMEMBER(void, VRDERedirect,(HVRDESERVER hServer,
1009 uint32_t u32ClientId,
1010 const char *pszServer,
1011 const char *pszUser,
1012 const char *pszDomain,
1013 const char *pszPassword,
1014 uint32_t u32SessionId,
1015 const char *pszCookie));
1016
1017 /*
1018 * New for version 3.
1019 */
1020
1021 /**
1022 * Audio input open request.
1023 *
1024 * @param hServer Handle of VRDE server instance.
1025 * @param pvCtx To be used in VRDECallbackAudioIn.
1026 * @param u32SamplesPerBlock Preferred number of samples in one block of audio input data.
1027 * @param u32ClientId An identifier that allows the server to find the corresponding client.
1028 * @param audioFormat Requested format of audio data.
1029 *
1030 * @note Initialized to NULL when the VRDECallbackAudioIn callback is NULL.
1031 */
1032 DECLR3CALLBACKMEMBER(void, VRDEAudioInOpen,(HVRDESERVER hServer,
1033 void *pvCtx,
1034 uint32_t u32ClientId,
1035 VRDEAUDIOFORMAT audioFormat,
1036 uint32_t u32SamplesPerBlock));
1037
1038 /**
1039 * Audio input close request.
1040 *
1041 * @param hServer Handle of VRDE server instance.
1042 * @param u32ClientId An identifier that allows the server to find the corresponding client.
1043 *
1044 * @note Initialized to NULL when the VRDECallbackAudioIn callback is NULL.
1045 */
1046 DECLR3CALLBACKMEMBER(void, VRDEAudioInClose,(HVRDESERVER hServer,
1047 uint32_t u32ClientId));
1048} VRDEENTRYPOINTS_3;
1049
1050
1051#define VRDE_QP_NETWORK_PORT (1)
1052#define VRDE_QP_NETWORK_ADDRESS (2)
1053#define VRDE_QP_NUMBER_MONITORS (3)
1054#define VRDE_QP_NETWORK_PORT_RANGE (4)
1055#ifdef VBOX_WITH_VRDP_VIDEO_CHANNEL
1056#define VRDE_QP_VIDEO_CHANNEL (5)
1057#define VRDE_QP_VIDEO_CHANNEL_QUALITY (6)
1058#define VRDE_QP_VIDEO_CHANNEL_SUNFLSH (7)
1059#endif /* VBOX_WITH_VRDP_VIDEO_CHANNEL */
1060#define VRDE_QP_FEATURE (8)
1061
1062#define VRDE_SP_BASE 0x1000
1063#define VRDE_SP_NETWORK_BIND_PORT (VRDE_SP_BASE + 1)
1064
1065#pragma pack(1)
1066/* VRDE_QP_FEATURE data. */
1067typedef struct _VRDEFEATURE
1068{
1069 uint32_t u32ClientId;
1070 char achInfo[1]; /* UTF8 property input name and output value. */
1071} VRDEFEATURE;
1072
1073/* A framebuffer description. */
1074typedef struct _VRDEFRAMEBUFFERINFO
1075{
1076 const uint8_t *pu8Bits;
1077 int xOrigin;
1078 int yOrigin;
1079 unsigned cWidth;
1080 unsigned cHeight;
1081 unsigned cBitsPerPixel;
1082 unsigned cbLine;
1083} VRDEFRAMEBUFFERINFO;
1084
1085#define VRDE_INPUT_SCANCODE 0
1086#define VRDE_INPUT_POINT 1
1087#define VRDE_INPUT_CAD 2
1088#define VRDE_INPUT_RESET 3
1089#define VRDE_INPUT_SYNCH 4
1090
1091typedef struct _VRDEINPUTSCANCODE
1092{
1093 unsigned uScancode;
1094} VRDEINPUTSCANCODE;
1095
1096#define VRDE_INPUT_POINT_BUTTON1 0x01
1097#define VRDE_INPUT_POINT_BUTTON2 0x02
1098#define VRDE_INPUT_POINT_BUTTON3 0x04
1099#define VRDE_INPUT_POINT_WHEEL_UP 0x08
1100#define VRDE_INPUT_POINT_WHEEL_DOWN 0x10
1101
1102typedef struct _VRDEINPUTPOINT
1103{
1104 int x;
1105 int y;
1106 unsigned uButtons;
1107} VRDEINPUTPOINT;
1108
1109#define VRDE_INPUT_SYNCH_SCROLL 0x01
1110#define VRDE_INPUT_SYNCH_NUMLOCK 0x02
1111#define VRDE_INPUT_SYNCH_CAPITAL 0x04
1112
1113typedef struct _VRDEINPUTSYNCH
1114{
1115 unsigned uLockStatus;
1116} VRDEINPUTSYNCH;
1117#pragma pack()
1118
1119/** The VRDE server callbacks. Interface version 1. */
1120typedef struct _VRDECALLBACKS_1
1121{
1122 /** The header. */
1123 VRDEINTERFACEHDR header;
1124
1125 /**
1126 * Query or set various information, on how the VRDE server operates, from or to the application.
1127 *
1128 *
1129 * @param pvCallback The callback specific pointer.
1130 * @param index VRDE_[Q|S]P_* identifier of information to be returned or set.
1131 * @param pvBuffer Address of memory buffer to which the information must be written or read.
1132 * @param cbBuffer Size of the memory buffer in bytes.
1133 * @param pcbOut Size in bytes of returned information value.
1134 *
1135 * @return IPRT status code. VINF_BUFFER_OVERFLOW if the buffer is too small for the value.
1136 */
1137 DECLR3CALLBACKMEMBER(int, VRDECallbackProperty,(void *pvCallback,
1138 uint32_t index,
1139 void *pvBuffer,
1140 uint32_t cbBuffer,
1141 uint32_t *pcbOut));
1142
1143 /* A client is logging in, the application must decide whether
1144 * to let to connect the client. The server will drop the connection,
1145 * when an error code is returned by the callback.
1146 *
1147 * @param pvCallback The callback specific pointer.
1148 * @param u32ClientId An unique client identifier generated by the server.
1149 * @param pszUser The username.
1150 * @param pszPassword The password.
1151 * @param pszDomain The domain.
1152 *
1153 * @return IPRT status code.
1154 */
1155 DECLR3CALLBACKMEMBER(int, VRDECallbackClientLogon,(void *pvCallback,
1156 uint32_t u32ClientId,
1157 const char *pszUser,
1158 const char *pszPassword,
1159 const char *pszDomain));
1160
1161 /* The client has been successfully connected.
1162 *
1163 * @param pvCallback The callback specific pointer.
1164 * @param u32ClientId An unique client identifier generated by the server.
1165 */
1166 DECLR3CALLBACKMEMBER(void, VRDECallbackClientConnect,(void *pvCallback,
1167 uint32_t u32ClientId));
1168
1169 /* The client has been disconnected.
1170 *
1171 * @param pvCallback The callback specific pointer.
1172 * @param u32ClientId An unique client identifier generated by the server.
1173 * @param fu32Intercepted What was intercepted by the client (VRDE_CLIENT_INTERCEPT_*).
1174 */
1175 DECLR3CALLBACKMEMBER(void, VRDECallbackClientDisconnect,(void *pvCallback,
1176 uint32_t u32ClientId,
1177 uint32_t fu32Intercepted));
1178 /* The client supports one of RDP channels.
1179 *
1180 * @param pvCallback The callback specific pointer.
1181 * @param u32ClientId An unique client identifier generated by the server.
1182 * @param fu32Intercept What the client wants to intercept. One of VRDE_CLIENT_INTERCEPT_* flags.
1183 * @param ppvIntercept The value to be passed to the channel specific callback.
1184 *
1185 * @return IPRT status code.
1186 */
1187 DECLR3CALLBACKMEMBER(int, VRDECallbackIntercept,(void *pvCallback,
1188 uint32_t u32ClientId,
1189 uint32_t fu32Intercept,
1190 void **ppvIntercept));
1191
1192 /**
1193 * Called by the server when a reply is received from a client.
1194 *
1195 * @param pvCallback The callback specific pointer.
1196 * @param ppvIntercept The value returned by VRDECallbackIntercept for the VRDE_CLIENT_INTERCEPT_USB.
1197 * @param u32ClientId Identifies the client that sent the reply.
1198 * @param u8Code The operation code VRDE_USB_REQ_*.
1199 * @param pvRet Points to data received from the client.
1200 * @param cbRet Size of the data in bytes.
1201 *
1202 * @return IPRT status code.
1203 */
1204 DECLR3CALLBACKMEMBER(int, VRDECallbackUSB,(void *pvCallback,
1205 void *pvIntercept,
1206 uint32_t u32ClientId,
1207 uint8_t u8Code,
1208 const void *pvRet,
1209 uint32_t cbRet));
1210
1211 /**
1212 * Called by the server when (VRDE_CLIPBOARD_FUNCTION_*):
1213 * - (0) client announces available clipboard formats;
1214 * - (1) client requests clipboard data.
1215 *
1216 * @param pvCallback The callback specific pointer.
1217 * @param ppvIntercept The value returned by VRDECallbackIntercept for the VRDE_CLIENT_INTERCEPT_CLIPBOARD.
1218 * @param u32ClientId Identifies the RDP client that sent the reply.
1219 * @param u32Function The cause of the callback.
1220 * @param u32Format Bitmask of reported formats or the format of received data.
1221 * @param pvData Reserved.
1222 * @param cbData Reserved.
1223 *
1224 * @return IPRT status code.
1225 */
1226 DECLR3CALLBACKMEMBER(int, VRDECallbackClipboard,(void *pvCallback,
1227 void *pvIntercept,
1228 uint32_t u32ClientId,
1229 uint32_t u32Function,
1230 uint32_t u32Format,
1231 const void *pvData,
1232 uint32_t cbData));
1233
1234 /* The framebuffer information is queried.
1235 *
1236 * @param pvCallback The callback specific pointer.
1237 * @param uScreenId The framebuffer index.
1238 * @param pInfo The information structure to ber filled.
1239 *
1240 * @return Whether the framebuffer is available.
1241 */
1242 DECLR3CALLBACKMEMBER(bool, VRDECallbackFramebufferQuery,(void *pvCallback,
1243 unsigned uScreenId,
1244 VRDEFRAMEBUFFERINFO *pInfo));
1245
1246 /* The framebuffer is locked.
1247 *
1248 * @param pvCallback The callback specific pointer.
1249 * @param uScreenId The framebuffer index.
1250 */
1251 DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferLock,(void *pvCallback,
1252 unsigned uScreenId));
1253
1254 /* The framebuffer is unlocked.
1255 *
1256 * @param pvCallback The callback specific pointer.
1257 * @param uScreenId The framebuffer index.
1258 */
1259 DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferUnlock,(void *pvCallback,
1260 unsigned uScreenId));
1261
1262 /* Input from the client.
1263 *
1264 * @param pvCallback The callback specific pointer.
1265 * @param pvInput The input information.
1266 * @param cbInput The size of the input information.
1267 */
1268 DECLR3CALLBACKMEMBER(void, VRDECallbackInput,(void *pvCallback,
1269 int type,
1270 const void *pvInput,
1271 unsigned cbInput));
1272
1273 /* Video mode hint from the client.
1274 *
1275 * @param pvCallback The callback specific pointer.
1276 * @param cWidth Requested width.
1277 * @param cHeight Requested height.
1278 * @param cBitsPerPixel Requested color depth.
1279 * @param uScreenId The framebuffer index.
1280 */
1281 DECLR3CALLBACKMEMBER(void, VRDECallbackVideoModeHint,(void *pvCallback,
1282 unsigned cWidth,
1283 unsigned cHeight,
1284 unsigned cBitsPerPixel,
1285 unsigned uScreenId));
1286
1287} VRDECALLBACKS_1;
1288
1289/* Callbacks are the same for the version 1 and version 2 interfaces. */
1290typedef VRDECALLBACKS_1 VRDECALLBACKS_2;
1291
1292/** The VRDE server callbacks. Interface version 3. */
1293typedef struct _VRDECALLBACKS_3
1294{
1295 /* The header. */
1296 VRDEINTERFACEHDR header;
1297
1298 /*
1299 * Same as in version 2.
1300 */
1301 DECLR3CALLBACKMEMBER(int, VRDECallbackProperty,(void *pvCallback,
1302 uint32_t index,
1303 void *pvBuffer,
1304 uint32_t cbBuffer,
1305 uint32_t *pcbOut));
1306
1307 DECLR3CALLBACKMEMBER(int, VRDECallbackClientLogon,(void *pvCallback,
1308 uint32_t u32ClientId,
1309 const char *pszUser,
1310 const char *pszPassword,
1311 const char *pszDomain));
1312
1313 DECLR3CALLBACKMEMBER(void, VRDECallbackClientConnect,(void *pvCallback,
1314 uint32_t u32ClientId));
1315
1316 DECLR3CALLBACKMEMBER(void, VRDECallbackClientDisconnect,(void *pvCallback,
1317 uint32_t u32ClientId,
1318 uint32_t fu32Intercepted));
1319 DECLR3CALLBACKMEMBER(int, VRDECallbackIntercept,(void *pvCallback,
1320 uint32_t u32ClientId,
1321 uint32_t fu32Intercept,
1322 void **ppvIntercept));
1323
1324 DECLR3CALLBACKMEMBER(int, VRDECallbackUSB,(void *pvCallback,
1325 void *pvIntercept,
1326 uint32_t u32ClientId,
1327 uint8_t u8Code,
1328 const void *pvRet,
1329 uint32_t cbRet));
1330
1331 DECLR3CALLBACKMEMBER(int, VRDECallbackClipboard,(void *pvCallback,
1332 void *pvIntercept,
1333 uint32_t u32ClientId,
1334 uint32_t u32Function,
1335 uint32_t u32Format,
1336 const void *pvData,
1337 uint32_t cbData));
1338
1339 DECLR3CALLBACKMEMBER(bool, VRDECallbackFramebufferQuery,(void *pvCallback,
1340 unsigned uScreenId,
1341 VRDEFRAMEBUFFERINFO *pInfo));
1342
1343 DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferLock,(void *pvCallback,
1344 unsigned uScreenId));
1345
1346 DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferUnlock,(void *pvCallback,
1347 unsigned uScreenId));
1348
1349 DECLR3CALLBACKMEMBER(void, VRDECallbackInput,(void *pvCallback,
1350 int type,
1351 const void *pvInput,
1352 unsigned cbInput));
1353
1354 DECLR3CALLBACKMEMBER(void, VRDECallbackVideoModeHint,(void *pvCallback,
1355 unsigned cWidth,
1356 unsigned cHeight,
1357 unsigned cBitsPerPixel,
1358 unsigned uScreenId));
1359
1360 /*
1361 * New for version 3.
1362 */
1363
1364 /**
1365 * Called by the server when something happens with audio input.
1366 *
1367 * @param pvCallback The callback specific pointer.
1368 * @param pvCtx The value passed in VRDEAudioInOpen.
1369 * @param u32ClientId Identifies the client that sent the reply.
1370 * @param u32Event The event code VRDE_AUDIOIN_*.
1371 * @param pvData Points to data received from the client.
1372 * @param cbData Size of the data in bytes.
1373 */
1374 DECLR3CALLBACKMEMBER(void, VRDECallbackAudioIn,(void *pvCallback,
1375 void *pvCtx,
1376 uint32_t u32ClientId,
1377 uint32_t u32Event,
1378 const void *pvData,
1379 uint32_t cbData));
1380} VRDECALLBACKS_3;
1381
1382/**
1383 * Create a new VRDE server instance. The instance is fully functional but refuses
1384 * client connections until the entry point VRDEEnableConnections is called by the application.
1385 *
1386 * The caller prepares the VRDECALLBACKS_* structure. The header.u64Version field of the
1387 * structure must be initialized with the version of the interface to use.
1388 * The server will return pointer to VRDEENTRYPOINTS_* table in *ppEntryPoints
1389 * to match the requested interface.
1390 * That is if pCallbacks->header.u64Version == VRDE_INTERFACE_VERSION_1, then the server
1391 * expects pCallbacks to point to VRDECALLBACKS_1 and will return a pointer to VRDEENTRYPOINTS_1.
1392 *
1393 * @param pCallback Pointer to the application callbacks which let the server to fetch
1394 * the configuration data and to access the desktop.
1395 * @param pvCallback The callback specific pointer to be passed back to the application.
1396 * @param ppEntryPoints Where to store the pointer to the VRDE entry points structure.
1397 * @param phServer Pointer to the created server instance handle.
1398 *
1399 * @return IPRT status code.
1400 */
1401DECLEXPORT(int) VRDECreateServer (const VRDEINTERFACEHDR *pCallbacks,
1402 void *pvCallback,
1403 VRDEINTERFACEHDR **ppEntryPoints,
1404 HVRDESERVER *phServer);
1405
1406typedef DECLCALLBACK(int) FNVRDECREATESERVER (const VRDEINTERFACEHDR *pCallbacks,
1407 void *pvCallback,
1408 VRDEINTERFACEHDR **ppEntryPoints,
1409 HVRDESERVER *phServer);
1410typedef FNVRDECREATESERVER *PFNVRDECREATESERVER;
1411
1412RT_C_DECLS_END
1413
1414/** @} */
1415
1416#endif
Note: See TracBrowser for help on using the repository browser.

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