diff --git a/.travis.yml b/.travis.yml index 93d0772e..897f77c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ min_amd64_deps: &min_amd64_deps min_amd64_conf: &min_amd64_conf env: - CONF_FLAGS="--disable-ipv6 --disable-jpeg --disable-fuse --disable-mp3lame - --disable-rfxcodec --disable-painter --disable-pixman" + --disable-fdkaac --disable-opus --disable-rfxcodec --disable-painter + --disable-pixman" addons: apt: packages: @@ -30,12 +31,15 @@ max_amd64_deps: &max_amd64_deps - libfuse-dev - libjpeg-dev - libmp3lame-dev + - libfdk-aac-dev + - libopus-dev - libpixman-1-dev max_amd64_conf: &max_amd64_conf env: - CONF_FLAGS="--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame - --enable-rfxcodec --enable-painter --enable-pixman" + --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter + --enable-pixman" - DISTCHECK=1 addons: apt: @@ -50,6 +54,8 @@ max_x86_deps: &max_x86_deps - libglu1-mesa-dev:i386 - libjpeg-dev:i386 - libmp3lame-dev:i386 + - libfdk-aac-dev:i386 + - libopus-dev:i386 - libpam0g-dev:i386 - libssl-dev:i386 - libx11-dev:i386 @@ -64,8 +70,8 @@ max_x86_deps: &max_x86_deps max_x86_conf: &max_x86_conf env: - CONF_FLAGS="--enable-ipv6 --enable-jpeg --disable-fuse --enable-mp3lame - --enable-rfxcodec --enable-painter --disable-pixman - --host=i686-linux" + --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter + --disable-pixman --host=i686-linux" - PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig - CFLAGS=-m32 - LDFLAGS=-m32 diff --git a/NEWS.md b/NEWS.md index 59123ac8..898f4ba2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,34 @@ +# Release notes for xrdp v0.9.5 (2017/12/27) + +## Security fixes +* Fix local denial of service [CVE-2017-16927](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16927) #958 #979 + +## New features +* Add a new log level TRACE more verbose than DEBUG #835 #944 +* SSH agent forwarding via RDP #867 #868 FreeRDP/FreeRDP#4122 +* Support horizontal wheel properly #928 + +## Bug fixes + +* Avoid use of hard-coded sesman port #895 +* Workaround for corrupted display with Windows Server 2008 using NeutrinoRDP #869 +* Fix glitch in audio redirection by AAC #910 #936 +* Implement vsock support #930 #935 #948 +* Avoid 100% CPU usage on SSL accept #956 + +## Other changes +* Add US Dvorak keyboard #929 +* Suppress some misleading logs #964 +* Add Finnish keyboard #972 +* Add more user-friendlier description about Xorg config #974 +* Renew pulseaudio document #984 #985 +* Lots of cleanups and refactoring + +## Known issues +* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 + +----------------------- + # Release notes for xrdp v0.9.4 (2017/09/28) ## New features @@ -22,6 +53,8 @@ * Windows 10 (1703) shows black blank screen in RemoteFX mode * This issue is already fixed at Insider Preview build 16273 +----------------------- + # Release notes for xrdp v0.9.3.1 (2017/08/16) This release fixes a trivial packaging issue #848 occurred in v0.9.3. The issue only affects systemd systems. This release is principally for distro packagers or users who compile & install xrdp from source. @@ -31,6 +64,8 @@ Users who running xrdp on these systems don't need to upgrade from v0.9.3 to v0. * Linux systems without systemd * non-Linux systems such as BSD operating systems +----------------------- + # Release notes for xrdp v0.9.3 (2017/07/15) ## New features diff --git a/README.md b/README.md index ddbbf3fa..f8fe462f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neutrinolabs/xrdp) ![Apache-License](https://img.shields.io/badge/License-Apache%202.0-blue.svg) -*Current Version:* 0.9.4 +*Current Version:* 0.9.5 # xrdp - an open source RDP server @@ -29,7 +29,7 @@ RDP transport is encrypted using TLS by default. ### Access to Remote Resources * two-way clipboard transfer (text, bitmap, file) - * audio redirection + * audio redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection)) * drive redirection (mount local client drives on remote machine) ## Quick Start @@ -114,6 +114,11 @@ make sudo make install ``` +If you want to use audio redirection, you need to build and install additional +pulseaudio modules. The build instructions can be found at wiki. + +* [How to set up audio redirection](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection) + ## Directory Structure ``` diff --git a/common/Makefile.am b/common/Makefile.am index 3f44dff2..a76c3f6e 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -33,7 +33,6 @@ libcommon_la_SOURCES = \ arch.h \ base64.h \ base64.c \ - crc16.h \ defines.h \ fifo.c \ fifo.h \ diff --git a/common/crc16.h b/common/crc16.h deleted file mode 100644 index e69de29b..00000000 diff --git a/common/log.c b/common/log.c index 29904fe5..ea2af316 100644 --- a/common/log.c +++ b/common/log.c @@ -94,6 +94,7 @@ internal_log_xrdp2syslog(const enum logLevels lvl) case LOG_LEVEL_INFO: return LOG_INFO; case LOG_LEVEL_DEBUG: + case LOG_LEVEL_TRACE: return LOG_DEBUG; default: g_writeln("Undefined log level - programming error"); @@ -128,6 +129,9 @@ internal_log_lvl2str(const enum logLevels lvl, char *str) case LOG_LEVEL_DEBUG: snprintf(str, 9, "%s", "[DEBUG] "); break; + case LOG_LEVEL_TRACE: + snprintf(str, 9, "%s", "[TRACE] "); + break; default: snprintf(str, 9, "%s", "PRG ERR!"); g_writeln("Programming error - undefined log level!!!"); @@ -194,9 +198,6 @@ internal_log_end(struct log_config *l_cfg) return ret; } - /* closing log file */ - log_message(LOG_LEVEL_ALWAYS, "shutting down log subsystem..."); - if (-1 != l_cfg->fd) { /* closing logfile... */ @@ -254,6 +255,11 @@ internal_log_text2level(const char *buf) { return LOG_LEVEL_DEBUG; } + else if (0 == g_strcasecmp(buf, "5") || + 0 == g_strcasecmp(buf, "trace")) + { + return LOG_LEVEL_TRACE; + } g_writeln("Your configured log level is corrupt - we use debug log level"); return LOG_LEVEL_DEBUG; diff --git a/common/log.h b/common/log.h index bd5852eb..2f8063e1 100644 --- a/common/log.h +++ b/common/log.h @@ -33,7 +33,8 @@ enum logLevels LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_INFO, - LOG_LEVEL_DEBUG + LOG_LEVEL_DEBUG, + LOG_LEVEL_TRACE }; /* startup return values */ diff --git a/common/os_calls.c b/common/os_calls.c index 642ba4a0..e7fc144c 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -41,6 +41,9 @@ #include #include #include +#if defined(XRDP_ENABLE_VSOCK) +#include +#endif #include #include #include @@ -576,12 +579,23 @@ int g_sck_local_socket(void) { #if defined(_WIN32) - return 0; + return -1; #else return socket(PF_LOCAL, SOCK_STREAM, 0); #endif } +/*****************************************************************************/ +int +g_sck_vsock_socket(void) +{ +#if defined(XRDP_ENABLE_VSOCK) + return socket(PF_VSOCK, SOCK_STREAM, 0); +#else + return -1; +#endif +} + /*****************************************************************************/ /* returns error */ int @@ -655,6 +669,9 @@ g_sck_close(int sck) struct sockaddr_in sock_addr_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sock_addr_in6; +#endif +#if defined(XRDP_ENABLE_VSOCK) + struct sockaddr_vm sock_addr_vm; #endif } sock_info; socklen_t sock_len = sizeof(sock_info); @@ -695,6 +712,22 @@ g_sck_close(int sck) g_snprintf(sockname, sizeof(sockname), "AF_UNIX"); break; +#if defined(XRDP_ENABLE_VSOCK) + + case AF_VSOCK: + { + struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm; + + g_snprintf(sockname, + sizeof(sockname), + "AF_VSOCK cid %d port %d", + sock_addr_vm->svm_cid, + sock_addr_vm->svm_port); + break; + } + +#endif + default: g_snprintf(sockname, sizeof(sockname), "unknown family %d", sock_info.sock_addr.sa_family); @@ -990,6 +1023,24 @@ g_sck_local_bind(int sck, const char *port) #endif } +/*****************************************************************************/ +int +g_sck_vsock_bind(int sck, const char *port) +{ +#if defined(XRDP_ENABLE_VSOCK) + struct sockaddr_vm s; + + g_memset(&s, 0, sizeof(struct sockaddr_vm)); + s.svm_family = AF_VSOCK; + s.svm_port = atoi(port); + s.svm_cid = VMADDR_CID_ANY; + + return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_vm)); +#else + return -1; +#endif +} + #if defined(XRDP_ENABLE_IPV6) /*****************************************************************************/ /* Helper function for g_tcp_bind_address. */ @@ -1180,9 +1231,9 @@ g_tcp_accept(int sck) { struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; - snprintf(msg, sizeof(msg), "A connection received from %s port %d", - inet_ntoa(sock_addr_in->sin_addr), - ntohs(sock_addr_in->sin_port)); + g_snprintf(msg, sizeof(msg), "A connection received from %s port %d", + inet_ntoa(sock_addr_in->sin_addr), + ntohs(sock_addr_in->sin_port)); log_message(LOG_LEVEL_INFO, "%s", msg); break; @@ -1197,8 +1248,8 @@ g_tcp_accept(int sck) inet_ntop(sock_addr_in6->sin6_family, &sock_addr_in6->sin6_addr, addr, sizeof(addr)); - snprintf(msg, sizeof(msg), "A connection received from %s port %d", - addr, ntohs(sock_addr_in6->sin6_port)); + g_snprintf(msg, sizeof(msg), "A connection received from %s port %d", + addr, ntohs(sock_addr_in6->sin6_port)); log_message(LOG_LEVEL_INFO, "%s", msg); break; @@ -1226,6 +1277,9 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes) struct sockaddr_in6 sock_addr_in6; #endif struct sockaddr_un sock_addr_un; +#if defined(XRDP_ENABLE_VSOCK) + struct sockaddr_vm sock_addr_vm; +#endif } sock_info; socklen_t sock_len = sizeof(sock_info); @@ -1273,6 +1327,26 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes) g_snprintf(msg, sizeof(msg), "AF_UNIX connection received"); break; } + +#if defined(XRDP_ENABLE_VSOCK) + + case AF_VSOCK: + { + struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm; + + g_snprintf(addr, addr_bytes - 1, "%d", sock_addr_vm->svm_cid); + g_snprintf(port, addr_bytes - 1, "%d", sock_addr_vm->svm_port); + + g_snprintf(msg, + sizeof(msg), + "AF_VSOCK connection received from cid: %s port: %s", + addr, + port); + + break; + } + +#endif default: { g_strncpy(addr, "", addr_bytes - 1); @@ -1358,13 +1432,13 @@ g_write_ip_address(int rcv_sck, char *ip_address, int bytes) if (ok) { - snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck); + g_snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck); } } if (!ok) { - snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck); + g_snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck); } g_free(addr); diff --git a/common/os_calls.h b/common/os_calls.h index 98f87b3e..e42e95bd 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -62,6 +62,7 @@ int g_sck_get_send_buffer_bytes(int sck, int *bytes); int g_sck_set_recv_buffer_bytes(int sck, int bytes); int g_sck_get_recv_buffer_bytes(int sck, int *bytes); int g_sck_local_socket(void); +int g_sck_vsock_socket(void); int g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid); void g_sck_close(int sck); int g_tcp_connect(int sck, const char* address, const char* port); @@ -69,6 +70,7 @@ int g_sck_local_connect(int sck, const char* port); int g_sck_set_non_blocking(int sck); int g_tcp_bind(int sck, const char *port); int g_sck_local_bind(int sck, const char* port); +int g_sck_vsock_bind(int sck, const char* port); int g_tcp_bind_address(int sck, const char* port, const char* address); int g_sck_listen(int sck); int g_tcp_accept(int sck); diff --git a/common/ssl_calls.c b/common/ssl_calls.c index 0e12e960..8eec7123 100644 --- a/common/ssl_calls.c +++ b/common/ssl_calls.c @@ -651,6 +651,15 @@ ssl_tls_accept(struct ssl_tls *self, long ssl_protocols, * SSL_ERROR_WANT_READ * SSL_ERROR_WANT_WRITE */ + switch (SSL_get_error(self->ssl, connection_status)) + { + case SSL_ERROR_WANT_READ: + g_sck_can_recv(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); + break; + case SSL_ERROR_WANT_WRITE: + g_sck_can_send(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); + break; + } } else { diff --git a/common/trans.c b/common/trans.c index d73764de..9448760c 100644 --- a/common/trans.c +++ b/common/trans.c @@ -831,6 +831,26 @@ trans_listen_address(struct trans *self, char *port, const char *address) } } } + else if (self->mode == TRANS_MODE_VSOCK) /* vsock socket */ + { + self->sck = g_sck_vsock_socket(); + if (self->sck < 0) + { + return 1; + } + + g_tcp_set_non_blocking(self->sck); + + if (g_sck_vsock_bind(self->sck, port) == 0) + { + if (g_tcp_listen(self->sck) == 0) + { + self->status = TRANS_STATUS_UP; /* ok */ + self->type1 = TRANS_TYPE_LISTENER; /* listener */ + return 0; + } + } + } return 1; } diff --git a/common/trans.h b/common/trans.h index 77d1ed17..57a0fd6a 100644 --- a/common/trans.h +++ b/common/trans.h @@ -26,6 +26,7 @@ #define TRANS_MODE_TCP 1 #define TRANS_MODE_UNIX 2 +#define TRANS_MODE_VSOCK 3 #define TRANS_TYPE_LISTENER 1 #define TRANS_TYPE_SERVER 2 @@ -62,7 +63,7 @@ struct source_info struct trans { tbus sck; /* socket handle */ - int mode; /* 1 tcp, 2 unix socket */ + int mode; /* 1 tcp, 2 unix socket, 3 vsock */ int status; int type1; /* 1 listener 2 server 3 client */ ttrans_data_in trans_data_in; diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index f1b13234..4a6d2c27 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -25,37 +25,32 @@ /* TCP port for Remote Desktop Protocol */ #define TCP_PORT_RDP 3389 +/****************************************************************************** + * + * xrdp constants + * + ******************************************************************************/ + +#define INFO_CLIENT_NAME_BYTES 32 + +#define XRDP_MAX_BITMAP_CACHE_ID 3 +#define XRDP_MAX_BITMAP_CACHE_IDX 2000 +#define XRDP_BITMAP_CACHE_ENTRIES 2048 + +#define XR_MIN_KEY_CODE 8 +#define XR_MAX_KEY_CODE 256 + +/* + * Constants come from ITU-T Recommendations + */ + #define ISO_PDU_CR 0xE0 /* X.224 Connection Request */ #define ISO_PDU_CC 0xD0 /* X.224 Connection Confirm */ #define ISO_PDU_DR 0x80 /* Disconnect Request */ #define ISO_PDU_DT 0xF0 /* Data */ #define ISO_PDU_ER 0x70 /* Error */ - -/* RDP Security Negotiation codes */ -#define RDP_NEG_REQ 0x01 -#define RDP_NEG_RSP 0x02 -#define RDP_NEG_FAILURE 0x03 -#define RDP_CORRELATION_INFO 0x06 -/* Protocol types codes */ -#define PROTOCOL_RDP 0x0 -#define PROTOCOL_SSL 0x1 -#define PROTOCOL_HYBRID 0x2 -#define PROTOCOL_HYBRID_EX 0x8 -/* Negotiation packet flags */ -#define EXTENDED_CLIENT_DATA_SUPPORTED 0x1 -#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x2 -#define RDP_NEGRSP_RESERVED 0x4 -/* Failure Codes */ -#define SSL_REQUIRED_BY_SERVER 0x1 -#define SSL_NOT_ALLOWED_BY_SERVER 0x2 -#define SSL_CERT_NOT_ON_SERVER 0x3 -#define INCONSISTENT_FLAGS 0x4 -#define HYBRID_REQUIRED_BY_SERVER 0x5 -#define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER 0x6 - - -/* MCS PDU codes */ +/* MCS PDU codes (T.125) */ #define MCS_EDRQ 1 /* Erect Domain Request */ #define MCS_DPUM 8 /* Disconnect Provider Ultimatum */ #define MCS_AURQ 10 /* Attach User Request */ @@ -65,6 +60,585 @@ #define MCS_SDRQ 25 /* Send Data Request */ #define MCS_SDIN 26 /* Send Data Indication */ +/* + * Constants come from Remote Desktop Protocol + */ + +/* RDP Security Negotiation codes */ +#define RDP_NEG_REQ 0x01 /* MS-RDPBCGR 2.2.1.1.1 */ +#define RDP_NEG_RSP 0x02 /* MS-RDPBCGR 2.2.1.2.1 */ +#define RDP_NEG_FAILURE 0x03 /* MS-RDPBCGR 2.2.1.2.2 */ +#define RDP_CORRELATION_INFO 0x06 /* MS-RDPBCGR 2.2.1.1.2 */ + +/* Protocol types codes (MS-RDPBCGR 2.2.1.1.1) */ +#define PROTOCOL_RDP 0x00000000 +#define PROTOCOL_SSL 0x00000001 +#define PROTOCOL_HYBRID 0x00000002 +#define PROTOCOL_RDSTLS 0x00000004 +#define PROTOCOL_HYBRID_EX 0x00000008 + +/* Negotiation packet flags (MS-RDPBCGR 2.2.1.2.1) */ +#define EXTENDED_CLIENT_DATA_SUPPORTED 0x01 +#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02 +#define NEGRSP_RESERVED 0x04 +#define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08 +#define REDIRECTED_AUTHENTICATION_MODE_SUPPORTED 0x10 + +/* RDP Negotiation Failure Codes (MS-RDPBCGR 2.2.1.2.2) */ +#define SSL_REQUIRED_BY_SERVER 0x00000001 +#define SSL_NOT_ALLOWED_BY_SERVER 0x00000002 +#define SSL_CERT_NOT_ON_SERVER 0x00000003 +#define INCONSISTENT_FLAGS 0x00000004 +#define HYBRID_REQUIRED_BY_SERVER 0x00000005 +#define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER 0x00000006 + +/* Client Core Data: connectionType (MS-RDPBCGR 2.2.1.3.2) */ +#define CONNECTION_TYPE_MODEM 0x01 +#define CONNECTION_TYPE_BROADBAND_LOW 0x02 +#define CONNECTION_TYPE_SATELLITE 0x03 +#define CONNECTION_TYPE_BROADBAND_HIGH 0x04 +#define CONNECTION_TYPE_WAN 0x05 +#define CONNECTION_TYPE_LAN 0x06 +#define CONNECTION_TYPE_AUTODETECT 0x07 + +/* Client Core Data: colorDepth, postBeta2ColorDepth (MS-RDPBCGR 2.2.1.3.2) */ +#define RNS_UD_COLOR_4BPP 0xCA00 +#define RNS_UD_COLOR_8BPP 0xCA01 +#define RNS_UD_COLOR_16BPP_555 0xCA02 +#define RNS_UD_COLOR_16BPP_565 0xCA03 +#define RNS_UD_COLOR_24BPP 0xCA04 + +/* Slow-Path Input Event: messageType (MS-RDPBCGR 2.2.8.1.1.3.1.1) */ +/* TODO: to be renamed */ +#define RDP_INPUT_SYNCHRONIZE 0 +#define RDP_INPUT_CODEPOINT 1 +#define RDP_INPUT_VIRTKEY 2 +#define RDP_INPUT_SCANCODE 4 +#define RDP_INPUT_UNICODE 5 +#define RDP_INPUT_MOUSE 0x8001 +#define RDP_INPUT_MOUSEX 0x8002 + +#define FASTPATH_INPUT_ENCRYPTED 0x2 + +/* Fast-Path Input Event: eventCode (MS-RDPBCGR 2.2.8.1.2.2) */ +#define FASTPATH_INPUT_EVENT_SCANCODE 0x0 +#define FASTPATH_INPUT_EVENT_MOUSE 0x1 +#define FASTPATH_INPUT_EVENT_MOUSEX 0x2 +#define FASTPATH_INPUT_EVENT_SYNC 0x3 +#define FASTPATH_INPUT_EVENT_UNICODE 0x4 +#define FASTPATH_INPUT_EVENT_QOE_TIMESTAMP 0x6 + +/* Fast-Path Keyboard Event: eventHeader (MS-RDPBCGR 2.2.8.2.2.1) */ +#define FASTPATH_INPUT_KBDFLAGS_RELEASE 0x01 +#define FASTPATH_INPUT_KBDFLAGS_EXTENDED 0x02 +#define FASTPATH_INPUT_KBDFLAGS_EXTENDED1 0x04 + +/* Server Fast-Path Update PDU: action (MS-RDPBCGR 2.2.0.1.2) */ +#define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 +#define FASTPATH_OUTPUT_ACTION_X224 0x3 + +/* Server Fast-Path Update PDU: flags (MS-RDPBCGR 2.2.0.1.2) */ +#define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 +#define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1 +#define FASTPATH_OUTPUT_ENCRYPTED 0x2 + +/* Fast-Path Update: updateCode (MS-RDPBCGR 2.2.9.1.2.1) */ +#define FASTPATH_UPDATETYPE_ORDERS 0x0 +#define FASTPATH_UPDATETYPE_BITMAP 0x1 +#define FASTPATH_UPDATETYPE_PALETTE 0x2 +#define FASTPATH_UPDATETYPE_SYNCHRONIZE 0x3 +#define FASTPATH_UPDATETYPE_SURFCMDS 0x4 +#define FASTPATH_UPDATETYPE_PTR_NULL 0x5 +#define FASTPATH_UPDATETYPE_PTR_DEFAULT 0x6 +#define FASTPATH_UPDATETYPE_PTR_POSITION 0x8 +#define FASTPATH_UPDATETYPE_COLOR 0x9 +#define FASTPATH_UPDATETYPE_CACHED 0xA +#define FASTPATH_UPDATETYPE_POINTER 0xB + +/* Fast-Path Update: fragmentation (MS-RDPBCGR 2.2.9.1.2.1) */ +#define FASTPATH_FRAGMENT_SINGLE 0x0 +#define FASTPATH_FRAGMENT_LAST 0x1 +#define FASTPATH_FRAGMENT_FIRST 0x2 +#define FASTPATH_FRAGMENT_NEXT 0x3 +#define FASTPATH_OUTPUT_COMPRESSION_USED 0x2 + +/* Mouse Event: pointerFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.3) */ +#define PTRFLAGS_HWHEEL 0x0400 +#define PTRFLAGS_WHEEL 0x0200 +#define PTRFLAGS_WHEEL_NEGATIVE 0x0100 +#define WheelRotationMask 0x01FF +#define PTRFLAGS_MOVE 0x0800 +#define PTRFLAGS_DOWN 0x8000 +#define PTRFLAGS_BUTTON1 0x1000 +#define PTRFLAGS_BUTTON2 0x2000 +#define PTRFLAGS_BUTTON3 0x4000 + +/* Extended Mouse Event: pointerFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.4) */ +#define PTRXFLAGS_DOWN 0x8000 +#define PTRXFLAGS_BUTTON1 0x0001 +#define PTRXFLAGS_BUTTON2 0x0002 + +/* General Capability Set: osMajorType (MS-RDPBCGR 2.2.7.1.1) */ +#define OSMAJORTYPE_UNSPECIFIED 0x0000 +#define OSMAJORTYPE_WINDOWS 0x0001 +#define OSMAJORTYPE_OS2 0x0002 +#define OSMAJORTYPE_MACINTOSH 0x0003 +#define OSMAJORTYPE_UNIX 0x0004 +#define OSMAJORTYPE_IOS 0x0005 +#define OSMAJORTYPE_OSX 0x0006 +#define OSMAJORTYPE_ANDROID 0x0007 +#define OSMAJORTYPE_CHROME_OS 0x0008 + +/* General Capability Set: osMinorType (MS-RDPBCGR 2.2.7.1.1) */ +#define OSMINORTYPE_UNSPECIFIED 0x0000 +#define OSMINORTYPE_WINDOWS_31X 0x0001 +#define OSMINORTYPE_WINDOWS_95 0x0002 +#define OSMINORTYPE_WINDOWS_NT 0x0003 +#define OSMINORTYPE_OS2_V21 0x0004 +#define OSMINORTYPE_POWER_PC 0x0005 +#define OSMINORTYPE_MACINTOSH 0x0006 +#define OSMINORTYPE_NATIVE_XSERVER 0x0007 +#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 +#define OSMINORTYPE_WINDOWS_RT 0x0009 + +/* Extended Info Packet: performanceFlags (MS-RDPBCGR 2.2.1.11.1.1.1) */ +/* TODO: to be renamed */ +#define RDP5_DISABLE_NOTHING 0x00 +#define RDP5_NO_WALLPAPER 0x01 +#define RDP5_NO_FULLWINDOWDRAG 0x02 +#define RDP5_NO_MENUANIMATIONS 0x04 +#define RDP5_NO_THEMING 0x08 +#define RDP5_NO_CURSOR_SHADOW 0x20 +#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */ + +/* Virtual channel options */ +/* Channel Definition Structure: options (MS-RDPBCGR 2.2.1.3.4.1) */ +#define REMOTE_CONTROL_PERSISTENT 0x00100000 +/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */ +#define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 +#define XR_CHANNEL_OPTION_COMPRESS 0x00400000 +#define XR_CHANNEL_OPTION_COMPRESS_RDP 0x00800000 +#define XR_CHANNEL_OPTION_PRI_LOW 0x02000000 +#define XR_CHANNEL_OPTION_PRI_MED 0x04000000 +#define XR_CHANNEL_OPTION_PRI_HIGH 0x08000000 +#define XR_CHANNEL_OPTION_ENCRYPT_CS 0x10000000 +#define XR_CHANNEL_OPTION_ENCRYPT_SC 0x20000000 +#define XR_CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 +#define XR_CHANNEL_OPTION_INITIALIZED 0x80000000 + +/* RDPDR: Device Announce Header: DeviceType (MS-RDPEFS 2.2.1.3) */ +/* TODO: to be renamed */ +#define DEVICE_TYPE_SERIAL 0x01 +#define DEVICE_TYPE_PARALLEL 0x02 +#define DEVICE_TYPE_PRINTER 0x04 +#define DEVICE_TYPE_DISK 0x08 +#define DEVICE_TYPE_SCARD 0x20 + +/* Order Capability Set: orderSupportExFlags (MS-RDPBCGR 2.2.7.1.3) */ +#define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT 0x0002 +#define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004 +#define XR_ORDERFLAGS_EX_OFFSCREEN_COMPOSITE_SUPPORT 0x0100 + +/* Order Capability Set: orderSupport (MS-RDPBCGR 2.2.7.1.3) */ +#define TS_NEG_DSTBLT_INDEX 0x00 +#define TS_NEG_PATBLT_INDEX 0x01 +#define TS_NEG_SCRBLT_INDEX 0x02 +#define TS_NEG_MEMBLT_INDEX 0x03 +#define TS_NEG_MEM3BLT_INDEX 0x04 + /* 0x05 */ + /* 0x06 */ +#define TS_NEG_DRAWNINEGRID_INDEX 0x07 +#define TS_NEG_LINETO_INDEX 0x08 +#define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x09 + /* 0x0A */ +#define TS_NEG_SAVEBITMAP_INDEX 0x0B + /* 0x0C */ + /* 0x0D */ + /* 0x0E */ +#define TS_NEG_MULTIDSTBLT_INDEX 0x0F +#define TS_NEG_MULTIPATBLT_INDEX 0x10 +#define TS_NEG_MULTISCRBLT_INDEX 0x11 +#define TS_NEG_MULTIOPAQUERECT_INDEX 0x12 +#define TS_NEG_FAST_INDEX_INDEX 0x13 +#define TS_NEG_POLYGON_SC_INDEX 0x14 +#define TS_NEG_POLYGON_CB_INDEX 0x15 +#define TS_NEG_POLYLINE_INDEX 0x16 + /* 0x17 */ +#define TS_NEG_FAST_GLYPH_INDEX 0x18 +#define TS_NEG_ELLIPSE_SC_INDEX 0x19 +#define TS_NEG_ELLIPSE_CB_INDEX 0x1A +#define TS_NEG_INDEX_INDEX 0x1B + /* 0x1C */ + /* 0x1D */ + /* 0x1E */ + /* 0x1F */ + +/* General Capability Set: extraFlags (MS-RDPBCGR 2.2.7.1.1) */ +#define TS_CAPS_PROTOCOLVERSION 0x0200 +#define FASTPATH_OUTPUT_SUPPORTED 0x0001 +#define NO_BITMAP_COMPRESSION_HDR 0x0400 +#define LONG_CREDENTIALS_SUPPORTED 0x0004 +#define AUTORECONNECT_SUPPORTED 0x0008 +#define ENC_SALTED_CHECKSUM 0x0010 + +/* Order Capability Set: orderFlags (MS-RDPBCGR 2.2.7.1.3) */ +#define NEGOTIATEORDERSUPPORT 0x0002 +#define ZEROBOUNDSDELTASUPPORT 0x0008 +#define COLORINDEXSUPPORT 0x0020 +#define SOLIDPATTERNBRUSHONLY 0x0040 +#define ORDERFLAGS_EXTRA_FLAGS 0x0080 + +/* Input Capability Set: inputFlags (MS-RDPBCGR 2.2.7.1.6) */ +#define INPUT_FLAG_SCANCODES 0x0001 +#define INPUT_FLAG_MOUSEX 0x0004 +#define INPUT_FLAG_FASTPATH_INPUT 0x0008 +#define INPUT_FLAG_UNICODE 0x0010 +#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 +#define INPUT_FLAG_UNUSED1 0x0040 +#define INPUT_FLAG_UNUSED2 0x0080 +#define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100 +#define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200 + +/* Desktop Composition Capability Set: CompDeskSupportLevel (MS-RDPBCGR 2.2.7.2.8) */ +#define COMPDESK_NOT_SUPPORTED 0x0000 +#define COMPDESK_SUPPORTED 0x0001 + +/* Surface Commands Capability Set: cmdFlags (MS-RDPBCGR 2.2.7.2.9) */ +#define SURFCMDS_SETSURFACEBITS 0x00000002 +#define SURFCMDS_FRAMEMARKER 0x00000010 +#define SURFCMDS_STREAMSUFRACEBITS 0x00000040 + +/* Bitmap Codec: codecGUID (MS-RDPBCGR 2.2.7.2.10.1.1) */ + +/* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */ +#define XR_CODEC_GUID_NSCODEC \ + "\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6" + +/* CODEC_GUID_REMOTEFX 76772F12-BD72-4463-AFB3B73C9C6F7886 */ +#define XR_CODEC_GUID_REMOTEFX \ + "\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86" + +/* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */ +#define XR_CODEC_GUID_IMAGE_REMOTEFX \ + "\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54" + +/* MFVideoFormat_H264 0x34363248-0000-0010-800000AA00389B71 */ +#define XR_CODEC_GUID_H264 \ + "\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71" + +/* CODEC_GUID_JPEG 1BAF4CE6-9EED-430C-869ACB8B37B66237 */ +#define XR_CODEC_GUID_JPEG \ + "\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37" + +/* CODEC_GUID_PNG 0E0C858D-28E0-45DB-ADAA0F83E57CC560 */ +#define XR_CODEC_GUID_PNG \ + "\x8D\x85\x0C\x0E\xE0\x28\xDB\x45\xAD\xAA\x0F\x83\xE5\x7C\xC5\x60" + +/* Surface Command Type (MS-RDPBCGR 2.2.9.1.2.1.10.1) */ +#define CMDTYPE_SET_SURFACE_BITS 0x0001 +#define CMDTYPE_FRAME_MARKER 0x0004 +#define CMDTYPE_STREAM_SURFACE_BITS 0x0006 + +/* RDP5 disconnect PDU */ +/* Set Error Info PDU Data: errorInfo (MS-RDPBCGR 2.2.5.1.1) */ +/* TODO: to be renamed */ +#define exDiscReasonNoInfo 0x0000 +#define exDiscReasonAPIInitiatedDisconnect 0x0001 +#define exDiscReasonAPIInitiatedLogoff 0x0002 +#define exDiscReasonServerIdleTimeout 0x0003 +#define exDiscReasonServerLogonTimeout 0x0004 +#define exDiscReasonReplacedByOtherConnection 0x0005 +#define exDiscReasonOutOfMemory 0x0006 +#define exDiscReasonServerDeniedConnection 0x0007 +#define exDiscReasonServerDeniedConnectionFips 0x0008 +#define exDiscReasonLicenseInternal 0x0100 +#define exDiscReasonLicenseNoLicenseServer 0x0101 +#define exDiscReasonLicenseNoLicense 0x0102 +#define exDiscReasonLicenseErrClientMsg 0x0103 +#define exDiscReasonLicenseHwidDoesntMatchLicense 0x0104 +#define exDiscReasonLicenseErrClientLicense 0x0105 +#define exDiscReasonLicenseCantFinishProtocol 0x0106 +#define exDiscReasonLicenseClientEndedProtocol 0x0107 +#define exDiscReasonLicenseErrClientEncryption 0x0108 +#define exDiscReasonLicenseCantUpgradeLicense 0x0109 +#define exDiscReasonLicenseNoRemoteConnections 0x010a + +/* Info Packet (TS_INFO_PACKET): flags (MS-RDPBCGR 2.2.1.11.1.1) */ +/* TODO: to be renamed */ +#define RDP_LOGON_AUTO 0x0008 +#define RDP_LOGON_NORMAL 0x0033 +#define RDP_COMPRESSION 0x0080 +#define RDP_LOGON_BLOB 0x0100 +#define RDP_LOGON_LEAVE_AUDIO 0x2000 + +/* Compression Flags (MS-RDPBCGR 3.1.8.2.1) */ +/* TODO: to be renamed, not used anywhere */ +#define RDP_MPPC_COMPRESSED 0x20 +#define RDP_MPPC_RESET 0x40 +#define RDP_MPPC_FLUSH 0x80 +#define RDP_MPPC_DICT_SIZE 8192 /* RDP 4.0 | MS-RDPBCGR 3.1.8 */ + +/* Drawing Order: controlFlags (MS-RDPEGDI 2.2.2.2.1, ) */ +/* TODO: to be renamed */ +#define RDP_ORDER_STANDARD 0x01 +#define RDP_ORDER_SECONDARY 0x02 +#define RDP_ORDER_BOUNDS 0x04 +#define RDP_ORDER_CHANGE 0x08 +#define RDP_ORDER_DELTA 0x10 +#define RDP_ORDER_LASTBOUNDS 0x20 +#define RDP_ORDER_SMALL 0x40 +#define RDP_ORDER_TINY 0x80 + +/* Drawing Order: orderType (MS-RDPEGDI 2.2.2.2.1.1.2) ? */ +#define RDP_ORDER_DESTBLT 0 +#define RDP_ORDER_PATBLT 1 +#define RDP_ORDER_SCREENBLT 2 +#define RDP_ORDER_LINE 9 +#define RDP_ORDER_RECT 10 +#define RDP_ORDER_DESKSAVE 11 +#define RDP_ORDER_MEMBLT 13 +#define RDP_ORDER_TRIBLT 14 +#define RDP_ORDER_POLYLINE 22 +#define RDP_ORDER_TEXT2 27 +#define RDP_ORDER_COMPOSITE 37 /* 0x25 */ + +/* Secondary Drawing Order Header: orderType (MS-RDPEGDI 2.2.2.2.1.2.1.1) */ +/* TODO: to be renamed */ +#define RDP_ORDER_RAW_BMPCACHE 0 +#define RDP_ORDER_COLCACHE 1 +#define RDP_ORDER_BMPCACHE 2 +#define RDP_ORDER_FONTCACHE 3 +#define RDP_ORDER_RAW_BMPCACHE2 4 +#define RDP_ORDER_BMPCACHE2 5 +#define RDP_ORDER_BRUSHCACHE 7 +#define RDP_ORDER_BMPCACHE3 8 + +/* Maps to generalCapabilitySet in T.128 page 138 */ + +/* Capability Set: capabilitySetType (MS-RDPBCGR 2.2.1.13.1.1.1) */ +/* TODO: to be renamed */ +#define RDP_CAPSET_GENERAL 0x0001 +#define RDP_CAPLEN_GENERAL 0x18 + +#define RDP_CAPSET_BITMAP 0x0002 +#define RDP_CAPLEN_BITMAP 0x1C + +#define RDP_CAPSET_ORDER 0x0003 +#define RDP_CAPLEN_ORDER 0x58 +#define ORDER_CAP_NEGOTIATE 2 +#define ORDER_CAP_NOSUPPORT 4 + +#define RDP_CAPSET_BMPCACHE 0x0004 +#define RDP_CAPLEN_BMPCACHE 0x28 + +#define RDP_CAPSET_CONTROL 0x0005 +#define RDP_CAPLEN_CONTROL 0x0C + +#define RDP_CAPSET_ACTIVATE 0x0007 +#define RDP_CAPLEN_ACTIVATE 0x0C + +#define RDP_CAPSET_POINTER 0x0008 +#define RDP_CAPLEN_POINTER 0x0a +#define RDP_CAPLEN_POINTER_MONO 0x08 + +#define RDP_CAPSET_SHARE 0x0009 +#define RDP_CAPLEN_SHARE 0x08 + +#define RDP_CAPSET_COLCACHE 0x000A +#define RDP_CAPLEN_COLCACHE 0x08 + +#define RDP_CAPSET_SOUND 0x000C + +#define RDP_CAPSET_INPUT 0x000D +#define RDP_CAPLEN_INPUT 0x58 + +#define RDP_CAPSET_FONT 0x000E +#define RDP_CAPLEN_FONT 0x04 + +#define RDP_CAPSET_BRUSHCACHE 0x000F +#define RDP_CAPLEN_BRUSHCACHE 0x08 + +#define RDP_CAPSET_GLYPHCACHE 0x0010 +#define RDP_CAPSET_OFFSCREENCACHE 0x0011 + +#define RDP_CAPSET_BITMAP_OFFSCREEN 0x0012 +#define RDP_CAPLEN_BITMAP_OFFSCREEN 0x08 + +#define RDP_CAPSET_BMPCACHE2 0x0013 +#define RDP_CAPLEN_BMPCACHE2 0x28 +#define BMPCACHE2_FLAG_PERSIST ((long)1<<31) + +#define RDP_CAPSET_VIRCHAN 0x0014 +#define RDP_CAPLEN_VIRCHAN 0x08 + +#define RDP_CAPSET_DRAWNINEGRIDCACHE 0x0015 +#define RDP_CAPSET_DRAWGDIPLUS 0x0016 +#define RDP_CAPSET_RAIL 0x0017 +#define RDP_CAPSET_WINDOW 0x0018 + +#define RDP_CAPSET_COMPDESK 0x0019 +#define RDP_CAPLEN_COMPDESK 0x06 + +#define RDP_CAPSET_MULTIFRAGMENT 0x001A +#define RDP_CAPLEN_MULTIFRAGMENT 0x08 + +#define RDP_CAPSET_LPOINTER 0x001B +#define RDP_CAPLEN_LPOINTER 0x06 + +#define RDP_CAPSET_FRAME_ACKNOWLEDGE 0x001E +#define RDP_CAPLEN_FRAME_ACKNOWLEDGE 0x08 + +#define RDP_CAPSET_SURFCMDS 0x001C +#define RDP_CAPLEN_SURFCMDS 0x0C + +#define RDP_CAPSET_BMPCODECS 0x001D +#define RDP_CAPLEN_BMPCODECS 0x1C + + + +/* TS_SECURITY_HEADER: flags (MS-RDPBCGR 2.2.8.1.1.2.1) */ +/* TODO: to be renamed */ +#define SEC_CLIENT_RANDOM 0x0001 /* SEC_EXCHANGE_PKT? */ +#define SEC_ENCRYPT 0x0008 +#define SEC_LOGON_INFO 0x0040 /* SEC_INFO_PKT */ +#define SEC_LICENCE_NEG 0x0080 /* SEC_LICENSE_PKT */ + +#define SEC_TAG_SRV_INFO 0x0c01 /* SC_CORE */ +#define SEC_TAG_SRV_CRYPT 0x0c02 /* SC_SECURITY */ +#define SEC_TAG_SRV_CHANNELS 0x0c03 /* SC_NET? */ + +/* TS_UD_HEADER: type (MS-RDPBCGR (2.2.1.3.1) */ +/* TODO: to be renamed */ +#define SEC_TAG_CLI_INFO 0xc001 /* CS_CORE? */ +#define SEC_TAG_CLI_CRYPT 0xc002 /* CS_SECURITY? */ +#define SEC_TAG_CLI_CHANNELS 0xc003 /* CS_CHANNELS? */ +#define SEC_TAG_CLI_4 0xc004 /* CS_CLUSTER? */ +#define SEC_TAG_CLI_MONITOR 0xc005 /* CS_MONITOR */ + +/* Server Proprietary Certificate (MS-RDPBCGR 2.2.1.4.3.1.1) */ +/* TODO: to be renamed */ +#define SEC_TAG_PUBKEY 0x0006 /* BB_RSA_KEY_BLOB */ +#define SEC_TAG_KEYSIG 0x0008 /* BB_SIGNATURE_KEY_BLOB */ + +/* LicensingMessage (MS-RDPELE 2.2.2) */ +/* TODO: to be renamed */ +#define LICENCE_TAG_DEMAND 0x01 /* LICNSE_REQUEST */ +#define LICENCE_TAG_AUTHREQ 0x02 /* PLATFORM_CHALLENGE */ +#define LICENCE_TAG_ISSUE 0x03 /* NEW_LICENSE */ +#define LICENCE_TAG_REISSUE 0x04 /* UPGRADE_LICENSE */ +#define LICENCE_TAG_PRESENT 0x12 /* LICENSE_INFO */ +#define LICENCE_TAG_REQUEST 0x13 /* NEW_LICENSE_REQUEST */ +#define LICENCE_TAG_AUTHRESP 0x15 /* PLATFORM_CHALLENGE_RESPONSE */ +#define LICENCE_TAG_RESULT 0xff + +/* LICENSE_BINARY_BLOB (MS-RDPBCGR 2.2.1.12.1.2) */ +#define LICENCE_TAG_USER 0x000f /* BB_CLIENT_USER_NAME_BLOB */ +#define LICENCE_TAG_HOST 0x0010 /* BB_CLIENT_MACHINE_NAME_BLOB */ + +/* Share Data Header: pduType2 (MS-RDPBCGR 2.2.8.1.1.1.2) */ +/* TODO: to be renamed */ +#define RDP_DATA_PDU_UPDATE 2 /* PDUTYPE2_UPDATE */ +#define RDP_DATA_PDU_CONTROL 20 +#define RDP_DATA_PDU_POINTER 27 +#define RDP_DATA_PDU_INPUT 28 +#define RDP_DATA_PDU_SYNCHRONISE 31 +#define RDP_DATA_PDU_PLAY_SOUND 34 +#define RDP_DATA_PDU_LOGON 38 +#define RDP_DATA_PDU_FONT2 39 +#define RDP_DATA_PDU_DISCONNECT 47 + +/* Control PDU Data: action (MS-RDPBCGR 2.2.1.15.1) */ +/* TODO: to be renamed */ +#define RDP_CTL_REQUEST_CONTROL 1 /* CTRLACTION_REQUEST_CONTROL */ +#define RDP_CTL_GRANT_CONTROL 2 +#define RDP_CTL_DETACH 3 +#define RDP_CTL_COOPERATE 4 + +/* Slow-Path Graphics Update: updateType (MS-RDPBCGR 2.2.9.1.1.3.1) */ +/* TODO: to be renamed */ +#define RDP_UPDATE_ORDERS 0 +#define RDP_UPDATE_BITMAP 1 +#define RDP_UPDATE_PALETTE 2 +#define RDP_UPDATE_SYNCHRONIZE 3 + +/* Server Pointer Update PDU: messageType (MS-RDPBCGR 2.2.9.1.1.4) */ +/* TODO: to be renamed */ +#define RDP_POINTER_SYSTEM 1 /* TS_PTRMSGTYPE_SYSTEM */ +#define RDP_POINTER_MOVE 3 +#define RDP_POINTER_COLOR 6 +#define RDP_POINTER_CACHED 7 +#define RDP_POINTER_POINTER 8 + +/* System Pointer Update: systemPointerType (MS-RDPBCGR 2.2.9.1.1.4.3) */ +#define RDP_NULL_POINTER 0 +#define RDP_DEFAULT_POINTER 0x7F00 + +/* Keyboard Event: keyboardFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.1) */ +/* TODO: to be renamed */ +#define KBD_FLAG_RIGHT 0x0001 +#define KBD_FLAG_EXT 0x0100 /* KBDFLAGS_EXTENDED */ +#define KBD_FLAG_QUIET 0x1000 +#define KBD_FLAG_DOWN 0x4000 +#define KBD_FLAG_UP 0x8000 + +/* Synchronize Event: toggleFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.5) */ +/* TODO: to be renamed */ +#define KBD_FLAG_SCROLL 0x0001 /* TS_SYNC_SCROLL_LOCK */ +#define KBD_FLAG_NUMLOCK 0x0002 +#define KBD_FLAG_CAPITAL 0x0004 +#define TS_SYNC_KANA_LOCK 0x0008 + +/****************************************************************************** + * + * Constants come from other Microsoft products + * + *****************************************************************************/ + +/* Sound format constants - see also RFC 2361 and MS-RDPAI */ +#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_ADPCM 0x0002 +#define WAVE_FORMAT_ALAW 0x0006 +#define WAVE_FORMAT_MULAW 0x0007 +#define WAVE_FORMAT_MPEGLAYER3 0x0055 +#define WAVE_FORMAT_OPUS 0x0069 +#define WAVE_FORMAT_AAC 0xA106 + +/* https://technet.microsoft.com/ja-jp/library/aa387685.aspx */ +#define SEC_RSA_MAGIC 0x31415352 /* RSA1 */ + +/* NTSTATUS Values (MS-ERREF 2.3.1) */ +/* used for RDPDR */ +#define STATUS_SUCCESS 0x00000000 +#define STATUS_PENDING 0x00000103 + +#define STATUS_NO_MORE_FILES 0x80000006 +#define STATUS_DEVICE_PAPER_EMPTY 0x8000000e +#define STATUS_DEVICE_POWERED_OFF 0x8000000f +#define STATUS_DEVICE_OFF_LINE 0x80000010 +#define STATUS_DEVICE_BUSY 0x80000011 + +#define STATUS_INVALID_HANDLE 0xc0000008 +#define STATUS_INVALID_PARAMETER 0xc000000d +#define STATUS_NO_SUCH_FILE 0xc000000f +#define STATUS_INVALID_DEVICE_REQUEST 0xc0000010 +#define STATUS_ACCESS_DENIED 0xc0000022 +#define STATUS_OBJECT_NAME_COLLISION 0xc0000035 +#define STATUS_DISK_FULL 0xc000007f +#define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba +#define STATUS_NOT_SUPPORTED 0xc00000bb +#define STATUS_TIMEOUT 0xc0000102 +#define STATUS_CANCELLED 0xc0000120 + +/* MS-SMB2 2.2.13 */ +/* TODO: not used anywhere */ +#define FILE_DIRECTORY_FILE 0x00000001 +#define FILE_NON_DIRECTORY_FILE 0x00000040 +#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 + +/* + * not yet sorted out + */ + #define MCS_CONNECT_INITIAL 0x7f65 #define MCS_CONNECT_RESPONSE 0x7f66 @@ -77,57 +651,18 @@ #define MCS_GLOBAL_CHANNEL 1003 #define MCS_USERCHANNEL_BASE 1001 -/* MCS Connection Type (MS-RDPBCGR 2.2.1.3.2) */ -#define CONNECTION_TYPE_MODEM 0x01 -#define CONNECTION_TYPE_BROADBAND_LOW 0x02 -#define CONNECTION_TYPE_SATELLITE 0x03 -#define CONNECTION_TYPE_BROADBAND_HIGH 0x04 -#define CONNECTION_TYPE_WAN 0x05 -#define CONNECTION_TYPE_LAN 0x06 -#define CONNECTION_TYPE_AUTODETECT 0x07 - /* RDP secure transport constants */ +/* not used anywhere */ #define SEC_RANDOM_SIZE 32 #define SEC_MODULUS_SIZE 64 #define SEC_PADDING_SIZE 8 #define SEC_EXPONENT_SIZE 4 -#define SEC_CLIENT_RANDOM 0x0001 -#define SEC_ENCRYPT 0x0008 -#define SEC_LOGON_INFO 0x0040 -#define SEC_LICENCE_NEG 0x0080 - -#define SEC_TAG_SRV_INFO 0x0c01 -#define SEC_TAG_SRV_CRYPT 0x0c02 -#define SEC_TAG_SRV_CHANNELS 0x0c03 - -#define SEC_TAG_CLI_INFO 0xc001 -#define SEC_TAG_CLI_CRYPT 0xc002 -#define SEC_TAG_CLI_CHANNELS 0xc003 -#define SEC_TAG_CLI_4 0xc004 -#define SEC_TAG_CLI_MONITOR 0xc005 - -#define SEC_TAG_PUBKEY 0x0006 -#define SEC_TAG_KEYSIG 0x0008 - -#define SEC_RSA_MAGIC 0x31415352 /* RSA1 */ - /* RDP licensing constants */ #define LICENCE_TOKEN_SIZE 10 #define LICENCE_HWID_SIZE 20 #define LICENCE_SIGNATURE_SIZE 16 -#define LICENCE_TAG_DEMAND 0x01 -#define LICENCE_TAG_AUTHREQ 0x02 -#define LICENCE_TAG_ISSUE 0x03 -#define LICENCE_TAG_REISSUE 0x04 -#define LICENCE_TAG_PRESENT 0x12 -#define LICENCE_TAG_REQUEST 0x13 -#define LICENCE_TAG_AUTHRESP 0x15 -#define LICENCE_TAG_RESULT 0xff - -#define LICENCE_TAG_USER 0x000f -#define LICENCE_TAG_HOST 0x0010 /* RDP PDU codes */ #define RDP_PDU_DEMAND_ACTIVE 1 @@ -136,67 +671,11 @@ #define RDP_PDU_DEACTIVATE 6 #define RDP_PDU_DATA 7 -#define RDP_DATA_PDU_UPDATE 2 -#define RDP_DATA_PDU_CONTROL 20 -#define RDP_DATA_PDU_POINTER 27 -#define RDP_DATA_PDU_INPUT 28 -#define RDP_DATA_PDU_SYNCHRONISE 31 -#define RDP_DATA_PDU_PLAY_SOUND 34 -#define RDP_DATA_PDU_LOGON 38 -#define RDP_DATA_PDU_FONT2 39 -#define RDP_DATA_PDU_DISCONNECT 47 - -#define RDP_CTL_REQUEST_CONTROL 1 -#define RDP_CTL_GRANT_CONTROL 2 -#define RDP_CTL_DETACH 3 -#define RDP_CTL_COOPERATE 4 - -#define RDP_UPDATE_ORDERS 0 -#define RDP_UPDATE_BITMAP 1 -#define RDP_UPDATE_PALETTE 2 -#define RDP_UPDATE_SYNCHRONIZE 3 - -#define RDP_POINTER_SYSTEM 1 -#define RDP_POINTER_MOVE 3 -#define RDP_POINTER_COLOR 6 -#define RDP_POINTER_CACHED 7 -#define RDP_POINTER_POINTER 8 - -#define RDP_NULL_POINTER 0 -#define RDP_DEFAULT_POINTER 0x7F00 - -#define RDP_INPUT_SYNCHRONIZE 0 -#define RDP_INPUT_CODEPOINT 1 -#define RDP_INPUT_VIRTKEY 2 -#define RDP_INPUT_SCANCODE 4 -#define RDP_INPUT_UNICODE 5 -#define RDP_INPUT_MOUSE 0x8001 -#define RDP_INPUT_MOUSEX 0x8002 - -/* Device flags */ -#define KBD_FLAG_RIGHT 0x0001 -#define KBD_FLAG_EXT 0x0100 -#define KBD_FLAG_QUIET 0x1000 -#define KBD_FLAG_DOWN 0x4000 -#define KBD_FLAG_UP 0x8000 - -/* These are for synchronization; not for keystrokes */ -#define KBD_FLAG_SCROLL 0x0001 -#define KBD_FLAG_NUMLOCK 0x0002 -#define KBD_FLAG_CAPITAL 0x0004 - /* See T.128 */ +/* not used anywhere */ #define RDP_KEYPRESS 0 #define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP) -#define MOUSE_FLAG_MOVE 0x0800 -#define MOUSE_FLAG_BUTTON1 0x1000 -#define MOUSE_FLAG_BUTTON2 0x2000 -#define MOUSE_FLAG_BUTTON3 0x4000 -#define MOUSE_FLAG_BUTTON4 0x0280 -#define MOUSE_FLAG_BUTTON5 0x0380 -#define MOUSE_FLAG_DOWN 0x8000 - /* Raster operation masks */ #define ROP2_S(rop3) (rop3 & 0xf) #define ROP2_P(rop3) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2)) @@ -222,118 +701,8 @@ #define PDU_FLAG_FIRST 0x01 #define PDU_FLAG_LAST 0x02 -/* Maps to generalCapabilitySet in T.128 page 138 */ - -/* RDP capabilities */ -#define RDP_CAPSET_GENERAL 1 -#define RDP_CAPLEN_GENERAL 0x18 -#define OSMAJORTYPE_UNSPECIFIED 0x0000 -#define OSMAJORTYPE_WINDOWS 0x0001 -#define OSMAJORTYPE_OS2 0x0002 -#define OSMAJORTYPE_MACINTOSH 0x0003 -#define OSMAJORTYPE_UNIX 0x0004 -#define OSMAJORTYPE_IOS 0x0005 -#define OSMAJORTYPE_OSX 0x0006 -#define OSMAJORTYPE_ANDROID 0x0007 -#define OSMAJORTYPE_CHROME_OS 0x0008 -#define OSMINORTYPE_UNSPECIFIED 0x0000 -#define OSMINORTYPE_WINDOWS_31X 0x0001 -#define OSMINORTYPE_WINDOWS_95 0x0002 -#define OSMINORTYPE_WINDOWS_NT 0x0003 -#define OSMINORTYPE_OS2_V21 0x0004 -#define OSMINORTYPE_POWER_PC 0x0005 -#define OSMINORTYPE_MACINTOSH 0x0006 -#define OSMINORTYPE_NATIVE_XSERVER 0x0007 -#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 -#define OSMINORTYPE_WINDOWS_RT 0x0009 - -#define RDP_CAPSET_BITMAP 2 -#define RDP_CAPLEN_BITMAP 0x1C - -#define RDP_CAPSET_ORDER 3 -#define RDP_CAPLEN_ORDER 0x58 -#define ORDER_CAP_NEGOTIATE 2 -#define ORDER_CAP_NOSUPPORT 4 - -#define RDP_CAPSET_BMPCACHE 4 -#define RDP_CAPLEN_BMPCACHE 0x28 - -#define RDP_CAPSET_CONTROL 5 -#define RDP_CAPLEN_CONTROL 0x0C - -#define RDP_CAPSET_ACTIVATE 7 -#define RDP_CAPLEN_ACTIVATE 0x0C - -#define RDP_CAPSET_POINTER 8 -#define RDP_CAPLEN_POINTER 0x0a -#define RDP_CAPLEN_POINTER_MONO 0x08 - -#define RDP_CAPSET_SHARE 9 -#define RDP_CAPLEN_SHARE 0x08 - -#define RDP_CAPSET_COLCACHE 10 -#define RDP_CAPLEN_COLCACHE 0x08 - -#define RDP_CAPSET_INPUT 13 -#define RDP_CAPLEN_INPUT 0x58 - -#define RDP_CAPSET_FONT 14 -#define RDP_CAPLEN_FONT 0x04 - -#define RDP_CAPSET_BRUSHCACHE 15 -#define RDP_CAPLEN_BRUSHCACHE 0x08 - -#define RDP_CAPSET_BITMAP_OFFSCREEN 18 -#define RDP_CAPLEN_BITMAP_OFFSCREEN 0x08 - -#define RDP_CAPSET_BMPCACHE2 19 -#define RDP_CAPLEN_BMPCACHE2 0x28 -#define BMPCACHE2_FLAG_PERSIST ((long)1<<31) - -#define RDP_CAPSET_VIRCHAN 20 -#define RDP_CAPLEN_VIRCHAN 0x08 - -#define RDP_CAPSET_MULTIFRAGMENT 0x001A -#define RDP_CAPLEN_MULTIFRAGMENT 0x08 - -#define RDP_CAPSET_FRAME_ACKNOWLEDGE 0x001E -#define RDP_CAPLEN_FRAME_ACKNOWLEDGE 0x08 - -#define RDP_CAPSET_SURFCMDS 0x1C -#define RDP_CAPLEN_SURFCMDS 0x0C - -#define RDP_CAPSET_BMPCODECS 0x1D -#define RDP_CAPLEN_BMPCODECS 0x1C - -#define RDP_CAPSET_COMPDESK 0x19 -#define RDP_CAPLEN_COMPDESK 0x06 - -#define RDP_CAPSET_LPOINTER 0x1B -#define RDP_CAPLEN_LPOINTER 0x06 - #define RDP_SOURCE "MSTSC" -/* Logon flags */ -#define RDP_LOGON_AUTO 0x0008 -#define RDP_LOGON_NORMAL 0x0033 -#define RDP_COMPRESSION 0x0080 -#define RDP_LOGON_BLOB 0x0100 -#define RDP_LOGON_LEAVE_AUDIO 0x2000 - -#define RDP5_DISABLE_NOTHING 0x00 -#define RDP5_NO_WALLPAPER 0x01 -#define RDP5_NO_FULLWINDOWDRAG 0x02 -#define RDP5_NO_MENUANIMATIONS 0x04 -#define RDP5_NO_THEMING 0x08 -#define RDP5_NO_CURSOR_SHADOW 0x20 -#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */ - -/* compression types */ -#define RDP_MPPC_COMPRESSED 0x20 -#define RDP_MPPC_RESET 0x40 -#define RDP_MPPC_FLUSH 0x80 -#define RDP_MPPC_DICT_SIZE 8192 - /* Keymap flags */ #define MapRightShiftMask (1 << 0) #define MapLeftShiftMask (1 << 1) @@ -394,152 +763,8 @@ #define CF_GDIOBJFIRST 768 #define CF_GDIOBJLAST 1023 -/* Sound format constants - see also RFC 2361 */ -#define WAVE_FORMAT_PCM 0x0001 -#define WAVE_FORMAT_ADPCM 0x0002 -#define WAVE_FORMAT_ALAW 0x0006 -#define WAVE_FORMAT_MULAW 0x0007 -#define WAVE_FORMAT_MPEGLAYER3 0x0055 -#define WAVE_FORMAT_OPUS 0x0069 -#define WAVE_FORMAT_AAC 0xA106 - -/* Virtual channel options */ -#define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 -#define XR_CHANNEL_OPTION_COMPRESS 0x00400000 -#define XR_CHANNEL_OPTION_COMPRESS_RDP 0x00800000 -#define XR_CHANNEL_OPTION_PRI_LOW 0x02000000 -#define XR_CHANNEL_OPTION_PRI_MED 0x04000000 -#define XR_CHANNEL_OPTION_PRI_HIGH 0x08000000 -#define XR_CHANNEL_OPTION_ENCRYPT_CS 0x10000000 -#define XR_CHANNEL_OPTION_ENCRYPT_SC 0x20000000 -#define XR_CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 -#define XR_CHANNEL_OPTION_INITIALIZED 0x80000000 - -/* NT status codes for RDPDR */ -#define STATUS_SUCCESS 0x00000000 -#define STATUS_PENDING 0x00000103 - -#define STATUS_NO_MORE_FILES 0x80000006 -#define STATUS_DEVICE_PAPER_EMPTY 0x8000000e -#define STATUS_DEVICE_POWERED_OFF 0x8000000f -#define STATUS_DEVICE_OFF_LINE 0x80000010 -#define STATUS_DEVICE_BUSY 0x80000011 - -#define STATUS_INVALID_HANDLE 0xc0000008 -#define STATUS_INVALID_PARAMETER 0xc000000d -#define STATUS_NO_SUCH_FILE 0xc000000f -#define STATUS_INVALID_DEVICE_REQUEST 0xc0000010 -#define STATUS_ACCESS_DENIED 0xc0000022 -#define STATUS_OBJECT_NAME_COLLISION 0xc0000035 -#define STATUS_DISK_FULL 0xc000007f -#define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba -#define STATUS_NOT_SUPPORTED 0xc00000bb -#define STATUS_TIMEOUT 0xc0000102 -#define STATUS_CANCELLED 0xc0000120 - /* RDPDR constants */ #define RDPDR_MAX_DEVICES 0x10 -#define DEVICE_TYPE_SERIAL 0x01 -#define DEVICE_TYPE_PARALLEL 0x02 -#define DEVICE_TYPE_PRINTER 0x04 -#define DEVICE_TYPE_DISK 0x08 -#define DEVICE_TYPE_SCARD 0x20 - -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 - -/* RDP5 disconnect PDU */ -#define exDiscReasonNoInfo 0x0000 -#define exDiscReasonAPIInitiatedDisconnect 0x0001 -#define exDiscReasonAPIInitiatedLogoff 0x0002 -#define exDiscReasonServerIdleTimeout 0x0003 -#define exDiscReasonServerLogonTimeout 0x0004 -#define exDiscReasonReplacedByOtherConnection 0x0005 -#define exDiscReasonOutOfMemory 0x0006 -#define exDiscReasonServerDeniedConnection 0x0007 -#define exDiscReasonServerDeniedConnectionFips 0x0008 -#define exDiscReasonLicenseInternal 0x0100 -#define exDiscReasonLicenseNoLicenseServer 0x0101 -#define exDiscReasonLicenseNoLicense 0x0102 -#define exDiscReasonLicenseErrClientMsg 0x0103 -#define exDiscReasonLicenseHwidDoesntMatchLicense 0x0104 -#define exDiscReasonLicenseErrClientLicense 0x0105 -#define exDiscReasonLicenseCantFinishProtocol 0x0106 -#define exDiscReasonLicenseClientEndedProtocol 0x0107 -#define exDiscReasonLicenseErrClientEncryption 0x0108 -#define exDiscReasonLicenseCantUpgradeLicense 0x0109 -#define exDiscReasonLicenseNoRemoteConnections 0x010a - -#define RDP_ORDER_STANDARD 0x01 -#define RDP_ORDER_SECONDARY 0x02 -#define RDP_ORDER_BOUNDS 0x04 -#define RDP_ORDER_CHANGE 0x08 -#define RDP_ORDER_DELTA 0x10 -#define RDP_ORDER_LASTBOUNDS 0x20 -#define RDP_ORDER_SMALL 0x40 -#define RDP_ORDER_TINY 0x80 - -#define RDP_ORDER_DESTBLT 0 -#define RDP_ORDER_PATBLT 1 -#define RDP_ORDER_SCREENBLT 2 -#define RDP_ORDER_LINE 9 -#define RDP_ORDER_RECT 10 -#define RDP_ORDER_DESKSAVE 11 -#define RDP_ORDER_MEMBLT 13 -#define RDP_ORDER_TRIBLT 14 -#define RDP_ORDER_POLYLINE 22 -#define RDP_ORDER_TEXT2 27 -#define RDP_ORDER_COMPOSITE 37 /* 0x25 */ - -#define RDP_ORDER_RAW_BMPCACHE 0 -#define RDP_ORDER_COLCACHE 1 -#define RDP_ORDER_BMPCACHE 2 -#define RDP_ORDER_FONTCACHE 3 -#define RDP_ORDER_RAW_BMPCACHE2 4 -#define RDP_ORDER_BMPCACHE2 5 -#define RDP_ORDER_BRUSHCACHE 7 -#define RDP_ORDER_BMPCACHE3 8 - -/* orderSupportExFlags (2 bytes): A 16-bit, unsigned integer. - Extended order support flags. */ -#define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT 0x0002 -#define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004 -#define XR_ORDERFLAGS_EX_OFFSCREEN_COMPOSITE_SUPPORT 0x0100 - -/* orders negotiation indexes */ -#define TS_NEG_DSTBLT_INDEX 0x00 -#define TS_NEG_PATBLT_INDEX 0x01 -#define TS_NEG_SCRBLT_INDEX 0x02 -#define TS_NEG_MEMBLT_INDEX 0x03 -#define TS_NEG_MEM3BLT_INDEX 0x04 - /* 0x05 */ - /* 0x06 */ -#define TS_NEG_DRAWNINEGRID_INDEX 0x07 -#define TS_NEG_LINETO_INDEX 0x08 -#define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x09 - /* 0x0A */ -#define TS_NEG_SAVEBITMAP_INDEX 0x0B - /* 0x0C */ - /* 0x0D */ - /* 0x0E */ -#define TS_NEG_MULTIDSTBLT_INDEX 0x0F -#define TS_NEG_MULTIPATBLT_INDEX 0x10 -#define TS_NEG_MULTISCRBLT_INDEX 0x11 -#define TS_NEG_MULTIOPAQUERECT_INDEX 0x12 -#define TS_NEG_FAST_INDEX_INDEX 0x13 -#define TS_NEG_POLYGON_SC_INDEX 0x14 -#define TS_NEG_POLYGON_CB_INDEX 0x15 -#define TS_NEG_POLYLINE_INDEX 0x16 - /* 0x17 */ -#define TS_NEG_FAST_GLYPH_INDEX 0x18 -#define TS_NEG_ELLIPSE_SC_INDEX 0x19 -#define TS_NEG_ELLIPSE_CB_INDEX 0x1A -#define TS_NEG_INDEX_INDEX 0x1B - /* 0x1C */ - /* 0x1D */ - /* 0x1E */ - /* 0x1F */ /* drawable types */ #define WND_TYPE_BITMAP 0 @@ -581,113 +806,9 @@ #define CB_ITEMCHANGE 300 - -#define TS_CAPS_PROTOCOLVERSION 0x0200 -#define FASTPATH_OUTPUT_SUPPORTED 0x0001 -#define NO_BITMAP_COMPRESSION_HDR 0x0400 -#define LONG_CREDENTIALS_SUPPORTED 0x0004 -#define AUTORECONNECT_SUPPORTED 0x0008 -#define ENC_SALTED_CHECKSUM 0x0010 -#define NEGOTIATEORDERSUPPORT 0x0002 -#define ZEROBOUNDSDELTASUPPORT 0x0008 -#define COLORINDEXSUPPORT 0x0020 -#define SOLIDPATTERNBRUSHONLY 0x0040 -#define ORDERFLAGS_EXTRA_FLAGS 0x0080 - -#define INPUT_FLAG_SCANCODES 0x0001 -#define INPUT_FLAG_MOUSEX 0x0004 -#define INPUT_FLAG_FASTPATH_INPUT 0x0008 -#define INPUT_FLAG_UNICODE 0x0010 -#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 - -#define COMPDESK_NOT_SUPPORTED 0x0000 -#define COMPDESK_SUPPORTED 0x0001 - -#define SURFCMDS_SETSURFACEBITS 0x00000002 -#define SURFCMDS_FRAMEMARKER 0x00000010 -#define SURFCMDS_STREAMSUFRACEBITS 0x00000040 - -/* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */ -#define XR_CODEC_GUID_NSCODEC \ - "\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6" - -/* CODEC_GUID_REMOTEFX 76772F12-BD72-4463-AFB3B73C9C6F7886 */ -#define XR_CODEC_GUID_REMOTEFX \ - "\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86" - -/* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */ -#define XR_CODEC_GUID_IMAGE_REMOTEFX \ - "\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54" - -/* CODEC_GUID_JPEG 1BAF4CE6-9EED-430C-869ACB8B37B66237 */ -#define XR_CODEC_GUID_JPEG \ - "\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37" - -/* CODEC_GUID_PNG 0E0C858D-28E0-45DB-ADAA0F83E57CC560 */ -#define XR_CODEC_GUID_PNG \ - "\x8D\x85\x0C\x0E\xE0\x28\xDB\x45\xAD\xAA\x0F\x83\xE5\x7C\xC5\x60" - -/* MFVideoFormat_H264 0x34363248-0000-0010-800000AA00389B71 */ -#define XR_CODEC_GUID_H264 \ - "\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71" - -/* fastpath input */ -#define FASTPATH_INPUT_SECURE_CHECKSUM 0x1 -#define FASTPATH_INPUT_ENCRYPTED 0x2 - -#define FASTPATH_INPUT_ACTION_FASTPATH 0x0 -#define FASTPATH_INPUT_ACTION_X224 0x3 - -#define FASTPATH_INPUT_EVENT_SCANCODE 0x0 -#define FASTPATH_INPUT_EVENT_MOUSE 0x1 -#define FASTPATH_INPUT_EVENT_MOUSEX 0x2 -#define FASTPATH_INPUT_EVENT_SYNC 0x3 -#define FASTPATH_INPUT_EVENT_UNICODE 0x4 - -#define FASTPATH_INPUT_KBDFLAGS_RELEASE 0x01 -#define FASTPATH_INPUT_KBDFLAGS_EXTENDED 0x02 - - -/* fastpath output */ -#define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 -#define FASTPATH_OUTPUT_ACTION_X224 0x3 - -#define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1 -#define FASTPATH_OUTPUT_ENCRYPTED 0x2 - -#define FASTPATH_UPDATETYPE_ORDERS 0x0 -#define FASTPATH_UPDATETYPE_BITMAP 0x1 -#define FASTPATH_UPDATETYPE_PALETTE 0x2 -#define FASTPATH_UPDATETYPE_SYNCHRONIZE 0x3 -#define FASTPATH_UPDATETYPE_SURFCMDS 0x4 -#define FASTPATH_UPDATETYPE_PTR_NULL 0x5 -#define FASTPATH_UPDATETYPE_PTR_DEFAULT 0x6 -#define FASTPATH_UPDATETYPE_PTR_POSITION 0x8 -#define FASTPATH_UPDATETYPE_COLOR 0x9 -#define FASTPATH_UPDATETYPE_CACHED 0xA -#define FASTPATH_UPDATETYPE_POINTER 0xB - -#define FASTPATH_FRAGMENT_SINGLE 0x0 -#define FASTPATH_FRAGMENT_LAST 0x1 -#define FASTPATH_FRAGMENT_FIRST 0x2 -#define FASTPATH_FRAGMENT_NEXT 0x3 - #define FASTPATH_MAX_PACKET_SIZE 0x3fff -#define CMDTYPE_SET_SURFACE_BITS 0x0001 -#define CMDTYPE_FRAME_MARKER 0x0004 -#define CMDTYPE_STREAM_SURFACE_BITS 0x0006 - -#define XRDP_MAX_BITMAP_CACHE_ID 3 -#define XRDP_MAX_BITMAP_CACHE_IDX 2000 -#define XRDP_BITMAP_CACHE_ENTRIES 2048 - -#define XR_MIN_KEY_CODE 8 -#define XR_MAX_KEY_CODE 256 - #define XR_RDP_SCAN_LSHIFT 42 #define XR_RDP_SCAN_ALT 56 -#define INFO_CLIENT_NAME_BYTES 32 - #endif diff --git a/configure.ac b/configure.ac index aa9f51c4..cfa2c611 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.65) -AC_INIT([xrdp], [0.9.4], [xrdp-devel@googlegroups.com]) +AC_INIT([xrdp], [0.9.5], [xrdp-devel@googlegroups.com]) AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in) AM_INIT_AUTOMAKE([1.7.2 foreign]) AC_CONFIG_MACRO_DIR([m4]) @@ -70,6 +70,9 @@ AC_ARG_ENABLE(pam, AS_HELP_STRING([--disable-pam], [Build PAM support (default: yes)]), [], [enable_pam=yes]) AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_pam != xyes]) +AC_ARG_ENABLE(vsock, AS_HELP_STRING([--enable-vsock], + [Build AF_VSOCK support (default: no)]), + [], [enable_vsock=no]) AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--enable-ipv6], [Build IPv6 support (default: no, experimental)]), [], [enable_ipv6=no]) @@ -197,6 +200,15 @@ fi AC_SUBST(PAM_RULES) +if test "x$enable_vsock" = "xyes" +then + enable_vsock=yes + AC_CHECK_HEADERS([linux/socket.h linux/vm_sockets.h], + [AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_VSOCK])], + [], + [#include ]) +fi + if test "x$enable_ipv6only" = "xyes" then enable_ipv6=yes diff --git a/genkeymap/dump-keymaps.sh b/genkeymap/dump-keymaps.sh index e22610a0..7b61f240 100755 --- a/genkeymap/dump-keymaps.sh +++ b/genkeymap/dump-keymaps.sh @@ -11,6 +11,10 @@ fi setxkbmap -model pc104 -layout us ./xrdp-genkeymap ../instfiles/km-00000409.ini +# English - US 'dvorak' 0x00010409 +setxkbmap -model pc104 -layout dvorak +./xrdp-genkeymap ../instfiles/km-00010409.ini + # English - UK 'en-GB' 0x00000809 setxkbmap -model pc105 -layout gb ./xrdp-genkeymap ../instfiles/km-00000809.ini diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am index 3e7fcbce..1c1af39f 100644 --- a/instfiles/Makefile.am +++ b/instfiles/Makefile.am @@ -48,7 +48,8 @@ dist_startscript_DATA = \ km-0000080c.ini \ km-00000813.ini \ km-00000816.ini \ - km-0000100c.ini + km-0000100c.ini \ + km-00010409.ini # # platform specific files diff --git a/instfiles/km-00010409.ini b/instfiles/km-00010409.ini new file mode 100644 index 00000000..a911eb06 --- /dev/null +++ b/instfiles/km-00010409.ini @@ -0,0 +1,1055 @@ +[noshift] +Key8=65406:0 +Key9=65307:27 +Key10=49:49 +Key11=50:50 +Key12=51:51 +Key13=52:52 +Key14=53:53 +Key15=54:54 +Key16=55:55 +Key17=56:56 +Key18=57:57 +Key19=48:48 +Key20=91:91 +Key21=93:93 +Key22=65288:8 +Key23=65289:9 +Key24=39:39 +Key25=44:44 +Key26=46:46 +Key27=112:112 +Key28=121:121 +Key29=102:102 +Key30=103:103 +Key31=99:99 +Key32=114:114 +Key33=108:108 +Key34=47:47 +Key35=61:61 +Key36=65293:13 +Key37=65507:0 +Key38=97:97 +Key39=111:111 +Key40=101:101 +Key41=117:117 +Key42=105:105 +Key43=100:100 +Key44=104:104 +Key45=116:116 +Key46=110:110 +Key47=115:115 +Key48=45:45 +Key49=96:96 +Key50=65505:0 +Key51=92:92 +Key52=59:59 +Key53=113:113 +Key54=106:106 +Key55=107:107 +Key56=120:120 +Key57=98:98 +Key58=109:109 +Key59=119:119 +Key60=118:118 +Key61=122:122 +Key62=65506:0 +Key63=65450:42 +Key64=65513:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65429:0 +Key80=65431:0 +Key81=65434:0 +Key82=65453:45 +Key83=65430:0 +Key84=65437:0 +Key85=65432:0 +Key86=65451:43 +Key87=65436:0 +Key88=65433:0 +Key89=65435:0 +Key90=65438:0 +Key91=65439:0 +Key92=0:0 +Key93=0:0 +Key94=60:60 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65514:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=0:0 +Key126=65469:61 +Key127=0:0 +Key128=0:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[shift] +Key8=65406:0 +Key9=65307:27 +Key10=33:33 +Key11=64:64 +Key12=35:35 +Key13=36:36 +Key14=37:37 +Key15=94:94 +Key16=38:38 +Key17=42:42 +Key18=40:40 +Key19=41:41 +Key20=123:123 +Key21=125:125 +Key22=65288:8 +Key23=65056:0 +Key24=34:34 +Key25=60:60 +Key26=62:62 +Key27=80:80 +Key28=89:89 +Key29=70:70 +Key30=71:71 +Key31=67:67 +Key32=82:82 +Key33=76:76 +Key34=63:63 +Key35=43:43 +Key36=65293:13 +Key37=65507:0 +Key38=65:65 +Key39=79:79 +Key40=69:69 +Key41=85:85 +Key42=73:73 +Key43=68:68 +Key44=72:72 +Key45=84:84 +Key46=78:78 +Key47=83:83 +Key48=95:95 +Key49=126:126 +Key50=65505:0 +Key51=124:124 +Key52=58:58 +Key53=81:81 +Key54=74:74 +Key55=75:75 +Key56=88:88 +Key57=66:66 +Key58=77:77 +Key59=87:87 +Key60=86:86 +Key61=90:90 +Key62=65506:0 +Key63=65450:42 +Key64=65511:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65463:55 +Key80=65464:56 +Key81=65465:57 +Key82=65453:45 +Key83=65460:52 +Key84=65461:53 +Key85=65462:54 +Key86=65451:43 +Key87=65457:49 +Key88=65458:50 +Key89=65459:51 +Key90=65456:48 +Key91=65454:46 +Key92=0:0 +Key93=0:0 +Key94=62:62 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65512:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=65513:0 +Key126=65469:61 +Key127=65515:0 +Key128=65517:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[altgr] +Key8=65406:0 +Key9=65307:27 +Key10=49:49 +Key11=50:50 +Key12=51:51 +Key13=52:52 +Key14=53:53 +Key15=65106:94 +Key16=55:55 +Key17=56:56 +Key18=65104:96 +Key19=48:48 +Key20=91:91 +Key21=65107:126 +Key22=65288:8 +Key23=65289:9 +Key24=65105:180 +Key25=65115:184 +Key26=65110:729 +Key27=112:112 +Key28=121:121 +Key29=102:102 +Key30=103:103 +Key31=99:99 +Key32=114:114 +Key33=108:108 +Key34=47:47 +Key35=61:61 +Key36=65293:13 +Key37=65507:0 +Key38=97:97 +Key39=111:111 +Key40=101:101 +Key41=117:117 +Key42=105:105 +Key43=100:100 +Key44=104:104 +Key45=116:116 +Key46=110:110 +Key47=115:115 +Key48=45:45 +Key49=65104:96 +Key50=65505:0 +Key51=92:92 +Key52=65116:731 +Key53=113:113 +Key54=106:106 +Key55=107:107 +Key56=120:120 +Key57=98:98 +Key58=109:109 +Key59=119:119 +Key60=118:118 +Key61=122:122 +Key62=65506:0 +Key63=65450:42 +Key64=65513:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65429:0 +Key80=65431:0 +Key81=65434:0 +Key82=65453:45 +Key83=65430:0 +Key84=65437:0 +Key85=65432:0 +Key86=65451:43 +Key87=65436:0 +Key88=65433:0 +Key89=65435:0 +Key90=65438:0 +Key91=65439:0 +Key92=0:0 +Key93=0:0 +Key94=124:124 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65514:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=0:0 +Key126=65469:61 +Key127=0:0 +Key128=0:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[shiftaltgr] +Key8=65406:0 +Key9=65307:27 +Key10=33:33 +Key11=64:64 +Key12=35:35 +Key13=36:36 +Key14=37:37 +Key15=65106:94 +Key16=38:38 +Key17=42:42 +Key18=0:0 +Key19=41:41 +Key20=123:123 +Key21=0:0 +Key22=65288:8 +Key23=65056:0 +Key24=65111:168 +Key25=65114:711 +Key26=183:183 +Key27=80:80 +Key28=89:89 +Key29=70:70 +Key30=71:71 +Key31=67:67 +Key32=82:82 +Key33=76:76 +Key34=63:63 +Key35=43:43 +Key36=65293:13 +Key37=65507:0 +Key38=65:65 +Key39=79:79 +Key40=69:69 +Key41=85:85 +Key42=73:73 +Key43=68:68 +Key44=72:72 +Key45=84:84 +Key46=78:78 +Key47=83:83 +Key48=95:95 +Key49=65107:126 +Key50=65505:0 +Key51=124:124 +Key52=65113:733 +Key53=81:81 +Key54=74:74 +Key55=75:75 +Key56=88:88 +Key57=66:66 +Key58=77:77 +Key59=87:87 +Key60=86:86 +Key61=90:90 +Key62=65506:0 +Key63=65450:42 +Key64=65511:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65463:55 +Key80=65464:56 +Key81=65465:57 +Key82=65453:45 +Key83=65460:52 +Key84=65461:53 +Key85=65462:54 +Key86=65451:43 +Key87=65457:49 +Key88=65458:50 +Key89=65459:51 +Key90=65456:48 +Key91=65454:46 +Key92=0:0 +Key93=0:0 +Key94=166:166 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65512:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=65513:0 +Key126=65469:61 +Key127=65515:0 +Key128=65517:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[capslock] +Key8=65406:0 +Key9=65307:27 +Key10=49:49 +Key11=50:50 +Key12=51:51 +Key13=52:52 +Key14=53:53 +Key15=54:54 +Key16=55:55 +Key17=56:56 +Key18=57:57 +Key19=48:48 +Key20=91:91 +Key21=93:93 +Key22=65288:8 +Key23=65289:9 +Key24=39:39 +Key25=44:44 +Key26=46:46 +Key27=80:80 +Key28=89:89 +Key29=70:70 +Key30=71:71 +Key31=67:67 +Key32=82:82 +Key33=76:76 +Key34=47:47 +Key35=61:61 +Key36=65293:13 +Key37=65507:0 +Key38=65:65 +Key39=79:79 +Key40=69:69 +Key41=85:85 +Key42=73:73 +Key43=68:68 +Key44=72:72 +Key45=84:84 +Key46=78:78 +Key47=83:83 +Key48=45:45 +Key49=96:96 +Key50=65505:0 +Key51=92:92 +Key52=59:59 +Key53=81:81 +Key54=74:74 +Key55=75:75 +Key56=88:88 +Key57=66:66 +Key58=77:77 +Key59=87:87 +Key60=86:86 +Key61=90:90 +Key62=65506:0 +Key63=65450:42 +Key64=65513:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65429:0 +Key80=65431:0 +Key81=65434:0 +Key82=65453:45 +Key83=65430:0 +Key84=65437:0 +Key85=65432:0 +Key86=65451:43 +Key87=65436:0 +Key88=65433:0 +Key89=65435:0 +Key90=65438:0 +Key91=65439:0 +Key92=0:0 +Key93=0:0 +Key94=60:60 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65514:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=0:0 +Key126=65469:61 +Key127=0:0 +Key128=0:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[capslockaltgr] +Key8=65406:0 +Key9=65307:27 +Key10=49:49 +Key11=50:50 +Key12=51:51 +Key13=52:52 +Key14=53:53 +Key15=65106:94 +Key16=55:55 +Key17=56:56 +Key18=65104:96 +Key19=48:48 +Key20=91:91 +Key21=65107:126 +Key22=65288:8 +Key23=65289:9 +Key24=65105:180 +Key25=65115:184 +Key26=65110:729 +Key27=80:80 +Key28=89:89 +Key29=70:70 +Key30=71:71 +Key31=67:67 +Key32=82:82 +Key33=76:76 +Key34=47:47 +Key35=61:61 +Key36=65293:13 +Key37=65507:0 +Key38=65:65 +Key39=79:79 +Key40=69:69 +Key41=85:85 +Key42=73:73 +Key43=68:68 +Key44=72:72 +Key45=84:84 +Key46=78:78 +Key47=83:83 +Key48=45:45 +Key49=65104:96 +Key50=65505:0 +Key51=92:92 +Key52=65116:731 +Key53=81:81 +Key54=74:74 +Key55=75:75 +Key56=88:88 +Key57=66:66 +Key58=77:77 +Key59=87:87 +Key60=86:86 +Key61=90:90 +Key62=65506:0 +Key63=65450:42 +Key64=65513:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65429:0 +Key80=65431:0 +Key81=65434:0 +Key82=65453:45 +Key83=65430:0 +Key84=65437:0 +Key85=65432:0 +Key86=65451:43 +Key87=65436:0 +Key88=65433:0 +Key89=65435:0 +Key90=65438:0 +Key91=65439:0 +Key92=0:0 +Key93=0:0 +Key94=124:124 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65514:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=0:0 +Key126=65469:61 +Key127=0:0 +Key128=0:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[shiftcapslock] +Key8=65406:0 +Key9=65307:27 +Key10=33:33 +Key11=64:64 +Key12=35:35 +Key13=36:36 +Key14=37:37 +Key15=94:94 +Key16=38:38 +Key17=42:42 +Key18=40:40 +Key19=41:41 +Key20=123:123 +Key21=125:125 +Key22=65288:8 +Key23=65056:0 +Key24=34:34 +Key25=60:60 +Key26=62:62 +Key27=112:112 +Key28=121:121 +Key29=102:102 +Key30=103:103 +Key31=99:99 +Key32=114:114 +Key33=108:108 +Key34=63:63 +Key35=43:43 +Key36=65293:13 +Key37=65507:0 +Key38=97:97 +Key39=111:111 +Key40=101:101 +Key41=117:117 +Key42=105:105 +Key43=100:100 +Key44=104:104 +Key45=116:116 +Key46=110:110 +Key47=115:115 +Key48=95:95 +Key49=126:126 +Key50=65505:0 +Key51=124:124 +Key52=58:58 +Key53=113:113 +Key54=106:106 +Key55=107:107 +Key56=120:120 +Key57=98:98 +Key58=109:109 +Key59=119:119 +Key60=118:118 +Key61=122:122 +Key62=65506:0 +Key63=65450:42 +Key64=65511:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65463:55 +Key80=65464:56 +Key81=65465:57 +Key82=65453:45 +Key83=65460:52 +Key84=65461:53 +Key85=65462:54 +Key86=65451:43 +Key87=65457:49 +Key88=65458:50 +Key89=65459:51 +Key90=65456:48 +Key91=65454:46 +Key92=0:0 +Key93=0:0 +Key94=62:62 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65512:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=65513:0 +Key126=65469:61 +Key127=65515:0 +Key128=65517:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 + +[shiftcapslockaltgr] +Key8=65406:0 +Key9=65307:27 +Key10=33:33 +Key11=64:64 +Key12=35:35 +Key13=36:36 +Key14=37:37 +Key15=65106:94 +Key16=38:38 +Key17=42:42 +Key18=0:0 +Key19=41:41 +Key20=123:123 +Key21=0:0 +Key22=65288:8 +Key23=65056:0 +Key24=65111:168 +Key25=65114:711 +Key26=183:183 +Key27=112:112 +Key28=121:121 +Key29=102:102 +Key30=103:103 +Key31=99:99 +Key32=114:114 +Key33=108:108 +Key34=63:63 +Key35=43:43 +Key36=65293:13 +Key37=65507:0 +Key38=97:97 +Key39=111:111 +Key40=101:101 +Key41=117:117 +Key42=105:105 +Key43=100:100 +Key44=104:104 +Key45=116:116 +Key46=110:110 +Key47=115:115 +Key48=95:95 +Key49=65107:126 +Key50=65505:0 +Key51=124:124 +Key52=65113:733 +Key53=113:113 +Key54=106:106 +Key55=107:107 +Key56=120:120 +Key57=98:98 +Key58=109:109 +Key59=119:119 +Key60=118:118 +Key61=122:122 +Key62=65506:0 +Key63=65450:42 +Key64=65511:0 +Key65=32:32 +Key66=65509:0 +Key67=65470:0 +Key68=65471:0 +Key69=65472:0 +Key70=65473:0 +Key71=65474:0 +Key72=65475:0 +Key73=65476:0 +Key74=65477:0 +Key75=65478:0 +Key76=65479:0 +Key77=65407:0 +Key78=65300:0 +Key79=65463:55 +Key80=65464:56 +Key81=65465:57 +Key82=65453:45 +Key83=65460:52 +Key84=65461:53 +Key85=65462:54 +Key86=65451:43 +Key87=65457:49 +Key88=65458:50 +Key89=65459:51 +Key90=65456:48 +Key91=65454:46 +Key92=0:0 +Key93=0:0 +Key94=166:166 +Key95=65480:0 +Key96=65481:0 +Key97=65360:0 +Key98=65362:0 +Key99=65365:0 +Key100=65361:0 +Key101=0:0 +Key102=65363:0 +Key103=65367:0 +Key104=65364:0 +Key105=65366:0 +Key106=65379:0 +Key107=65535:127 +Key108=65421:13 +Key109=65508:0 +Key110=65299:0 +Key111=65377:0 +Key112=65455:47 +Key113=65516:0 +Key114=0:0 +Key115=65515:0 +Key116=65512:0 +Key117=65383:0 +Key118=0:0 +Key119=0:0 +Key120=0:0 +Key121=0:0 +Key122=0:0 +Key123=0:0 +Key124=65027:0 +Key125=65513:0 +Key126=65469:61 +Key127=65515:0 +Key128=65517:0 +Key129=0:0 +Key130=0:0 +Key131=0:0 +Key132=0:0 +Key133=0:0 +Key134=65454:46 +Key135=0:0 +Key136=0:0 +Key137=0:0 diff --git a/librfxcodec b/librfxcodec index 631f7ee0..ef68593b 160000 --- a/librfxcodec +++ b/librfxcodec @@ -1 +1 @@ -Subproject commit 631f7ee053e9b38984d838e5aff02c4abc8c6d90 +Subproject commit ef68593b7d19c89cff2a2d27c6ab3cc5f33611da diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c index 91c25813..dddf6d23 100644 --- a/libxrdp/xrdp_caps.c +++ b/libxrdp/xrdp_caps.c @@ -610,90 +610,90 @@ xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s) len -= 4; switch (type) { - case RDP_CAPSET_GENERAL: /* 1 */ + case RDP_CAPSET_GENERAL: DEBUG(("RDP_CAPSET_GENERAL")); xrdp_caps_process_general(self, s, len); break; - case RDP_CAPSET_BITMAP: /* 2 */ + case RDP_CAPSET_BITMAP: DEBUG(("RDP_CAPSET_BITMAP")); break; - case RDP_CAPSET_ORDER: /* 3 */ + case RDP_CAPSET_ORDER: DEBUG(("RDP_CAPSET_ORDER")); xrdp_caps_process_order(self, s, len); break; - case RDP_CAPSET_BMPCACHE: /* 4 */ + case RDP_CAPSET_BMPCACHE: DEBUG(("RDP_CAPSET_BMPCACHE")); xrdp_caps_process_bmpcache(self, s, len); break; - case RDP_CAPSET_CONTROL: /* 5 */ + case RDP_CAPSET_CONTROL: DEBUG(("RDP_CAPSET_CONTROL")); break; case 6: xrdp_caps_process_cache_v3_codec_id(self, s, len); break; - case RDP_CAPSET_ACTIVATE: /* 7 */ + case RDP_CAPSET_ACTIVATE: DEBUG(("RDP_CAPSET_ACTIVATE")); break; - case RDP_CAPSET_POINTER: /* 8 */ + case RDP_CAPSET_POINTER: DEBUG(("RDP_CAPSET_POINTER")); xrdp_caps_process_pointer(self, s, len); break; - case RDP_CAPSET_SHARE: /* 9 */ + case RDP_CAPSET_SHARE: DEBUG(("RDP_CAPSET_SHARE")); break; - case RDP_CAPSET_COLCACHE: /* 10 */ + case RDP_CAPSET_COLCACHE: DEBUG(("RDP_CAPSET_COLCACHE")); break; - case 12: /* 12 */ - DEBUG(("--12")); + case RDP_CAPSET_SOUND: + DEBUG(("--0x0C")); break; - case 13: /* 13 */ + case RDP_CAPSET_INPUT: xrdp_caps_process_input(self, s, len); break; - case 14: /* 14 */ - DEBUG(("--14")); + case RDP_CAPSET_FONT: + DEBUG(("--0x0D")); break; - case RDP_CAPSET_BRUSHCACHE: /* 15 */ + case RDP_CAPSET_BRUSHCACHE: xrdp_caps_process_brushcache(self, s, len); break; - case 16: /* 16 */ - DEBUG(("--16")); + case RDP_CAPSET_GLYPHCACHE: + DEBUG(("--0x11")); break; - case 17: /* 17 */ + case RDP_CAPSET_OFFSCREENCACHE: DEBUG(("CAPSET_TYPE_OFFSCREEN_CACHE")); xrdp_caps_process_offscreen_bmpcache(self, s, len); break; - case RDP_CAPSET_BMPCACHE2: /* 19 */ + case RDP_CAPSET_BMPCACHE2: DEBUG(("RDP_CAPSET_BMPCACHE2")); xrdp_caps_process_bmpcache2(self, s, len); break; - case 20: /* 20 */ - DEBUG(("--20")); + case RDP_CAPSET_VIRCHAN: + DEBUG(("--0x14")); break; - case 21: /* 21 */ - DEBUG(("--21")); + case RDP_CAPSET_DRAWNINEGRIDCACHE: + DEBUG(("--0x15")); break; - case 22: /* 22 */ - DEBUG(("--22")); + case RDP_CAPSET_DRAWGDIPLUS: + DEBUG(("--0x16")); break; - case 0x0017: /* 23 CAPSETTYPE_RAIL */ + case RDP_CAPSET_RAIL: xrdp_caps_process_rail(self, s, len); break; - case 0x0018: /* 24 CAPSETTYPE_WINDOW */ + case RDP_CAPSET_WINDOW: xrdp_caps_process_window(self, s, len); break; - case 0x001A: /* 26 CAPSETTYPE_MULTIFRAGMENTUPDATE */ + case RDP_CAPSET_MULTIFRAGMENT: xrdp_caps_process_multifragmentupdate(self, s, len); break; - case RDP_CAPSET_BMPCODECS: /* 0x1d(29) */ + case RDP_CAPSET_SURFCMDS: + xrdp_caps_process_surface_cmds(self, s, len); + break; + case RDP_CAPSET_BMPCODECS: xrdp_caps_process_codecs(self, s, len); break; - case 0x001E: /* CAPSSETTYPE_FRAME_ACKNOWLEDGE */ + case RDP_CAPSET_FRAME_ACKNOWLEDGE: xrdp_caps_process_frame_ack(self, s, len); break; - case RDP_CAPSET_SURFCMDS: /* CAPSETTYPE_SURFACE_COMMANDS */ - xrdp_caps_process_surface_cmds(self, s, len); - break; default: g_writeln("unknown in xrdp_caps_process_confirm_active %d", type); break; @@ -924,7 +924,11 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self) out_uint16_le(s, RDP_CAPSET_INPUT); /* 13(0xd) */ out_uint16_le(s, RDP_CAPLEN_INPUT); /* 88(0x58) */ - flags = INPUT_FLAG_SCANCODES | INPUT_FLAG_MOUSEX | INPUT_FLAG_UNICODE; + flags = INPUT_FLAG_SCANCODES | + INPUT_FLAG_MOUSEX | + INPUT_FLAG_UNICODE | + TS_INPUT_FLAG_MOUSE_HWHEEL; + if (self->client_info.use_fast_path & 2) { flags |= INPUT_FLAG_FASTPATH_INPUT | INPUT_FLAG_FASTPATH_INPUT2; diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index fe7a460a..4de6c9ed 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -1608,10 +1608,10 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec* self, struct stream* s) g_writeln("colorDepth 0x%4.4x (0xca00 4bpp 0xca01 8bpp)", colorDepth); switch (colorDepth) { - case 0xca00: /* RNS_UD_COLOR_4BPP */ + case RNS_UD_COLOR_4BPP: self->rdp_layer->client_info.bpp = 4; break; - case 0xca01: /* RNS_UD_COLOR_8BPP */ + case RNS_UD_COLOR_8BPP: self->rdp_layer->client_info.bpp = 8; break; } @@ -1630,19 +1630,19 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec* self, struct stream* s) switch (postBeta2ColorDepth) { - case 0xca00: /* RNS_UD_COLOR_4BPP */ + case RNS_UD_COLOR_4BPP: self->rdp_layer->client_info.bpp = 4; break; - case 0xca01: /* RNS_UD_COLOR_8BPP */ + case RNS_UD_COLOR_8BPP : self->rdp_layer->client_info.bpp = 8; break; - case 0xca02: /* RNS_UD_COLOR_16BPP_555 */ + case RNS_UD_COLOR_16BPP_555: self->rdp_layer->client_info.bpp = 15; break; - case 0xca03: /* RNS_UD_COLOR_16BPP_565 */ + case RNS_UD_COLOR_16BPP_565: self->rdp_layer->client_info.bpp = 16; break; - case 0xca04: /* RNS_UD_COLOR_24BPP */ + case RNS_UD_COLOR_24BPP: self->rdp_layer->client_info.bpp = 24; break; } diff --git a/neutrinordp/xrdp-neutrinordp.c b/neutrinordp/xrdp-neutrinordp.c index a2ef4fc2..d7f90e18 100644 --- a/neutrinordp/xrdp-neutrinordp.c +++ b/neutrinordp/xrdp-neutrinordp.c @@ -1468,7 +1468,9 @@ lfreerdp_pre_connect(freerdp *instance) instance->settings->glyph_cache = true; /* GLYPH_SUPPORT_FULL and GLYPH_SUPPORT_PARTIAL seem to be the same */ - instance->settings->glyphSupportLevel = GLYPH_SUPPORT_FULL; + /* disabled as workaround for corrupted display like black bars left of cmd with W2K8 */ + /* instance->settings->glyphSupportLevel = GLYPH_SUPPORT_FULL; */ + instance->settings->glyphSupportLevel = GLYPH_SUPPORT_NONE; instance->settings->order_support[NEG_DSTBLT_INDEX] = 1; /* 0x00 */ instance->settings->order_support[NEG_PATBLT_INDEX] = 1; @@ -1497,7 +1499,10 @@ lfreerdp_pre_connect(freerdp *instance) instance->settings->order_support[NEG_FAST_GLYPH_INDEX] = 0; /* 0x18 */ instance->settings->order_support[NEG_ELLIPSE_SC_INDEX] = 0; instance->settings->order_support[NEG_ELLIPSE_CB_INDEX] = 0; - instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = 1; + /* disabled as workaround for corrupted display like black bars left of cmd with W2K8 */ + /* instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = 1; */ + instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = 0; + instance->settings->order_support[NEG_GLYPH_WEXTTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_GLYPH_WLONGTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX] = 0; diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 9ae91f1b..34aa3f51 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -1451,7 +1451,8 @@ get_log_level(const char* level_str, enum logLevels default_level) "LOG_LEVEL_ERROR", "LOG_LEVEL_WARNING", "LOG_LEVEL_INFO", - "LOG_LEVEL_DEBUG" + "LOG_LEVEL_DEBUG", + "LOG_LEVEL_TRACE" }; unsigned int i; diff --git a/sesman/chansrv/pulse/README.md b/sesman/chansrv/pulse/README.md new file mode 100644 index 00000000..dbc89242 --- /dev/null +++ b/sesman/chansrv/pulse/README.md @@ -0,0 +1,117 @@ +The latest version of this document can be found at wiki. + +* https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection + + +# Overview +xrdp supports audio redirection using PulseAudio, which is a sound system for +POSIX operating systems. Server to client redirection is compliant to Remote +Desktop Procol standard [[MS-RDPEA]](https://msdn.microsoft.com/en-us/library/cc240933.aspx) +but client to server redirection implementation is proprietary. Accordingly, +server to client redirection is available with many of RDP clients including +Microsoft client but client to server redirection requires NeutrinoRDP client, +not available with other clients. + +Here is how to build pulseaudio modules for your distro, so you can have audio +support through xrdp. + +# Prerequisites +Prepare xrdp source in your home directory. Of course, you can choose another +directory. + + cd ~ + git clone https://github.com/neutrinolabs/xrdp.git + +In this instruction, pulseaudio version is **10.0**. Replace the version number +in this instruction if your environment has different versions. You can find +out your pulseaudio version executing the following command: + + pulseaudio --version + +# How to build + +## Debian 9 / Ubuntu + +This instruction also should be applicable to Ubuntu family. + +### Prerequisites + +Some build tools and package development tools are required. Make sure install +the tools. + + apt install build-essential dpkg-dev + +### Prepare & build + +Install pulseaudio and requisite packages to build pulseaudio. + + apt install pulseaudio + apt build-dep pulseaudio + +Fetch the pulseaudio source . You'll see `pulseaudio-10.0` directory in your +current directory. + + apt source pulseaudio + +Enter into the directory and build the pulseaudio package. + + cd pulseaudio-10.0 + ./configure + +Finally, let's make. You'll have two .so files `module-xrdp-sink.so` and +`module-xrdp-source.so`. + + cd ~/xrdp/sesman/chansrv/pulse + make PULSE_DIR="~/pulseaudio-10.0" + +## Other distro + +First off, find out your pulseaudio version using `pulseaudio --version` +command. Download the tarball of the pulseaudio version that you have. + +* https://freedesktop.org/software/pulseaudio/releases/ + +After downloading the tarball, extact the tarball and `cd` into the source +directory, then run `./configure`. + + wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-10.0.tar.xz + tar xf pulseaudio-10.0.tar.gz + cd pulseaudio-10.0 + ./configure + +If additional packages are required to run `./configure`, install requisite +packages depending on your environment. + +Finally, let's make. You'll have two .so files `module-xrdp-sink.so` and +`module-xrdp-source.so`. + + cd ~/xrdp/sesman/chansrv/pulse + make PULSE_DIR="~/pulseaudio-10.0" + +# Install + +Install process is not distro specific except for install destination. Install +built two .so files into the pulseaudio modules directory. Typically, +`/usr/lib/pulse-10.0/modules` for Debian, `/usr/lib64/pulse-10.0/modules` for +CentOS 7. Other distro might have different path. Find out the right path for +your distro. + +Look into the directory with `ls` command. You'll see lots of `module-*.so` +files. There's the place! + + cd ~/xrdp/sesman/chansrv/pulse + for f in *.so; do install -s -m 644 $f /usr/lib/pulse-10.0/modules; done + +This command is equivalent to following: + + install -s -m 644 module-xrdp-sink.so /usr/lib/pulse-10.0/modules + install -s -m 644 module-xrdp-source.so /usr/lib/pulse-10.0/modules + +Well done! Pulseaudio modules should be properly built and installed. + + +# See if it works + +To see if it works, run `pavumeter` in the xrdp session. Playback any YouTube +video in Firefox. You'll see "Showing signal levels of **xrdp sink**" and +volume meter moving. diff --git a/sesman/chansrv/pulse/pulse-notes.txt b/sesman/chansrv/pulse/pulse-notes.txt deleted file mode 100644 index 92a9878d..00000000 --- a/sesman/chansrv/pulse/pulse-notes.txt +++ /dev/null @@ -1,79 +0,0 @@ - -Pulse audio notes. - -to see what version of PA is on your machine -pulseaudio --version - -IMA ADPCM - -To build xrdp pulse sink, -get the pulse source that most closely matches your version on -your machine. Get the source from -http://freedesktop.org/software/pulseaudio/releases/ -run ./configure after extracting. I don't think you need to build it. -edit Makefile to point to your pulse source directory. - - - -PA always respawning - - To stop its respawning habit, open /etc/pulse/client.conf, change - autospawn = yes to autospawn = no, and set daemon-binary to /bin/true. - Make sure these lines are uncommented, like this: - -autospawn = no -daemon-binary = /bin/true - -xfreerdp -a 24 -z --plugin rdpsnd --data alsa:hw:0,0 -- 127.0.0.1 - - -to get ./configure on pulse source to run -apt-get install libsndfile1-dev -apt-get install libspeex-dev -apt-get install libspeexdsp-dev - -alsamixer -apt-get install alsa-utils - - -/etc/asound.conf ---------------------------------- -pcm.pulse { - type pulse -} - -ctl.pulse { - type pulse -} - -pcm.!default { - type pulse -} - -ctl.!default { - type pulse -} ---------------------------------- - - -/etc/pulse/default.pa ---------------------------------- -.nofail -.fail -load-module module-augment-properties -#load-module module-alsa-sink device=hw:0 -#load-module module-alsa-source device=hw:0 -#load-module module-pipe-sink -#load-module module-pipe-source -#load-module module-null-sink -load-module module-xrdp-sink -load-module module-native-protocol-unix -#load-module module-udev-detect tsched=0 ---------------------------------- - -To see a list of sinks -pacmd list-sinks - -To manually load a sink -pactl load-module module-xrdp-sink.so sink_name=test - diff --git a/sesman/chansrv/pulse/pulse-notes.ubuntu.txt b/sesman/chansrv/pulse/pulse-notes.ubuntu.txt deleted file mode 100644 index 18a3768f..00000000 --- a/sesman/chansrv/pulse/pulse-notes.ubuntu.txt +++ /dev/null @@ -1,77 +0,0 @@ - --------------------------------------- - Building pulseaudio modules for xrdp --------------------------------------- - -o append the following line to /etc/apt/sources.list - - deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse - - this is what my /etc/apt/sources.list looks like - - deb http://packages.linuxmint.com/ maya main upstream import - deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse - deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse - deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse - deb http://archive.canonical.com/ubuntu/ precise partner - deb http://packages.medibuntu.org/ precise free non-free - - #deb http://archive.getdeb.net/ubuntu precise-getdeb apps - #deb http://archive.getdeb.net/ubuntu precise-getdeb games - deb http://drbl.sourceforge.net/drbl-core drbl stable - deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse - - NOTE: If you get an error message that goes something like this: - - E: You must put some 'source' URIs in your sources.list - - try running the following command first: - - apt-get source pulseaudio - -o run these commands in your home directory - - cd - sudo apt-get install dpkg-dev - apt-get source pulseaudio - sudo apt-get build-dep pulseaudio - - cd pulseaudio-1.1 - dpkg-buildpackage -rfakeroot -uc -b - -o edit Makefile and point PULSE_DIR to ~/pulseaudio dir - -o run make; the outputs will be - module-xrdp-sink.so - module-xrdp-source.so - -o sudo cp module-xrdp-sink.so /usr/lib/pulse-/modules - sudo cp module-xrdp-source.so /usr/lib/pulse-/modules - note: on a 64bit machine use lib64 instead of lib - -o if you build xrdp with --enable-load_pulse_modules, then the above modules - will get loaded automatically when xrdp starts. However if --enable-load_pulse_modules - is not used, then you need to edit /etc/pulse/default.pa and insert the following - two lines into it: - - load-module module-xrdp-sink - load-module module-xrdp-source - --------------------------------------- - To test sound/microphone redirection --------------------------------------- - -o install gnome sound recorder or your favorite sound recorder - -o mplayer -ao pulse