ConsoleVRDPServer.h revision 670515410f8bfcc1248752473f344e7bce2fb12b
/* $Id$ */
/** @file
* VBox Console VRDE Server Helper class and implementation of IVRDEServerInfo
*/
/*
* Copyright (C) 2006-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_CONSOLEVRDPSERVER
#define ____H_CONSOLEVRDPSERVER
#include "VRDEServerInfoWrap.h"
#include "RemoteUSBBackend.h"
#include "HGCM.h"
#include <VBox/VBoxAuth.h>
#define VRDE_VIDEOIN_WITH_VRDEINTERFACE /* Get the VRDE interface definitions. */
#include "SchemaDefs.h"
// ConsoleVRDPServer
///////////////////////////////////////////////////////////////////////////////
typedef struct _VRDPInputSynch
{
bool fGuestNumLock;
bool fGuestCapsLock;
bool fGuestScrollLock;
bool fClientNumLock;
bool fClientCapsLock;
bool fClientScrollLock;
/* Member of Console. Helper class for VRDP server management. Not a COM class. */
{
~ConsoleVRDPServer ();
int Launch (void);
void NotifyAbsoluteMouse (bool fGuestWantsAbsolute)
{
}
{
/* Might need to resync in case the guest itself changed the LED status. */
{
}
{
}
}
void EnableConnections (void);
int MousePointer(BOOL alpha, ULONG xHot, ULONG yHot, ULONG width, ULONG height, const uint8_t *pu8Shape);
void MousePointerHide (void);
void Stop (void);
/* Private interface for the RemoteUSBBackend destructor. */
/* Private methods for the Remote USB thread. */
bool isRemoteUSBThreadRunning (void);
/*
* Forwarders to VRDP server library.
*/
void SendResize (void);
int SendAudioInputBegin(void **ppvUserCtx,
void *pvContext,
void SendAudioInputEnd(void *pvUserCtx);
/* Note: This is not a ComObjPtr here, because the ConsoleVRDPServer object
* is actually just a part of the Console.
*/
static int loadVRDPLibrary (const char *pszLibraryName);
/** Static because will never load this more than once! */
static RTLDRMOD mVRDPLibrary;
static VRDEENTRYPOINTS_4 mEntryPoints;
static VRDEENTRYPOINTS_4 *mpEntryPoints;
static VRDECALLBACKS_4 mCallbacks;
static DECLCALLBACK(int) VRDPCallbackQueryProperty (void *pvCallback, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut);
static DECLCALLBACK(int) VRDPCallbackClientLogon (void *pvCallback, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
static DECLCALLBACK(void) VRDPCallbackClientDisconnect (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercepted);
static DECLCALLBACK(int) VRDPCallbackIntercept (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercept, void **ppvIntercept);
static DECLCALLBACK(int) VRDPCallbackUSB (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint8_t u8Code, const void *pvRet, uint32_t cbRet);
static DECLCALLBACK(int) VRDPCallbackClipboard (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData);
static DECLCALLBACK(bool) VRDPCallbackFramebufferQuery (void *pvCallback, unsigned uScreenId, VRDEFRAMEBUFFERINFO *pInfo);
static DECLCALLBACK(void) VRDPCallbackInput (void *pvCallback, int type, const void *pvInput, unsigned cbInput);
static DECLCALLBACK(void) VRDPCallbackVideoModeHint (void *pvCallback, unsigned cWidth, unsigned cHeight, unsigned cBitsPerPixel, unsigned uScreenId);
static DECLCALLBACK(void) VRDECallbackAudioIn (void *pvCallback, void *pvCtx, uint32_t u32ClientId, uint32_t u32Event, const void *pvData, uint32_t cbData);
bool m_fGuestWantsAbsolute;
int m_mousex;
int m_mousey;
int lockConsoleVRDPServer (void);
void unlockConsoleVRDPServer (void);
int mcClipboardRefs;
static DECLCALLBACK(int) ClipboardCallback (void *pvCallback, uint32_t u32ClientId, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData);
static DECLCALLBACK(int) ClipboardServiceExtension (void *pvExtension, uint32_t u32Function, void *pvParm, uint32_t cbParms);
#ifdef VBOX_WITH_USB
typedef struct _USBBackends
{
bool fThreadRunning;
} USBBackends;
void remoteUSBThreadStart (void);
void remoteUSBThreadStop (void);
#endif /* VBOX_WITH_USB */
/* External authentication library handle. The library is loaded in the
* Authenticate method and unloaded at the object destructor.
*/
uint32_t volatile mu32AudioInputClientId;
const char *pszFormat);
void remote3DRedirect(bool fEnable);
/*
* VRDE server optional interfaces.
*/
/* Image update interface. */
bool m_fInterfaceImage;
void *pvUser,
void *pvData,
/* Mouse pointer interface. */
/* Smartcard interface. */
void *pvData,
int rcRequest,
void *pvUser,
void *pvData,
/* TSMF interface. */
void *pvChannel,
const void *pvParm,
void setupTSMF(void);
static DECLCALLBACK(int) tsmfHostChannelAttach(void *pvProvider, void **ppvInstance, uint32_t u32Flags,
static DECLCALLBACK(int) tsmfHostChannelSend(void *pvInstance, const void *pvData, uint32_t cbData);
int tsmfLock(void);
void tsmfUnlock(void);
/* Video input interface. */
const void *pvData,
int rcRequest,
void *pDeviceCtx,
void *pvUser,
const VRDEVIDEOINDEVICEDESC *pDeviceDesc,
int rcRequest,
void *pDeviceCtx,
void *pvUser,
const VRDEVIDEOINCTRLHDR *pControl,
int rcRequest,
void *pDeviceCtx,
const VRDEVIDEOINPAYLOADHDR *pFrame,
/* Input interface. */
int rcRequest,
const void *pvResult,
const void *pvEvent,
};
{
void FinalRelease();
/* Public initializer/uninitializer for internal purposes only. */
void uninit();
// wrapped IVRDEServerInfo properties
};
#endif // ____H_CONSOLEVRDPSERVER
/* vi: set tabstop=4 shiftwidth=4 expandtab: */