FreeRDP
freerdp.h File Reference
#include <freerdp/api.h>
#include <freerdp/types.h>
#include <freerdp/error.h>
#include <freerdp/event.h>
#include <freerdp/codecs.h>
#include <freerdp/metrics.h>
#include <freerdp/settings.h>
#include <freerdp/extension.h>
#include <winpr/stream.h>
#include <freerdp/input.h>
#include <freerdp/update.h>
#include <freerdp/message.h>
#include <freerdp/autodetect.h>
#include <freerdp/client.h>

Data Structures

struct  rdpContext
 
struct  freerdp
 
struct  rdpChannelHandles
 

Macros

#define VERIFY_CERT_FLAG_NONE   0x00
 
#define VERIFY_CERT_FLAG_LEGACY   0x02
 
#define VERIFY_CERT_FLAG_REDIRECT   0x10
 
#define VERIFY_CERT_FLAG_GATEWAY   0x20
 
#define VERIFY_CERT_FLAG_CHANGED   0x40
 
#define VERIFY_CERT_FLAG_MISMATCH   0x80
 

Typedefs

typedef struct rdp_rail rdpRail
 
typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS
 
typedef BOOL(* pContextNew) (freerdp *instance, rdpContext *context)
 
typedef void(* pContextFree) (freerdp *instance, rdpContext *context)
 
typedef BOOL(* pPreConnect) (freerdp *instance)
 
typedef BOOL(* pPostConnect) (freerdp *instance)
 
typedef void(* pPostDisconnect) (freerdp *instance)
 
typedef BOOL(* pAuthenticate) (freerdp *instance, char **username, char **password, char **domain)
 
typedef DWORD(* pVerifyCertificate) (freerdp *instance, const char *common_name, const char *subject, const char *issuer, const char *fingerprint, BOOL host_mismatch)
 Callback used if user interaction is required to accept an unknown certificate. More...
 
typedef DWORD(* pVerifyCertificateEx) (freerdp *instance, const char *host, UINT16 port, const char *common_name, const char *subject, const char *issuer, const char *fingerprint, DWORD flags)
 Callback used if user interaction is required to accept an unknown certificate. More...
 
typedef DWORD(* pVerifyChangedCertificate) (freerdp *instance, const char *common_name, const char *subject, const char *issuer, const char *new_fingerprint, const char *old_subject, const char *old_issuer, const char *old_fingerprint)
 Callback used if user interaction is required to accept a changed certificate. More...
 
typedef DWORD(* pVerifyChangedCertificateEx) (freerdp *instance, const char *host, UINT16 port, const char *common_name, const char *subject, const char *issuer, const char *new_fingerprint, const char *old_subject, const char *old_issuer, const char *old_fingerprint, DWORD flags)
 Callback used if user interaction is required to accept a changed certificate. More...
 
typedef int(* pVerifyX509Certificate) (freerdp *instance, const BYTE *data, size_t length, const char *hostname, UINT16 port, DWORD flags)
 Callback used if user interaction is required to accept a certificate. More...
 
typedef int(* pLogonErrorInfo) (freerdp *instance, UINT32 data, UINT32 type)
 
typedef int(* pSendChannelData) (freerdp *instance, UINT16 channelId, BYTE *data, int size)
 
typedef int(* pReceiveChannelData) (freerdp *instance, UINT16 channelId, BYTE *data, int size, int flags, int totalSize)
 

Enumerations

enum  Disconnect_Ultimatum {
  Disconnect_Ultimatum_domain_disconnected = 0, Disconnect_Ultimatum_provider_initiated = 1, Disconnect_Ultimatum_token_purged = 2, Disconnect_Ultimatum_user_requested = 3,
  Disconnect_Ultimatum_channel_purged = 4
}
 

Functions

FREERDP_API BOOL freerdp_context_new (freerdp *instance)
 
FREERDP_API void freerdp_context_free (freerdp *instance)
 
FREERDP_API BOOL freerdp_connect (freerdp *instance)
 
FREERDP_API BOOL freerdp_abort_connect (freerdp *instance)
 
FREERDP_API BOOL freerdp_shall_disconnect (freerdp *instance)
 
FREERDP_API BOOL freerdp_disconnect (freerdp *instance)
 
FREERDP_API BOOL freerdp_disconnect_before_reconnect (freerdp *instance)
 
FREERDP_API BOOL freerdp_reconnect (freerdp *instance)
 
FREERDP_API UINT freerdp_channel_add_init_handle_data (rdpChannelHandles *handles, void *pInitHandle, void *pUserData)
 
FREERDP_API voidfreerdp_channel_get_init_handle_data (rdpChannelHandles *handles, void *pInitHandle)
 
FREERDP_API void freerdp_channel_remove_init_handle_data (rdpChannelHandles *handles, void *pInitHandle)
 
