ConsoleVRDPServer.h revision 427a7af1868411904934522dc1acebea2ed97373
/** @file
*
* VBox Console VRDP Helper class and implementation of IRemoteDisplayInfo
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef ____H_CONSOLEVRDPSERVER
#define ____H_CONSOLEVRDPSERVER
#include "RemoteUSBBackend.h"
#include <VBox/VRDPAuth.h>
#ifdef VRDP_NO_COM
#include "SchemaDefs.h"
#endif /* VRDP_NO_COM */
// ConsoleVRDPServer
///////////////////////////////////////////////////////////////////////////////
/* Member of Console. Helper class for VRDP server management. Not a COM class. */
{
~ConsoleVRDPServer ();
int Launch (void);
#ifdef VRDP_NO_COM
void NotifyAbsoluteMouse (bool fGuestWantsAbsolute)
{
}
void EnableConnections (void);
void MousePointerHide (void);
#else
void SetCallback (void);
#endif /* VRDP_NO_COM */
void Stop (void);
#ifdef VRDP_NO_COM
#else
#endif /* VRDP_NO_COM */
/* Private interface for the RemoteUSBBackend destructor. */
/* Private methods for the Remote USB thread. */
bool isRemoteUSBThreadRunning (void);
void waitRemoteUSBThreadEvent (unsigned cMillies);
#ifdef VRDP_NO_COM
#else
#endif /* VRDP_NO_COM */
/*
* Forwarders to VRDP server library.
*/
void SendResize (void) const;
#ifdef VRDP_NO_COM
#else
#endif /* VRDP_NO_COM */
/* Note: This is not a ComObjPtr here, because the ConsoleVRDPServer object
* is actually just a part of the Console.
*/
#ifdef VBOX_VRDP
static bool loadVRDPLibrary (void);
/** Static because will never load this more than once! */
static RTLDRMOD mVRDPLibrary;
#ifdef VRDP_NO_COM
static VRDPENTRYPOINTS_1 *mpEntryPoints;
static VRDPCALLBACKS_1 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, VRDPFRAMEBUFFERINFO *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);
bool m_fGuestWantsAbsolute;
int m_mousex;
int m_mousey;
#else
// VRDP API function pointers
static int (VBOXCALL *mpfnVRDPStartServer) (IConsole *pConsole, IVRDPServer *pVRDPServer, HVRDPSERVER *phServer);
static int (VBOXCALL *mpfnVRDPSetFramebuffer) (HVRDPSERVER hServer, IFramebuffer *pFramebuffer, uint32_t fFlags);
static void (VBOXCALL *mpfnVRDPSetCallback) (HVRDPSERVER hServer, VRDPSERVERCALLBACK *pcallback, void *pvUser);
static void (VBOXCALL *mpfnVRDPSendUpdateBitmap)(HVRDPSERVER hServer, unsigned uScreenId, unsigned x, unsigned y, unsigned w, unsigned h);
static void (VBOXCALL *mpfnVRDPSendAudioSamples)(HVRDPSERVER hserver, void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format);
static void (VBOXCALL *mpfnVRDPSendAudioVolume) (HVRDPSERVER hserver, uint16_t left, uint16_t right);
static void (VBOXCALL *mpfnVRDPSendUSBRequest) (HVRDPSERVER hserver, uint32_t u32ClientId, void *pvParms, uint32_t cbParms);
static void (VBOXCALL *mpfnVRDPSendUpdate) (HVRDPSERVER hServer, unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate);
static void (VBOXCALL *mpfnVRDPQueryInfo) (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut);
static void (VBOXCALL *mpfnVRDPClipboard) (HVRDPSERVER hserver, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData, uint32_t *pcbActualRead);
#endif /* VRDP_NO_COM */
#endif /* VBOX_VRDP */
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.
*/
};
{
void FinalRelease();
/* Public initializer/uninitializer for internal purposes only. */
void uninit();
/* IRemoteDisplayInfo properties */
/* For VirtualBoxSupportErrorInfoImpl. */
};
#endif // ____H_CONSOLEVRDPSERVER