VRDE.h revision 89c895806bf972d689cad5f196a2e108ae6b11ae
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** @file
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VBox Remote Desktop Extension (VRDE) - Public APIs.
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/*
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Copyright (C) 2006-2011 Oracle Corporation
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * available from http://www.virtualbox.org. This file is free software;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * General Public License (GPL) as published by the Free Software
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * The contents of this file may alternatively be used under the terms
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * of the Common Development and Distribution License Version 1.0
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VirtualBox OSE distribution, in which case the provisions of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * CDDL are applicable instead of those of the GPL.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * You may elect to license modified versions of this file under the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * terms and conditions of either the GPL or the CDDL or both.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#ifndef ___VBox_RemoteDesktop_VRDE_h
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define ___VBox_RemoteDesktop_VRDE_h
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#include <iprt/cdefs.h>
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#include <iprt/types.h>
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** @defgroup grp_vrdp VRDE
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VirtualBox Remote Desktop Extension (VRDE) interface that lets to use
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * a Remote Desktop server like RDP.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncRT_C_DECLS_BEGIN
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* Forward declaration of the VRDE server instance handle.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * This is an opaque pointer for VirtualBox.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * The VRDE library uses it as a pointer to some internal data.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#ifdef __cplusplus
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncclass VRDEServer;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef class VRDEServerType *HVRDESERVER;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#else
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncstruct VRDEServer;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct VRDEServerType *HVRDESERVER;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#endif /* !__cplusplus */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* Callback based VRDE server interface declarations. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** The color mouse pointer information. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDECOLORPOINTER
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16HotX;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16HotY;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync uint16_t u16Width;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16Height;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16MaskLen;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16DataLen;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /* The 1BPP mask and the 24BPP bitmap follow. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDECOLORPOINTER;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync/** Audio format information packed in a 32 bit value. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef uint32_t VRDEAUDIOFORMAT;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync/** Constructs 32 bit value for given frequency, number of channel and bits per sample. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_AUDIO_FMT_MAKE(freq, c, bps, s) ((((s) & 0x1) << 28) + (((bps) & 0xFF) << 20) + (((c) & 0xF) << 16) + ((freq) & 0xFFFF))
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync/** Decode frequency. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_AUDIO_FMT_SAMPLE_FREQ(a) ((a) & 0xFFFF)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** Decode number of channels. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_AUDIO_FMT_CHANNELS(a) (((a) >> 16) & 0xF)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** Decode number signess. */
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync#define VRDE_AUDIO_FMT_SIGNED(a) (((a) >> 28) & 0x1)
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync/** Decode number of bits per sample. */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VRDE_AUDIO_FMT_BITS_PER_SAMPLE(a) (((a) >> 20) & 0xFF)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** Decode number of bytes per sample. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_AUDIO_FMT_BYTES_PER_SAMPLE(a) ((VRDE_AUDIO_FMT_BITS_PER_SAMPLE(a) + 7) / 8)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/*
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * Audio input.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* Audio input notifications. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_AUDIOIN_BEGIN 1
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_AUDIOIN_DATA 2
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_AUDIOIN_END 3
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct VRDEAUDIOINBEGIN
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEAUDIOFORMAT fmt; /* Actual format of data, which will be sent in VRDE_AUDIOIN_DATA events. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDEAUDIOINBEGIN;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/*
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * Remote USB protocol.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* The initial version 1. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_VERSION_1 (1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* Version 2: look for VRDE_USB_VERSION_2 comments in the code. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_VERSION_2 (2)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* Version 3: look for VRDE_USB_VERSION_3 comments in the code. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_VERSION_3 (3)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* The default VRDE server version of Remote USB Protocol. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_VERSION VRDE_USB_VERSION_3
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** USB backend operations. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_REQ_OPEN (0)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_REQ_CLOSE (1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_REQ_RESET (2)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_REQ_SET_CONFIG (3)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_REQ_CLAIM_INTERFACE (4)
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VRDE_USB_REQ_RELEASE_INTERFACE (5)
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VRDE_USB_REQ_INTERFACE_SETTING (6)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_REQ_QUEUE_URB (7)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_REQ_REAP_URB (8)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_USB_REQ_CLEAR_HALTED_EP (9)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_REQ_CANCEL_URB (10)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** USB service operations. */
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync#define VRDE_USB_REQ_DEVICE_LIST (11)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_USB_REQ_NEGOTIATE (12)
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync/** An operation completion status is a byte. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef uint8_t VRDEUSBSTATUS;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** USB device identifier is an 32 bit value. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef uint32_t VRDEUSBDEVID;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** Status codes. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_STATUS_SUCCESS ((VRDEUSBSTATUS)0)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_STATUS_ACCESS_DENIED ((VRDEUSBSTATUS)1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_STATUS_DEVICE_REMOVED ((VRDEUSBSTATUS)2)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/*
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * Data structures to use with VRDEUSBRequest.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * The *RET* structures always represent the layout of VRDE data.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * The *PARM* structures normally the same as VRDE layout.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * However the VRDE_USB_REQ_QUEUE_URB_PARM has a pointer to
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * URB data in place where actual data will be in VRDE layout.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Since replies (*RET*) are asynchronous, the 'success'
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * replies are not required for operations which return
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * only the status code (VRDEUSBREQRETHDR only):
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * VRDE_USB_REQ_OPEN
445661c86e95894713da707c6c9787b7507dfce6vboxsync * VRDE_USB_REQ_RESET
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * VRDE_USB_REQ_SET_CONFIG
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * VRDE_USB_REQ_CLAIM_INTERFACE
445661c86e95894713da707c6c9787b7507dfce6vboxsync * VRDE_USB_REQ_RELEASE_INTERFACE
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * VRDE_USB_REQ_INTERFACE_SETTING
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * VRDE_USB_REQ_CLEAR_HALTED_EP
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync *
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* VRDE layout has no alignments. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#pragma pack(1)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* Common header for all VRDE USB packets. After the reply hdr follows *PARM* or *RET* data. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDEUSBPKTHDR
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /* Total length of the reply NOT including the 'length' field. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint32_t length;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /* The operation code for which the reply was sent by the client. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint8_t code;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync} VRDEUSBPKTHDR;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/* Common header for all return structures. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef struct _VRDEUSBREQRETHDR
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync /* Device status. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync VRDEUSBSTATUS status;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /* Device id. */
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync VRDEUSBDEVID id;
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync} VRDEUSBREQRETHDR;
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync/* VRDE_USB_REQ_OPEN
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync */
c889bbab784ba8552102ce776b6c67b982017861vboxsynctypedef struct _VRDE_USB_REQ_OPEN_PARM
c889bbab784ba8552102ce776b6c67b982017861vboxsync{
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync uint8_t code;
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync VRDEUSBDEVID id;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync} VRDE_USB_REQ_OPEN_PARM;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef struct _VRDE_USB_REQ_OPEN_RET
c5d2523548cc57504b829f53f1362b848a84542cvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync VRDEUSBREQRETHDR hdr;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_OPEN_RET;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* VRDE_USB_REQ_CLOSE
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_CLOSE_PARM
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t code;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync VRDEUSBDEVID id;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDE_USB_REQ_CLOSE_PARM;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
771c393ea3dea8143cabc5c8ff6b5cd38a1db91evboxsync/* The close request has no returned data. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
234af146205f61c4aa0be736abb06601a89facb8vboxsync
234af146205f61c4aa0be736abb06601a89facb8vboxsync/* VRDE_USB_REQ_RESET
234af146205f61c4aa0be736abb06601a89facb8vboxsync */
234af146205f61c4aa0be736abb06601a89facb8vboxsynctypedef struct _VRDE_USB_REQ_RESET_PARM
234af146205f61c4aa0be736abb06601a89facb8vboxsync{
234af146205f61c4aa0be736abb06601a89facb8vboxsync uint8_t code;
234af146205f61c4aa0be736abb06601a89facb8vboxsync VRDEUSBDEVID id;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_RESET_PARM;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDE_USB_REQ_RESET_RET
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync{
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync VRDEUSBREQRETHDR hdr;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_RESET_RET;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/* VRDE_USB_REQ_SET_CONFIG
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDE_USB_REQ_SET_CONFIG_PARM
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync uint8_t code;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync VRDEUSBDEVID id;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint8_t configuration;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_SET_CONFIG_PARM;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDE_USB_REQ_SET_CONFIG_RET
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync{
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync VRDEUSBREQRETHDR hdr;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_SET_CONFIG_RET;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* VRDE_USB_REQ_CLAIM_INTERFACE
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_CLAIM_INTERFACE_PARM
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t code;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBDEVID id;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t iface;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_CLAIM_INTERFACE_PARM;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_CLAIM_INTERFACE_RET
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBREQRETHDR hdr;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_CLAIM_INTERFACE_RET;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* VRDE_USB_REQ_RELEASE_INTERFACE
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_RELEASE_INTERFACE_PARM
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t code;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBDEVID id;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t iface;
1829a716128b3e2d42bcee064a15c553dbd44798vboxsync} VRDE_USB_REQ_RELEASE_INTERFACE_PARM;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_RELEASE_INTERFACE_RET
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBREQRETHDR hdr;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_RELEASE_INTERFACE_RET;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync/* VRDE_USB_REQ_INTERFACE_SETTING
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_INTERFACE_SETTING_PARM
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t code;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBDEVID id;
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync uint8_t iface;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t setting;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_INTERFACE_SETTING_PARM;
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsynctypedef struct _VRDE_USB_REQ_INTERFACE_SETTING_RET
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBREQRETHDR hdr;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDE_USB_REQ_INTERFACE_SETTING_RET;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* VRDE_USB_REQ_QUEUE_URB
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_TRANSFER_TYPE_CTRL (0)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_TRANSFER_TYPE_ISOC (1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_TRANSFER_TYPE_BULK (2)
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_USB_TRANSFER_TYPE_INTR (3)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_TRANSFER_TYPE_MSG (4)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_DIRECTION_SETUP (0)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_DIRECTION_IN (1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_USB_DIRECTION_OUT (2)
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_QUEUE_URB_PARM
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t code;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBDEVID id;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint32_t handle; /* Distinguishes that particular URB. Later used in CancelURB and returned by ReapURB */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t type;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint8_t ep;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint8_t direction;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t urblen; /* Length of the URB. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint32_t datalen; /* Length of the data. */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync void *data; /* In RDP layout the data follow. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync} VRDE_USB_REQ_QUEUE_URB_PARM;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* The queue URB has no explicit return. The reap URB reply will be
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * eventually the indirect result.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
771c393ea3dea8143cabc5c8ff6b5cd38a1db91evboxsync/* VRDE_USB_REQ_REAP_URB
234af146205f61c4aa0be736abb06601a89facb8vboxsync * Notificationg from server to client that server expects an URB
234af146205f61c4aa0be736abb06601a89facb8vboxsync * from any device.
234af146205f61c4aa0be736abb06601a89facb8vboxsync * Only sent if negotiated URB return method is polling.
234af146205f61c4aa0be736abb06601a89facb8vboxsync * Normally, the client will send URBs back as soon as they are ready.
234af146205f61c4aa0be736abb06601a89facb8vboxsync */
234af146205f61c4aa0be736abb06601a89facb8vboxsynctypedef struct _VRDE_USB_REQ_REAP_URB_PARM
234af146205f61c4aa0be736abb06601a89facb8vboxsync{
234af146205f61c4aa0be736abb06601a89facb8vboxsync uint8_t code;
234af146205f61c4aa0be736abb06601a89facb8vboxsync} VRDE_USB_REQ_REAP_URB_PARM;
234af146205f61c4aa0be736abb06601a89facb8vboxsync
234af146205f61c4aa0be736abb06601a89facb8vboxsync
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_OK (0)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_STALL (1)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_DNR (2)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_CRC (3)
234af146205f61c4aa0be736abb06601a89facb8vboxsync/* VRDE_USB_VERSION_2: New error codes. */
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_BS (4)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_DTM (5)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_PCF (6)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_UPID (7)
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync#define VRDE_USB_XFER_DO (8)
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync#define VRDE_USB_XFER_DU (9)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_BO (10)
234af146205f61c4aa0be736abb06601a89facb8vboxsync#define VRDE_USB_XFER_BU (11)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_USB_XFER_ERR (12) /* VBox protocol error. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#define VRDE_USB_REAP_FLAG_CONTINUED (0x0)
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#define VRDE_USB_REAP_FLAG_LAST (0x1)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/* VRDE_USB_VERSION_3: Fragmented URBs. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_USB_REAP_FLAG_FRAGMENT (0x2)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_REAP_VALID_FLAGS (VRDE_USB_REAP_FLAG_LAST)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/* VRDE_USB_VERSION_3: Fragmented URBs. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_USB_REAP_VALID_FLAGS_3 (VRDE_USB_REAP_FLAG_LAST | VRDE_USB_REAP_FLAG_FRAGMENT)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef struct _VRDEUSBREQREAPURBBODY
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync VRDEUSBDEVID id; /* From which device the URB arrives. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint8_t flags; /* VRDE_USB_REAP_FLAG_* */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint8_t error; /* VRDE_USB_XFER_* */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint32_t handle; /* Handle of returned URB. Not 0. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t len; /* Length of data actually transferred. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /* 'len' bytes of data follow if direction of this URB was VRDE_USB_DIRECTION_IN. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync} VRDEUSBREQREAPURBBODY;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
234af146205f61c4aa0be736abb06601a89facb8vboxsynctypedef struct _VRDE_USB_REQ_REAP_URB_RET
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync /* The REAP URB has no header, only completed URBs are returned. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync VRDEUSBREQREAPURBBODY body;
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync /* Another body may follow, depending on flags. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_REAP_URB_RET;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* VRDE_USB_REQ_CLEAR_HALTED_EP
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsynctypedef struct _VRDE_USB_REQ_CLEAR_HALTED_EP_PARM
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync{
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync uint8_t code;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync VRDEUSBDEVID id;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync uint8_t ep;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync} VRDE_USB_REQ_CLEAR_HALTED_EP_PARM;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync
ee6e48c229ef52aee5e968d956ebd066073811abvboxsynctypedef struct _VRDE_USB_REQ_CLEAR_HALTED_EP_RET
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync{
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync VRDEUSBREQRETHDR hdr;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_CLEAR_HALTED_EP_RET;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* VRDE_USB_REQ_CANCEL_URB
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsynctypedef struct _VRDE_USB_REQ_CANCEL_URB_PARM
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint8_t code;
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync VRDEUSBDEVID id;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t handle;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_CANCEL_URB_PARM;
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* The cancel URB request has no return. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/* VRDE_USB_REQ_DEVICE_LIST
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync *
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * Server polls USB devices on client by sending this request
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * periodically. Client sends back a list of all devices
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * connected to it. Each device is assigned with an identifier,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * that is used to distinguish the particular device.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsynctypedef struct _VRDE_USB_REQ_DEVICE_LIST_PARM
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint8_t code;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDE_USB_REQ_DEVICE_LIST_PARM;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* Data is a list of the following variable length structures. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef struct _VRDEUSBDEVICEDESC
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /* Offset of the next structure. 0 if last. */
041d531fb5794a8a4cf6c35886d89ec25cbbdde2vboxsync uint16_t oNext;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync /* Identifier of the device assigned by client. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync VRDEUSBDEVID id;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync /** USB version number. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint16_t bcdUSB;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Device class. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint8_t bDeviceClass;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Device subclass. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint8_t bDeviceSubClass;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Device protocol */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint8_t bDeviceProtocol;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Vendor ID. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t idVendor;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Product ID. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t idProduct;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Revision, integer part. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t bcdRev;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Offset of the UTF8 manufacturer string relative to the structure start. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint16_t oManufacturer;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /** Offset of the UTF8 product string relative to the structure start. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t oProduct;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /** Offset of the UTF8 serial number string relative to the structure start. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t oSerialNumber;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /** Physical USB port the device is connected to. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t idPort;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDEUSBDEVICEDESC;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_USBDEVICESPEED_UNKNOWN 0 /* Unknown. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_USBDEVICESPEED_LOW 1 /* Low speed (1.5 Mbit/s). */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_USBDEVICESPEED_FULL 2 /* Full speed (12 Mbit/s). */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_USBDEVICESPEED_HIGH 3 /* High speed (480 Mbit/s). */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_USBDEVICESPEED_VARIABLE 4 /* Variable speed - USB 2.5 / wireless. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_USBDEVICESPEED_SUPERSPEED 5 /* Super Speed - USB 3.0 */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef struct _VRDEUSBDEVICEDESCEXT
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEUSBDEVICEDESC desc;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /* Extended info.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /** The USB device speed: VRDE_USBDEVICESPEED_*. */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16DeviceSpeed;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDEUSBDEVICEDESCEXT;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDE_USB_REQ_DEVICE_LIST_RET
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync VRDEUSBDEVICEDESC body;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /* Other devices may follow.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * The list ends with (uint16_t)0,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * which means that an empty list consists of 2 zero bytes.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync} VRDE_USB_REQ_DEVICE_LIST_RET;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef struct _VRDE_USB_REQ_DEVICE_LIST_EXT_RET
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync VRDEUSBDEVICEDESCEXT body;
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /* Other devices may follow.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * The list ends with (uint16_t)0,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * which means that an empty list consists of 2 zero bytes.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDE_USB_REQ_DEVICE_LIST_EXT_RET;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync/* The server requests the version of the port the device is attached to.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * The client must use VRDEUSBDEVICEDESCEXT structure.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VRDE_USB_SERVER_CAPS_PORT_VERSION 0x0001
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef struct _VRDEUSBREQNEGOTIATEPARM
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint8_t code;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync /* Remote USB Protocol version. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync /* VRDE_USB_VERSION_3: the 32 bit field is splitted to 16 bit version and 16 bit flags.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * Version 1 and 2 servers therefore have 'flags' == 0.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * Version 3+ servers can send some capabilities in this field, this way it is possible to add
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * a new capability without increasing the protocol version.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync uint16_t version;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync uint16_t flags; /* See VRDE_USB_SERVER_CAPS_* */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync} VRDEUSBREQNEGOTIATEPARM;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync/* VRDEUSBREQNEGOTIATERET flags. */
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync#define VRDE_USB_CAPS_FLAG_ASYNC (0x0)
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_USB_CAPS_FLAG_POLL (0x1)
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync/* VRDE_USB_VERSION_2: New flag. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_USB_CAPS2_FLAG_VERSION (0x2) /* The client is negotiating the protocol version. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync/* VRDE_USB_VERSION_3: New flag. */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync#define VRDE_USB_CAPS3_FLAG_EXT (0x4) /* The client is negotiating the extended flags.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * If this flag is set, then the VRDE_USB_CAPS2_FLAG_VERSION
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * must also be set.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_CAPS_VALID_FLAGS (VRDE_USB_CAPS_FLAG_POLL)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* VRDE_USB_VERSION_2: A set of valid flags. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_CAPS2_VALID_FLAGS (VRDE_USB_CAPS_FLAG_POLL | VRDE_USB_CAPS2_FLAG_VERSION)
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/* VRDE_USB_VERSION_3: A set of valid flags. */
c5d2523548cc57504b829f53f1362b848a84542cvboxsync#define VRDE_USB_CAPS3_VALID_FLAGS (VRDE_USB_CAPS_FLAG_POLL | VRDE_USB_CAPS2_FLAG_VERSION | VRDE_USB_CAPS3_FLAG_EXT)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsynctypedef struct _VRDEUSBREQNEGOTIATERET
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync{
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync uint8_t flags;
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync} VRDEUSBREQNEGOTIATERET;
c5d2523548cc57504b829f53f1362b848a84542cvboxsync
c5d2523548cc57504b829f53f1362b848a84542cvboxsynctypedef struct _VRDEUSBREQNEGOTIATERET_2
c5d2523548cc57504b829f53f1362b848a84542cvboxsync{
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync uint8_t flags;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t u32Version; /* This field presents only if the VRDE_USB_CAPS2_FLAG_VERSION flag is set. */
a9ed90fc7da3c371bc3b96c8535655b87836fcadvboxsync} VRDEUSBREQNEGOTIATERET_2;
8929a16e87a515b7071399479548158b8c5fbdd2vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/* The server requests the version of the port the device is attached to.
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync * The client must use VRDEUSBDEVICEDESCEXT structure.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_USB_CLIENT_CAPS_PORT_VERSION 0x00000001
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
ee6e48c229ef52aee5e968d956ebd066073811abvboxsynctypedef struct _VRDEUSBREQNEGOTIATERET_3
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint8_t flags;
e4527e0a08e2d635a679ae2947d42195f30a2ce2vboxsync uint32_t u32Version; /* This field presents only if the VRDE_USB_CAPS2_FLAG_VERSION flag is set. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t u32Flags; /* This field presents only if both VRDE_USB_CAPS2_FLAG_VERSION and
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VRDE_USB_CAPS2_FLAG_EXT flag are set.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * See VRDE_USB_CLIENT_CAPS_*
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync} VRDEUSBREQNEGOTIATERET_3;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#pragma pack()
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_CLIPBOARD_FORMAT_NULL (0x0)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_CLIPBOARD_FORMAT_UNICODE_TEXT (0x1)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_CLIPBOARD_FORMAT_BITMAP (0x2)
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync#define VRDE_CLIPBOARD_FORMAT_HTML (0x4)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE (0)
db3d025f28c59aececbbda4174fa513496c89b2bvboxsync#define VRDE_CLIPBOARD_FUNCTION_DATA_READ (1)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_CLIPBOARD_FUNCTION_DATA_WRITE (2)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** Indexes of information values. */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync/** Whether a client is connected at the moment.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * uint32_t
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_QI_ACTIVE (0)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** How many times a client connected up to current moment.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * uint32_t
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync#define VRDE_QI_NUMBER_OF_CLIENTS (1)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** When last connection was established.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_QI_BEGIN_TIME (2)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** When last connection was terminated or current time if connection still active.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * int64_t time in milliseconds since 1970-01-01 00:00:00 UTC
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_QI_END_TIME (3)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** How many bytes were sent in last (current) connection.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * uint64_t
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_QI_BYTES_SENT (4)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** How many bytes were sent in all connections.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * uint64_t
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync */
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync#define VRDE_QI_BYTES_SENT_TOTAL (5)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** How many bytes were received in last (current) connection.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * uint64_t
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_QI_BYTES_RECEIVED (6)
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** How many bytes were received in all connections.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * uint64_t
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync#define VRDE_QI_BYTES_RECEIVED_TOTAL (7)
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync
7f18b4c79440e724c5e08f007674ea7883ce6c01vboxsync/** Login user name supplied by the client.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * UTF8 nul terminated string.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define VRDE_QI_USER (8)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** Login domain supplied by the client.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * UTF8 nul terminated string.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_QI_DOMAIN (9)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** The client name supplied by the client.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * UTF8 nul terminated string.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#define VRDE_QI_CLIENT_NAME (10)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** IP address of the client.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * UTF8 nul terminated string.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_QI_CLIENT_IP (11)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync/** The client software version number.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * uint32_t.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync */
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync#define VRDE_QI_CLIENT_VERSION (12)
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync/** Public key exchange method used when connection was established.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * Values: 0 - RDP4 public key exchange scheme.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * 1 - X509 sertificates were sent to client.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * uint32_t.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_QI_ENCRYPTION_STYLE (13)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** TCP port where the server listens.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * Values: 0 - VRDE server failed to start.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * -1 - .
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * int32_t.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_QI_PORT (14)
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** Hints what has been intercepted by the application. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_CLIENT_INTERCEPT_AUDIO (0x1)
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync#define VRDE_CLIENT_INTERCEPT_USB (0x2)
0ff2f0d33dea0e82857c2131d43f637c206a8163vboxsync#define VRDE_CLIENT_INTERCEPT_CLIPBOARD (0x4)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_CLIENT_INTERCEPT_AUDIO_INPUT (0x8)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync/** The version of the VRDE server interface. */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#define VRDE_INTERFACE_VERSION_1 (1)
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync#define VRDE_INTERFACE_VERSION_2 (2)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_INTERFACE_VERSION_3 (3)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#define VRDE_INTERFACE_VERSION_4 (4)
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** The header that does not change when the interface changes. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef struct _VRDEINTERFACEHDR
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync /** The version of the interface. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync uint64_t u64Version;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /** The size of the structure. */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync uint64_t u64Size;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync} VRDEINTERFACEHDR;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** The VRDE server entry points. Interface version 1. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef struct _VRDEENTRYPOINTS_1
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync{
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /** The header. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync VRDEINTERFACEHDR header;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /** Destroy the server instance.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync *
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * @param hServer The server instance handle.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync *
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @return IPRT status code.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /** The server should start to accept clients connections.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync *
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param hServer The server instance handle.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param fEnable Whether to enable or disable client connections.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * When is false, all existing clients are disconnected.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @return IPRT status code.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync bool fEnable));
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync /** The server should disconnect the client.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
c5d2523548cc57504b829f53f1362b848a84542cvboxsync * @param hServer The server instance handle.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param u32ClientId The client identifier.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param fReconnect Whether to send a "REDIRECT to the same server" packet to the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * client before disconnecting.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * @return IPRT status code.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync uint32_t u32ClientId,
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync bool fReconnect));
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync /**
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * Inform the server that the display was resized.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * The server will query information about display
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * from the application via callbacks.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync *
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * @param hServer Handle of VRDE server instance.
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
a9ed90fc7da3c371bc3b96c8535655b87836fcadvboxsync /**
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Send a update.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
c889bbab784ba8552102ce776b6c67b982017861vboxsync * Note: the server must access the framebuffer bitmap only when VRDEUpdate is called.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * If the have to access the bitmap later or from another thread, then
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * it must used an intermediate buffer and copy the framebuffer data to the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * intermediate buffer in VRDEUpdate.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync *
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * @param hServer Handle of VRDE server instance.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync * @param uScreenId The screen index.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param pvUpdate Pointer to VRDEOrders.h::VRDEORDERHDR structure with extra data.
c5d2523548cc57504b829f53f1362b848a84542cvboxsync * @param cbUpdate Size of the update data.
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync */
ad1e35f9fb71d147c2126449a25adf0f8e155aaavboxsync DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync unsigned uScreenId,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync void *pvUpdate,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint32_t cbUpdate));
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync /**
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * Set the mouse pointer shape.
c889bbab784ba8552102ce776b6c67b982017861vboxsync *
c889bbab784ba8552102ce776b6c67b982017861vboxsync * @param hServer Handle of VRDE server instance.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param pPointer The pointer shape information.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync */
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync const VRDECOLORPOINTER *pPointer));
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync /**
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * Hide the mouse pointer.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync *
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param hServer Handle of VRDE server instance.
c889bbab784ba8552102ce776b6c67b982017861vboxsync */
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
c889bbab784ba8552102ce776b6c67b982017861vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync /**
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Queues the samples to be sent to clients.
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync *
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync * @param hServer Handle of VRDE server instance.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * @param pvSamples Address of samples to be sent.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * @param cSamples Number of samples.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * @param format Encoded audio format for these samples.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync *
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * @note Initialized to NULL when the application audio callbacks are NULL.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync */
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync const void *pvSamples,
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync uint32_t cSamples,
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync VRDEAUDIOFORMAT format));
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync /**
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * Sets the sound volume on clients.
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync *
81fcf0038d2d6c76ab2c8b02103dc18c24efe0a1vboxsync * @param hServer Handle of VRDE server instance.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param left 0..0xFFFF volume level for left channel.
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * @param right 0..0xFFFF volume level for right channel.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync *
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * @note Initialized to NULL when the application audio callbacks are NULL.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint16_t u16Left,
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync uint16_t u16Right));
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync /**
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * Sends a USB request.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync *
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * @param hServer Handle of VRDE server instance.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * @param u32ClientId An identifier that allows the server to find the corresponding client.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * The identifier is always passed by the server as a parameter
4d32c71a938b979c6aeee321ae325d5793a5ccdbvboxsync * of the FNVRDEUSBCALLBACK. Note that the value is the same as
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * in the VRDESERVERCALLBACK functions.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * @param pvParm Function specific parameters buffer.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * @param cbParm Size of the buffer.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync *
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * @note Initialized to NULL when the application USB callbacks are NULL.
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync uint32_t u32ClientId,
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync void *pvParm,
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync uint32_t cbParm));
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync /**
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * Called by the application when (VRDE_CLIPBOARD_FUNCTION_*):
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * - (0) guest announces available clipboard formats;
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * - (1) guest requests clipboard data;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * - (2) guest responds to the client's request for clipboard data.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync * @param hServer The VRDE server handle.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param u32Function The cause of the call.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param u32Format Bitmask of announced formats or the format of data.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param pvData Points to: (1) buffer to be filled with clients data;
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * (2) data from the host.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param cbData Size of 'pvData' buffer in bytes.
c889bbab784ba8552102ce776b6c67b982017861vboxsync * @param pcbActualRead Size of the copied data in bytes.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync *
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @note Initialized to NULL when the application clipboard callbacks are NULL.
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync */
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
c889bbab784ba8552102ce776b6c67b982017861vboxsync uint32_t u32Function,
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync uint32_t u32Format,
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync void *pvData,
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync uint32_t cbData,
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync uint32_t *pcbActualRead));
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync /**
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * Query various information from the VRDE server.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
ab02aeaf2a0312fe9267a292e3911728e4531332vboxsync * @param hServer The VRDE server handle.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param index VRDE_QI_* identifier of information to be returned.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param pvBuffer Address of memory buffer to which the information must be written.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param cbBuffer Size of the memory buffer in bytes.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param pcbOut Size in bytes of returned information value.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync *
31cda52093d58f5c604589fa74949c5fddcbde70vboxsync * @remark The caller must check the *pcbOut. 0 there means no information was returned.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * A value greater than cbBuffer means that information is too big to fit in the
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * buffer, in that case no information was placed to the buffer.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint32_t index,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync void *pvBuffer,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint32_t cbBuffer,
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync uint32_t *pcbOut));
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync} VRDEENTRYPOINTS_1;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync/** The VRDE server entry points. Interface version 2.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * A new entry point VRDERedirect has been added relative to version 1.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsynctypedef struct _VRDEENTRYPOINTS_2
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync{
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /** The header. */
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync VRDEINTERFACEHDR header;
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync /** Destroy the server instance.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync *
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * @param hServer The server instance handle.
31cda52093d58f5c604589fa74949c5fddcbde70vboxsync *
31cda52093d58f5c604589fa74949c5fddcbde70vboxsync * @return IPRT status code.
31cda52093d58f5c604589fa74949c5fddcbde70vboxsync */
31cda52093d58f5c604589fa74949c5fddcbde70vboxsync DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync /** The server should start to accept clients connections.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param hServer The server instance handle.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param fEnable Whether to enable or disable client connections.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * When is false, all existing clients are disconnected.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * @return IPRT status code.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync bool fEnable));
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync /** The server should disconnect the client.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync *
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * @param hServer The server instance handle.
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * @param u32ClientId The client identifier.
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * @param fReconnect Whether to send a "REDIRECT to the same server" packet to the
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * client before disconnecting.
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync *
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync * @return IPRT status code.
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync */
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync uint32_t u32ClientId,
6f058039e7b13efc3278b9bc84cf0fd135614b67vboxsync bool fReconnect));
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync /**
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * Inform the server that the display was resized.
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * The server will query information about display
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * from the application via callbacks.
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync *
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * @param hServer Handle of VRDE server instance.
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync */
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync /**
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * Send a update.
d9a86bd327291cd44d5f6da6e08bec728aae68bbvboxsync *
82c6fd518728c98e8bae58f3c5e55c5efa160878vboxsync * Note: the server must access the framebuffer bitmap only when VRDEUpdate is called.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * If the have to access the bitmap later or from another thread, then
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * it must used an intermediate buffer and copy the framebuffer data to the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * intermediate buffer in VRDEUpdate.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param hServer Handle of VRDE server instance.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param uScreenId The screen index.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @param pvUpdate Pointer to VRDEOrders.h::VRDEORDERHDR structure with extra data.
7f4b4ec1cadbf891d2756ce77dc4a4ec220a03bcvboxsync * @param cbUpdate Size of the update data.
c5d2523548cc57504b829f53f1362b848a84542cvboxsync */
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
00cc5d93f7446d9394a0f6b7ad790b9fb9d6005cvboxsync unsigned uScreenId,
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync void *pvUpdate,
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync uint32_t cbUpdate));
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync /**
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync * Set the mouse pointer shape.
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync *
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync * @param hServer Handle of VRDE server instance.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param pPointer The pointer shape information.
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync */
ad836b4d6fb2ccaf969666246c2c389a8d10ca41vboxsync DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync const VRDECOLORPOINTER *pPointer));
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync /**
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Hide the mouse pointer.
c889bbab784ba8552102ce776b6c67b982017861vboxsync *
* @param hServer Handle of VRDE server instance.
*/
DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
/**
* Queues the samples to be sent to clients.
*
* @param hServer Handle of VRDE server instance.
* @param pvSamples Address of samples to be sent.
* @param cSamples Number of samples.
* @param format Encoded audio format for these samples.
*
* @note Initialized to NULL when the application audio callbacks are NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
const void *pvSamples,
uint32_t cSamples,
VRDEAUDIOFORMAT format));
/**
* Sets the sound volume on clients.
*
* @param hServer Handle of VRDE server instance.
* @param left 0..0xFFFF volume level for left channel.
* @param right 0..0xFFFF volume level for right channel.
*
* @note Initialized to NULL when the application audio callbacks are NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
uint16_t u16Left,
uint16_t u16Right));
/**
* Sends a USB request.
*
* @param hServer Handle of VRDE server instance.
* @param u32ClientId An identifier that allows the server to find the corresponding client.
* The identifier is always passed by the server as a parameter
* of the FNVRDEUSBCALLBACK. Note that the value is the same as
* in the VRDESERVERCALLBACK functions.
* @param pvParm Function specific parameters buffer.
* @param cbParm Size of the buffer.
*
* @note Initialized to NULL when the application USB callbacks are NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
uint32_t u32ClientId,
void *pvParm,
uint32_t cbParm));
/**
* Called by the application when (VRDE_CLIPBOARD_FUNCTION_*):
* - (0) guest announces available clipboard formats;
* - (1) guest requests clipboard data;
* - (2) guest responds to the client's request for clipboard data.
*
* @param hServer The VRDE server handle.
* @param u32Function The cause of the call.
* @param u32Format Bitmask of announced formats or the format of data.
* @param pvData Points to: (1) buffer to be filled with clients data;
* (2) data from the host.
* @param cbData Size of 'pvData' buffer in bytes.
* @param pcbActualRead Size of the copied data in bytes.
*
* @note Initialized to NULL when the application clipboard callbacks are NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
uint32_t u32Function,
uint32_t u32Format,
void *pvData,
uint32_t cbData,
uint32_t *pcbActualRead));
/**
* Query various information from the VRDE server.
*
* @param hServer The VRDE server handle.
* @param index VRDE_QI_* identifier of information to be returned.
* @param pvBuffer Address of memory buffer to which the information must be written.
* @param cbBuffer Size of the memory buffer in bytes.
* @param pcbOut Size in bytes of returned information value.
*
* @remark The caller must check the *pcbOut. 0 there means no information was returned.
* A value greater than cbBuffer means that information is too big to fit in the
* buffer, in that case no information was placed to the buffer.
*/
DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
uint32_t index,
void *pvBuffer,
uint32_t cbBuffer,
uint32_t *pcbOut));
/**
* The server should redirect the client to the specified server.
*
* @param hServer The server instance handle.
* @param u32ClientId The client identifier.
* @param pszServer The server to redirect the client to.
* @param pszUser The username to use for the redirection.
* Can be NULL.
* @param pszDomain The domain. Can be NULL.
* @param pszPassword The password. Can be NULL.
* @param u32SessionId The ID of the session to redirect to.
* @param pszCookie The routing token used by a load balancer to
* route the redirection. Can be NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDERedirect,(HVRDESERVER hServer,
uint32_t u32ClientId,
const char *pszServer,
const char *pszUser,
const char *pszDomain,
const char *pszPassword,
uint32_t u32SessionId,
const char *pszCookie));
} VRDEENTRYPOINTS_2;
/** The VRDE server entry points. Interface version 3.
* New entry points VRDEAudioInOpen and VRDEAudioInClose has been added relative to version 2.
*/
typedef struct _VRDEENTRYPOINTS_3
{
/* The header. */
VRDEINTERFACEHDR header;
/*
* Same as version 2. See comment in VRDEENTRYPOINTS_2.
*/
DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer,
bool fEnable));
DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer,
uint32_t u32ClientId,
bool fReconnect));
DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer,
unsigned uScreenId,
void *pvUpdate,
uint32_t cbUpdate));
DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer,
const VRDECOLORPOINTER *pPointer));
DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer,
const void *pvSamples,
uint32_t cSamples,
VRDEAUDIOFORMAT format));
DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer,
uint16_t u16Left,
uint16_t u16Right));
DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer,
uint32_t u32ClientId,
void *pvParm,
uint32_t cbParm));
DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer,
uint32_t u32Function,
uint32_t u32Format,
void *pvData,
uint32_t cbData,
uint32_t *pcbActualRead));
DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer,
uint32_t index,
void *pvBuffer,
uint32_t cbBuffer,
uint32_t *pcbOut));
DECLR3CALLBACKMEMBER(void, VRDERedirect,(HVRDESERVER hServer,
uint32_t u32ClientId,
const char *pszServer,
const char *pszUser,
const char *pszDomain,
const char *pszPassword,
uint32_t u32SessionId,
const char *pszCookie));
/*
* New for version 3.
*/
/**
* Audio input open request.
*
* @param hServer Handle of VRDE server instance.
* @param pvCtx To be used in VRDECallbackAudioIn.
* @param u32ClientId An identifier that allows the server to find the corresponding client.
* @param audioFormat Preferred format of audio data.
* @param u32SamplesPerBlock Preferred number of samples in one block of audio input data.
*
* @note Initialized to NULL when the VRDECallbackAudioIn callback is NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEAudioInOpen,(HVRDESERVER hServer,
void *pvCtx,
uint32_t u32ClientId,
VRDEAUDIOFORMAT audioFormat,
uint32_t u32SamplesPerBlock));
/**
* Audio input close request.
*
* @param hServer Handle of VRDE server instance.
* @param u32ClientId An identifier that allows the server to find the corresponding client.
*
* @note Initialized to NULL when the VRDECallbackAudioIn callback is NULL.
*/
DECLR3CALLBACKMEMBER(void, VRDEAudioInClose,(HVRDESERVER hServer,
uint32_t u32ClientId));
} VRDEENTRYPOINTS_3;
/* Indexes for VRDECallbackProperty.
* *_QP_* queries a property.
* *_SP_* sets a property.
*/
#define VRDE_QP_NETWORK_PORT (1) /* Obsolete. Use VRDE_QP_NETWORK_PORT_RANGE instead. */
#define VRDE_QP_NETWORK_ADDRESS (2) /* UTF8 string. Host network interface IP address to bind to. */
#define VRDE_QP_NUMBER_MONITORS (3) /* 32 bit. Number of monitors in the VM. */
#define VRDE_QP_NETWORK_PORT_RANGE (4) /* UTF8 string. List of ports. The server must bind to one of
* free ports from the list. Example: "3000,3010-3012,4000",
* which tells the server to bind to either of ports:
* 3000, 3010, 3011, 3012, 4000.
*/
#ifdef VBOX_WITH_VRDP_VIDEO_CHANNEL
#define VRDE_QP_VIDEO_CHANNEL (5)
#define VRDE_QP_VIDEO_CHANNEL_QUALITY (6)
#define VRDE_QP_VIDEO_CHANNEL_SUNFLSH (7)
#endif /* VBOX_WITH_VRDP_VIDEO_CHANNEL */
#define VRDE_QP_FEATURE (8) /* VRDEFEATURE structure. Generic interface to query named VRDE properties. */
#define VRDE_SP_BASE 0x1000
#define VRDE_SP_NETWORK_BIND_PORT (VRDE_SP_BASE + 1) /* 32 bit. The port number actually used by the server.
* If VRDECreateServer fails, it should set the port to 0.
* If VRDECreateServer succeeds, then the port must be set
* in VRDEEnableConnections to the actually used value.
* VRDEDestroy must set the port to 0xFFFFFFFF.
*/
#define VRDE_SP_CLIENT_NAME (VRDE_SP_BASE + 2) /* UTF8 string. The name of a connected client.
* The client can report its name.
*/
#pragma pack(1)
/* VRDE_QP_FEATURE data. */
typedef struct _VRDEFEATURE
{
uint32_t u32ClientId;
char achInfo[1]; /* UTF8 property input name and output value. */
} VRDEFEATURE;
/* VRDE_SP_CLIENT_NAME data. */
typedef struct VRDECLIENTNAME
{
uint32_t u32ClientId;
char achName[1]; /* UTF8 name. */
} VRDECLIENTNAME;
/* A framebuffer description. */
typedef struct _VRDEFRAMEBUFFERINFO
{
const uint8_t *pu8Bits;
int xOrigin;
int yOrigin;
unsigned cWidth;
unsigned cHeight;
unsigned cBitsPerPixel;
unsigned cbLine;
} VRDEFRAMEBUFFERINFO;
#define VRDE_INPUT_SCANCODE 0
#define VRDE_INPUT_POINT 1
#define VRDE_INPUT_CAD 2
#define VRDE_INPUT_RESET 3
#define VRDE_INPUT_SYNCH 4
typedef struct _VRDEINPUTSCANCODE
{
unsigned uScancode;
} VRDEINPUTSCANCODE;
#define VRDE_INPUT_POINT_BUTTON1 0x01
#define VRDE_INPUT_POINT_BUTTON2 0x02
#define VRDE_INPUT_POINT_BUTTON3 0x04
#define VRDE_INPUT_POINT_WHEEL_UP 0x08
#define VRDE_INPUT_POINT_WHEEL_DOWN 0x10
typedef struct _VRDEINPUTPOINT
{
int x;
int y;
unsigned uButtons;
} VRDEINPUTPOINT;
#define VRDE_INPUT_SYNCH_SCROLL 0x01
#define VRDE_INPUT_SYNCH_NUMLOCK 0x02
#define VRDE_INPUT_SYNCH_CAPITAL 0x04
typedef struct _VRDEINPUTSYNCH
{
unsigned uLockStatus;
} VRDEINPUTSYNCH;
#pragma pack()
/** The VRDE server callbacks. Interface version 1. */
typedef struct _VRDECALLBACKS_1
{
/** The header. */
VRDEINTERFACEHDR header;
/**
* Query or set various information, on how the VRDE server operates, from or to the application.
* Queries for properties will always return success, and if the key is not known or has no
* value associated with it an empty string is returned.
*
*
* @param pvCallback The callback specific pointer.
* @param index VRDE_[Q|S]P_* identifier of information to be returned or set.
* @param pvBuffer Address of memory buffer to which the information must be written or read.
* @param cbBuffer Size of the memory buffer in bytes.
* @param pcbOut Size in bytes of returned information value.
*
* @return IPRT status code. VINF_BUFFER_OVERFLOW if the buffer is too small for the value.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackProperty,(void *pvCallback,
uint32_t index,
void *pvBuffer,
uint32_t cbBuffer,
uint32_t *pcbOut));
/* A client is logging in, the application must decide whether
* to let to connect the client. The server will drop the connection,
* when an error code is returned by the callback.
*
* @param pvCallback The callback specific pointer.
* @param u32ClientId An unique client identifier generated by the server.
* @param pszUser The username.
* @param pszPassword The password.
* @param pszDomain The domain.
*
* @return IPRT status code.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackClientLogon,(void *pvCallback,
uint32_t u32ClientId,
const char *pszUser,
const char *pszPassword,
const char *pszDomain));
/* The client has been successfully connected. That is logon was successful and the
* remote desktop protocol connection completely established.
*
* @param pvCallback The callback specific pointer.
* @param u32ClientId An unique client identifier generated by the server.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackClientConnect,(void *pvCallback,
uint32_t u32ClientId));
/* The client has been disconnected.
*
* @param pvCallback The callback specific pointer.
* @param u32ClientId An unique client identifier generated by the server.
* @param fu32Intercepted What was intercepted by the client (VRDE_CLIENT_INTERCEPT_*).
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackClientDisconnect,(void *pvCallback,
uint32_t u32ClientId,
uint32_t fu32Intercepted));
/* The client supports one of RDP channels.
*
* @param pvCallback The callback specific pointer.
* @param u32ClientId An unique client identifier generated by the server.
* @param fu32Intercept What the client wants to intercept. One of VRDE_CLIENT_INTERCEPT_* flags.
* @param ppvIntercept The value to be passed to the channel specific callback.
*
* @return IPRT status code.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackIntercept,(void *pvCallback,
uint32_t u32ClientId,
uint32_t fu32Intercept,
void **ppvIntercept));
/**
* Called by the server when a reply is received from a client.
*
* @param pvCallback The callback specific pointer.
* @param ppvIntercept The value returned by VRDECallbackIntercept for the VRDE_CLIENT_INTERCEPT_USB.
* @param u32ClientId Identifies the client that sent the reply.
* @param u8Code The operation code VRDE_USB_REQ_*.
* @param pvRet Points to data received from the client.
* @param cbRet Size of the data in bytes.
*
* @return IPRT status code.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackUSB,(void *pvCallback,
void *pvIntercept,
uint32_t u32ClientId,
uint8_t u8Code,
const void *pvRet,
uint32_t cbRet));
/**
* Called by the server when (VRDE_CLIPBOARD_FUNCTION_*):
* - (0) client announces available clipboard formats;
* - (1) client requests clipboard data.
*
* @param pvCallback The callback specific pointer.
* @param ppvIntercept The value returned by VRDECallbackIntercept for the VRDE_CLIENT_INTERCEPT_CLIPBOARD.
* @param u32ClientId Identifies the RDP client that sent the reply.
* @param u32Function The cause of the callback.
* @param u32Format Bitmask of reported formats or the format of received data.
* @param pvData Reserved.
* @param cbData Reserved.
*
* @return IPRT status code.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackClipboard,(void *pvCallback,
void *pvIntercept,
uint32_t u32ClientId,
uint32_t u32Function,
uint32_t u32Format,
const void *pvData,
uint32_t cbData));
/* The framebuffer information is queried.
*
* @param pvCallback The callback specific pointer.
* @param uScreenId The framebuffer index.
* @param pInfo The information structure to ber filled.
*
* @return Whether the framebuffer is available.
*/
DECLR3CALLBACKMEMBER(bool, VRDECallbackFramebufferQuery,(void *pvCallback,
unsigned uScreenId,
VRDEFRAMEBUFFERINFO *pInfo));
/* Request the exclusive access to the framebuffer bitmap.
* Currently not used because VirtualBox makes sure that the framebuffer is available
* when VRDEUpdate is called.
*
* @param pvCallback The callback specific pointer.
* @param uScreenId The framebuffer index.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferLock,(void *pvCallback,
unsigned uScreenId));
/* Release the exclusive access to the framebuffer bitmap.
* Currently not used because VirtualBox makes sure that the framebuffer is available
* when VRDEUpdate is called.
*
* @param pvCallback The callback specific pointer.
* @param uScreenId The framebuffer index.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferUnlock,(void *pvCallback,
unsigned uScreenId));
/* Input from the client.
*
* @param pvCallback The callback specific pointer.
* @param pvInput The input information.
* @param cbInput The size of the input information.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackInput,(void *pvCallback,
int type,
const void *pvInput,
unsigned cbInput));
/* Video mode hint from the client.
*
* @param pvCallback The callback specific pointer.
* @param cWidth Requested width.
* @param cHeight Requested height.
* @param cBitsPerPixel Requested color depth.
* @param uScreenId The framebuffer index.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackVideoModeHint,(void *pvCallback,
unsigned cWidth,
unsigned cHeight,
unsigned cBitsPerPixel,
unsigned uScreenId));
} VRDECALLBACKS_1;
/* Callbacks are the same for the version 1 and version 2 interfaces. */
typedef VRDECALLBACKS_1 VRDECALLBACKS_2;
/** The VRDE server callbacks. Interface version 3. */
typedef struct _VRDECALLBACKS_3
{
/* The header. */
VRDEINTERFACEHDR header;
/*
* Same as in version 1 and 2. See comment in VRDECALLBACKS_1.
*/
DECLR3CALLBACKMEMBER(int, VRDECallbackProperty,(void *pvCallback,
uint32_t index,
void *pvBuffer,
uint32_t cbBuffer,
uint32_t *pcbOut));
DECLR3CALLBACKMEMBER(int, VRDECallbackClientLogon,(void *pvCallback,
uint32_t u32ClientId,
const char *pszUser,
const char *pszPassword,
const char *pszDomain));
DECLR3CALLBACKMEMBER(void, VRDECallbackClientConnect,(void *pvCallback,
uint32_t u32ClientId));
DECLR3CALLBACKMEMBER(void, VRDECallbackClientDisconnect,(void *pvCallback,
uint32_t u32ClientId,
uint32_t fu32Intercepted));
DECLR3CALLBACKMEMBER(int, VRDECallbackIntercept,(void *pvCallback,
uint32_t u32ClientId,
uint32_t fu32Intercept,
void **ppvIntercept));
DECLR3CALLBACKMEMBER(int, VRDECallbackUSB,(void *pvCallback,
void *pvIntercept,
uint32_t u32ClientId,
uint8_t u8Code,
const void *pvRet,
uint32_t cbRet));
DECLR3CALLBACKMEMBER(int, VRDECallbackClipboard,(void *pvCallback,
void *pvIntercept,
uint32_t u32ClientId,
uint32_t u32Function,
uint32_t u32Format,
const void *pvData,
uint32_t cbData));
DECLR3CALLBACKMEMBER(bool, VRDECallbackFramebufferQuery,(void *pvCallback,
unsigned uScreenId,
VRDEFRAMEBUFFERINFO *pInfo));
DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferLock,(void *pvCallback,
unsigned uScreenId));
DECLR3CALLBACKMEMBER(void, VRDECallbackFramebufferUnlock,(void *pvCallback,
unsigned uScreenId));
DECLR3CALLBACKMEMBER(void, VRDECallbackInput,(void *pvCallback,
int type,
const void *pvInput,
unsigned cbInput));
DECLR3CALLBACKMEMBER(void, VRDECallbackVideoModeHint,(void *pvCallback,
unsigned cWidth,
unsigned cHeight,
unsigned cBitsPerPixel,
unsigned uScreenId));
/*
* New for version 3.
*/
/**
* Called by the server when something happens with audio input.
*
* @param pvCallback The callback specific pointer.
* @param pvCtx The value passed in VRDEAudioInOpen.
* @param u32ClientId Identifies the client that sent the reply.
* @param u32Event The event code VRDE_AUDIOIN_*.
* @param pvData Points to data received from the client.
* @param cbData Size of the data in bytes.
*/
DECLR3CALLBACKMEMBER(void, VRDECallbackAudioIn,(void *pvCallback,
void *pvCtx,
uint32_t u32ClientId,
uint32_t u32Event,
const void *pvData,
uint32_t cbData));
} VRDECALLBACKS_3;
/** The VRDE server entry points. Interface version 4.
* New entry point VRDEGetInterface has been added relative to version 3.
*/
typedef struct _VRDEENTRYPOINTS_4
{
/* The header. */
VRDEINTERFACEHDR header;
/*
* Same as version 3. See comment in VRDEENTRYPOINTS_3.
*/
DECLR3CALLBACKMEMBER(void, VRDEDestroy,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(int, VRDEEnableConnections,(HVRDESERVER hServer, bool fEnable));
DECLR3CALLBACKMEMBER(void, VRDEDisconnect,(HVRDESERVER hServer, uint32_t u32ClientId, bool fReconnect));
DECLR3CALLBACKMEMBER(void, VRDEResize,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(void, VRDEUpdate,(HVRDESERVER hServer, unsigned uScreenId, void *pvUpdate,
uint32_t cbUpdate));
DECLR3CALLBACKMEMBER(void, VRDEColorPointer,(HVRDESERVER hServer, const VRDECOLORPOINTER *pPointer));
DECLR3CALLBACKMEMBER(void, VRDEHidePointer,(HVRDESERVER hServer));
DECLR3CALLBACKMEMBER(void, VRDEAudioSamples,(HVRDESERVER hServer, const void *pvSamples, uint32_t cSamples,
VRDEAUDIOFORMAT format));
DECLR3CALLBACKMEMBER(void, VRDEAudioVolume,(HVRDESERVER hServer, uint16_t u16Left, uint16_t u16Right));
DECLR3CALLBACKMEMBER(void, VRDEUSBRequest,(HVRDESERVER hServer, uint32_t u32ClientId, void *pvParm,
uint32_t cbParm));
DECLR3CALLBACKMEMBER(void, VRDEClipboard,(HVRDESERVER hServer, uint32_t u32Function, uint32_t u32Format,
void *pvData, uint32_t cbData, uint32_t *pcbActualRead));
DECLR3CALLBACKMEMBER(void, VRDEQueryInfo,(HVRDESERVER hServer, uint32_t index, void *pvBuffer, uint32_t cbBuffer,
uint32_t *pcbOut));
DECLR3CALLBACKMEMBER(void, VRDERedirect,(HVRDESERVER hServer, uint32_t u32ClientId, const char *pszServer,
const char *pszUser, const char *pszDomain, const char *pszPassword,
uint32_t u32SessionId, const char *pszCookie));
DECLR3CALLBACKMEMBER(void, VRDEAudioInOpen,(HVRDESERVER hServer, void *pvCtx, uint32_t u32ClientId,
VRDEAUDIOFORMAT audioFormat, uint32_t u32SamplesPerBlock));
DECLR3CALLBACKMEMBER(void, VRDEAudioInClose,(HVRDESERVER hServer, uint32_t u32ClientId));
/**
* Generic interface query. An interface is a set of entry points and callbacks.
* It is not a reference counted interface.
*
* @param hServer Handle of VRDE server instance.
* @param pszId String identifier of the interface, like uuid.
* @param pInterface The interface structure to be initialized by the VRDE server.
* Only VRDEINTERFACEHDR is initialized by the caller.
* @param pCallbacks Callbacks required by the interface. The server makes a local copy.
* VRDEINTERFACEHDR version must correspond to the requested interface version.
* @param pvContext The context to be used in callbacks.
*/
DECLR3CALLBACKMEMBER(int, VRDEGetInterface, (HVRDESERVER hServer,
const char *pszId,
VRDEINTERFACEHDR *pInterface,
const VRDEINTERFACEHDR *pCallbacks,
void *pvContext));
} VRDEENTRYPOINTS_4;
/* Callbacks are the same for the version 3 and version 4 interfaces. */
typedef VRDECALLBACKS_3 VRDECALLBACKS_4;
/**
* Create a new VRDE server instance. The instance is fully functional but refuses
* client connections until the entry point VRDEEnableConnections is called by the application.
*
* The caller prepares the VRDECALLBACKS_* structure. The header.u64Version field of the
* structure must be initialized with the version of the interface to use.
* The server will return pointer to VRDEENTRYPOINTS_* table in *ppEntryPoints
* to match the requested interface.
* That is if pCallbacks->header.u64Version == VRDE_INTERFACE_VERSION_1, then the server
* expects pCallbacks to point to VRDECALLBACKS_1 and will return a pointer to VRDEENTRYPOINTS_1.
*
* @param pCallback Pointer to the application callbacks which let the server to fetch
* the configuration data and to access the desktop.
* @param pvCallback The callback specific pointer to be passed back to the application.
* @param ppEntryPoints Where to store the pointer to the VRDE entry points structure.
* @param phServer Pointer to the created server instance handle.
*
* @return IPRT status code.
*/
DECLEXPORT(int) VRDECreateServer (const VRDEINTERFACEHDR *pCallbacks,
void *pvCallback,
VRDEINTERFACEHDR **ppEntryPoints,
HVRDESERVER *phServer);
typedef DECLCALLBACK(int) FNVRDECREATESERVER (const VRDEINTERFACEHDR *pCallbacks,
void *pvCallback,
VRDEINTERFACEHDR **ppEntryPoints,
HVRDESERVER *phServer);
typedef FNVRDECREATESERVER *PFNVRDECREATESERVER;
/**
* List of names of the VRDE properties, which are recognized by the VRDE.
*
* For example VRDESupportedProperties should return gapszProperties declared as:
*
* static const char * const gapszProperties[] =
* {
* "TCP/Ports",
* "TCP/Address",
* NULL
* };
*
* @returns pointer to array of pointers to name strings (UTF8).
*/
DECLEXPORT(const char * const *) VRDESupportedProperties (void);
typedef DECLCALLBACK(const char * const *) FNVRDESUPPORTEDPROPERTIES (void);
typedef FNVRDESUPPORTEDPROPERTIES *PFNVRDESUPPORTEDPROPERTIES;
RT_C_DECLS_END
/** @} */
#endif