FREERDP_API UINT freerdp_channel_add_open_handle_data (rdpChannelHandles *handles, DWORD openHandle, void *pUserData)
 
FREERDP_API voidfreerdp_channel_get_open_handle_data (rdpChannelHandles *handles, DWORD openHandle)
 
FREERDP_API void freerdp_channel_remove_open_handle_data (rdpChannelHandles *handles, DWORD openHandle)
 
FREERDP_API UINT freerdp_channels_attach (freerdp *instance)
 
FREERDP_API UINT freerdp_channels_detach (freerdp *instance)
 
FREERDP_API BOOL freerdp_get_fds (freerdp *instance, void **rfds, int *rcount, void **wfds, int *wcount)
 
FREERDP_API BOOL freerdp_check_fds (freerdp *instance)
 
FREERDP_API DWORD freerdp_get_event_handles (rdpContext *context, HANDLE *events, DWORD count)
 
FREERDP_API BOOL freerdp_check_event_handles (rdpContext *context)
 
FREERDP_API wMessageQueue * freerdp_get_message_queue (freerdp *instance, DWORD id)
 
FREERDP_API HANDLE freerdp_get_message_queue_event_handle (freerdp *instance, DWORD id)
 
FREERDP_API int freerdp_message_queue_process_message (freerdp *instance, DWORD id, wMessage *message)
 
FREERDP_API int freerdp_message_queue_process_pending_messages (freerdp *instance, DWORD id)
 
FREERDP_API UINT32 freerdp_error_info (freerdp *instance)
 
FREERDP_API void freerdp_set_error_info (rdpRdp *rdp, UINT32 error)
 
FREERDP_API void freerdp_get_version (int *major, int *minor, int *revision)
 
FREERDP_API const char * freerdp_get_version_string (void)
 
FREERDP_API const char * freerdp_get_build_date (void)
 
FREERDP_API const char * freerdp_get_build_revision (void)
 
FREERDP_API const char * freerdp_get_build_config (void)
 
FREERDP_API freerdp * freerdp_new (void)
 
FREERDP_API void freerdp_free (freerdp *instance)
 
FREERDP_API BOOL freerdp_focus_required (freerdp *instance)
 
FREERDP_API void freerdp_set_focus (freerdp *instance)
 
FREERDP_API int freerdp_get_disconnect_ultimatum (rdpContext *context)
 
FREERDP_API UINT32 freerdp_get_last_error (rdpContext *context)
 
FREERDP_API const char * freerdp_get_last_error_name (UINT32 error)
 
FREERDP_API const char * freerdp_get_last_error_string (UINT32 error)
 
FREERDP_API void freerdp_set_last_error (rdpContext *context, UINT32 lastError)
 
FREERDP_API const char * freerdp_get_logon_error_info_type (UINT32 type)
 
FREERDP_API const char * freerdp_get_logon_error_info_data (UINT32 data)
 
FREERDP_API ULONG freerdp_get_transport_sent (rdpContext *context, BOOL resetCount)
 
FREERDP_API void clearChannelError (rdpContext *context)
 
FREERDP_API HANDLE getChannelErrorEventHandle (rdpContext *context)
 
FREERDP_API UINT getChannelError (rdpContext *context)
 
FREERDP_API const char * getChannelErrorDescription (rdpContext *context)
 
FREERDP_API void setChannelError (rdpContext *context, UINT errorNum, char *description)
 
FREERDP_API BOOL checkChannelErrorEvent (rdpContext *context)
 

Macro Definition Documentation

#define VERIFY_CERT_FLAG_CHANGED   0x40
#define VERIFY_CERT_FLAG_GATEWAY   0x20
#define VERIFY_CERT_FLAG_LEGACY   0x02
#define VERIFY_CERT_FLAG_MISMATCH   0x80
#define VERIFY_CERT_FLAG_NONE   0x00
#define VERIFY_CERT_FLAG_REDIRECT   0x10

Typedef Documentation

typedef BOOL(* pAuthenticate) (freerdp *instance, char **username, char **password, char **domain)
typedef void(* pContextFree) (freerdp *instance, rdpContext *context)
typedef BOOL(* pContextNew) (freerdp *instance, rdpContext *context)
typedef int(* pLogonErrorInfo) (freerdp *instance, UINT32 data, UINT32 type)
typedef BOOL(* pPostConnect) (freerdp *instance)
typedef void(* pPostDisconnect) (freerdp *instance)
typedef BOOL(* pPreConnect) (freerdp *instance)
typedef int(* pReceiveChannelData) (freerdp *instance, UINT16 channelId, BYTE *data, int size, int flags, int totalSize)
typedef int(* pSendChannelData) (freerdp *instance, UINT16 channelId, BYTE *data, int size)
typedef DWORD(* pVerifyCertificate) (freerdp *instance, const char *common_name, const char *subject, const char *issuer, const char *fingerprint, BOOL host_mismatch)

Callback used if user interaction is required to accept an unknown certificate.

Parameters
common_nameThe certificate registered hostname.
subjectThe common name of the certificate.
issuerThe issuer of the certificate.
fingerprintThe fingerprint of the certificate.
host_mismatchA flag indicating the certificate subject does not match the host connecting to.
Returns
1 to accept and store a certificate, 2 to accept a certificate only for this session, 0 otherwise.
typedef DWORD(* pVerifyCertificateEx) (freerdp *instance, const char *host, UINT16 port, const char *common_name, const char *subject, const char *issuer, const char *fingerprint, DWORD flags)

Callback used if user interaction is required to accept an unknown certificate.

Parameters
hostThe hostname connecting to.
portThe port connecting to.
common_nameThe certificate registered hostname.
subjectThe common name of the certificate.
issuerThe issuer of the certificate.
fingerprintThe fingerprint of the certificate.
flagsFlags of type VERIFY_CERT_FLAG*
Returns
1 to accept and store a certificate, 2 to accept a certificate only for this session, 0 otherwise.
typedef DWORD(* pVerifyChangedCertificate) (freerdp *instance, const char *common_name, const char *subject, const char *issuer, const char *new_fingerprint, const char *old_subject, const char *old_issuer, const char *old_fingerprint)

Callback used if user interaction is required to accept a changed certificate.

Parameters
common_nameThe certificate registered hostname.
subjectThe common name of the new certificate.
issuerThe issuer of the new certificate.
fingerprintThe fingerprint of the new certificate.
old_subjectThe common name of the old certificate.
old_issuerThe issuer of the new certificate.
old_fingerprintThe fingerprint of the old certificate.
Returns
1 to accept and store a certificate, 2 to accept a certificate only for this session, 0 otherwise.
typedef DWORD(* pVerifyChangedCertificateEx) (freerdp *instance, const char *host, UINT16 port, const char *common_name, const char *subject, const char *issuer, const char *new_fingerprint, const char *old_subject, const char *old_issuer, const char *old_fingerprint, DWORD flags)

Callback used if user interaction is required to accept a changed certificate.

Parameters
hostThe hostname connecting to.
portThe port connecting to.
common_nameThe certificate registered hostname.
subjectThe common name of the new certificate.
issuerThe issuer of the new certificate.
fingerprintThe fingerprint of the new certificate.
old_subjectThe common name of the old certificate.
old_issuerThe issuer of the new certificate.
old_fingerprintThe fingerprint of the old certificate.
flagsFlags of type VERIFY_CERT_FLAG*
Returns
1 to accept and store a certificate, 2 to accept a certificate only for this session, 0 otherwise.
typedef int(* pVerifyX509Certificate) (freerdp *instance, const BYTE *data, size_t length, const char *hostname, UINT16 port, DWORD flags)

Callback used if user interaction is required to accept a certificate.

Parameters
instancePointer to the freerdp instance.
dataPointer to certificate data in PEM format.
lengthThe length of the certificate data.
hostnameThe hostname connecting to.
portThe port connecting to.
flagsFlags of type VERIFY_CERT_FLAG*
Returns
1 to accept and store a certificate, 2 to accept a certificate only for this session, 0 otherwise.
typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS
typedef struct rdp_rail rdpRail

Enumeration Type Documentation

Defines the possible disconnect reasons in the MCS Disconnect Provider Ultimatum PDU

Enumerator
Disconnect_Ultimatum_domain_disconnected 
Disconnect_Ultimatum_provider_initiated 
Disconnect_Ultimatum_token_purged 
Disconnect_Ultimatum_user_requested 
Disconnect_Ultimatum_channel_purged 

Function Documentation

FREERDP_API BOOL checkChannelErrorEvent ( rdpContext *  context)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void clearChannelError ( rdpContext *  context)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_abort_connect ( freerdp *  instance)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API UINT freerdp_channel_add_init_handle_data ( rdpChannelHandles *  handles,
void pInitHandle,
void pUserData 
)

Here is the call graph for this function:

FREERDP_API UINT freerdp_channel_add_open_handle_data ( rdpChannelHandles *  handles,
DWORD  openHandle,
void pUserData 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void* freerdp_channel_get_init_handle_data ( rdpChannelHandles *  handles,
void pInitHandle 
)

Here is the call graph for this function:

FREERDP_API void* freerdp_channel_get_open_handle_data ( rdpChannelHandles *  handles,
DWORD  openHandle 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void freerdp_channel_remove_init_handle_data ( rdpChannelHandles *  handles,
void pInitHandle 
)

Here is the call graph for this function:

FREERDP_API void freerdp_channel_remove_open_handle_data ( rdpChannelHandles *  handles,
DWORD  openHandle 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API UINT freerdp_channels_attach ( freerdp *  instance)

Here is the call graph for this function:

FREERDP_API UINT freerdp_channels_detach ( freerdp *  instance)

Here is the call graph for this function:

FREERDP_API BOOL freerdp_check_event_handles ( rdpContext *  context)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_check_fds ( freerdp *  instance)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_connect ( freerdp *  instance)

Creates a new connection based on the settings found in the "instance" parameter It will use the callbacks registered on the structure to process the pre/post connect operations that the caller requires.

See also
struct rdp_freerdp in freerdp.h
Parameters
instance- pointer to a rdp_freerdp structure that contains base information to establish the connection. On return, this function will be initialized with the new connection's settings.
Returns
TRUE if successful. FALSE otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void freerdp_context_free ( freerdp *  instance)

Deallocator function for a rdp context. The function will deallocate the resources from the 'instance' parameter that were allocated from a call to freerdp_context_new(). If the ContextFree callback is set in the 'instance' parameter, it will be called before deallocation occurs.

Parameters
instance- Pointer to the rdp_freerdp structure that was initialized by a call to freerdp_context_new(). On return, the fields associated to the context are invalid.

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_context_new ( freerdp *  instance)

Allocator function for a rdp context. The function will allocate a rdpRdp structure using rdp_new(), then copy its contents to the appropriate fields in the rdp_freerdp structure given in parameters. It will also initialize the 'context' field in the rdp_freerdp structure as needed. If the caller has set the ContextNew callback in the 'instance' parameter, it will be called at the end of the function.

Parameters
instance- Pointer to the rdp_freerdp structure that will be initialized with the new context.

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_disconnect ( freerdp *  instance)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_disconnect_before_reconnect ( freerdp *  instance)

Here is the call graph for this function:

FREERDP_API UINT32 freerdp_error_info ( freerdp *  instance)

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_focus_required ( freerdp *  instance)

Here is the caller graph for this function:

FREERDP_API void freerdp_free ( freerdp *  instance)

Deallocator function for the rdp_freerdp structure.

Parameters
instance- pointer to the rdp_freerdp structure to deallocate. On return, this pointer is not valid anymore.

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_build_config ( void  )

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_build_date ( void  )

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_build_revision ( void  )

Here is the caller graph for this function:

FREERDP_API int freerdp_get_disconnect_ultimatum ( rdpContext *  context)

Here is the caller graph for this function:

FREERDP_API DWORD freerdp_get_event_handles ( rdpContext *  context,
HANDLE *  events,
DWORD  count 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_get_fds ( freerdp *  instance,
void **  rfds,
int *  rcount,
void **  wfds,
int *  wcount 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API UINT32 freerdp_get_last_error ( rdpContext *  context)

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_last_error_name ( UINT32  error)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_last_error_string ( UINT32  error)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_logon_error_info_data ( UINT32  data)

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_logon_error_info_type ( UINT32  type)

Here is the caller graph for this function:

FREERDP_API wMessageQueue* freerdp_get_message_queue ( freerdp *  instance,
DWORD  id 
)

Here is the caller graph for this function:

FREERDP_API HANDLE freerdp_get_message_queue_event_handle ( freerdp *  instance,
DWORD  id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API ULONG freerdp_get_transport_sent ( rdpContext *  context,
BOOL  resetCount 
)
FREERDP_API void freerdp_get_version ( int *  major,
int *  minor,
int *  revision 
)

Here is the caller graph for this function:

FREERDP_API const char* freerdp_get_version_string ( void  )

Here is the caller graph for this function:

FREERDP_API int freerdp_message_queue_process_message ( freerdp *  instance,
DWORD  id,
wMessage *  message 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API int freerdp_message_queue_process_pending_messages ( freerdp *  instance,
DWORD  id 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API freerdp* freerdp_new ( void  )

Allocator function for the rdp_freerdp structure.

Returns
an allocated structure filled with 0s. Need to be deallocated using freerdp_free()

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_reconnect ( freerdp *  instance)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API void freerdp_set_error_info ( rdpRdp *  rdp,
UINT32  error 
)

Here is the call graph for this function:

FREERDP_API void freerdp_set_focus ( freerdp *  instance)

Here is the caller graph for this function:

FREERDP_API void freerdp_set_last_error ( rdpContext *  context,
UINT32  lastError 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_shall_disconnect ( freerdp *  instance)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API UINT getChannelError ( rdpContext *  context)

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

FREERDP_API const char* getChannelErrorDescription ( rdpContext *  context)
FREERDP_API HANDLE getChannelErrorEventHandle ( rdpContext *  context)

Here is the caller graph for this function:

FREERDP_API void setChannelError ( rdpContext *  context,
UINT  errorNum,
char *  description 
)

Here is the call graph for this function:

Here is the caller graph for this function: