diff options
| -rw-r--r-- | .gitmodules | 6 | ||||
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | Makefile.am | 29 | ||||
| -rw-r--r-- | common/xrdp_constants.h | 37 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | docs/man/sesman.ini.5 | 10 | ||||
| -rw-r--r-- | docs/man/xrdp.ini.5 | 15 | ||||
| -rw-r--r-- | genkeymap/Makefile.am | 4 | ||||
| -rw-r--r-- | instfiles/Makefile.am | 2 | ||||
| -rw-r--r-- | instfiles/km-00000412.ini | 1057 | ||||
| m--------- | libpainter | 0 | ||||
| m--------- | librfxcodec | 0 | ||||
| -rw-r--r-- | libxrdp/Makefile.am | 3 | ||||
| -rw-r--r-- | libxrdp/libxrdp.c | 6 | ||||
| -rw-r--r-- | libxrdp/xrdp_bitmap32_compress.c | 122 | ||||
| -rw-r--r-- | libxrdp/xrdp_bitmap_compress.c | 8 | ||||
| -rw-r--r-- | libxrdp/xrdp_caps.c | 67 | ||||
| -rw-r--r-- | libxrdp/xrdp_jpeg_compress.c | 11 | ||||
| -rw-r--r-- | libxrdp/xrdp_orders.c | 115 | ||||
| -rw-r--r-- | neutrinordp/Makefile.am | 1 | ||||
| -rw-r--r-- | sesman/Makefile.am | 3 | ||||
| -rw-r--r-- | sesman/chansrv/Makefile.am | 6 | ||||
| -rw-r--r-- | sesman/env.c | 18 | ||||
| -rw-r--r-- | xrdp/Makefile.am | 7 | ||||
| -rw-r--r-- | xrdp/xrdp.ini | 6 | ||||
| -rw-r--r-- | xrdp/xrdp_bitmap.c | 31 | ||||
| -rw-r--r-- | xrdp/xrdp_encoder.c | 5 | ||||
| -rw-r--r-- | xrdp/xrdp_keyboard.ini | 3 | ||||
| -rw-r--r-- | xrdp/xrdp_mm.c | 19 | ||||
| -rw-r--r-- | xrdpapi/Makefile.am | 5 | ||||
| -rw-r--r-- | xrdpvr/Makefile.am | 3 |
31 files changed, 1426 insertions, 177 deletions
diff --git a/.gitmodules b/.gitmodules index 32417c16..281ee599 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,8 @@ [submodule "librfxcodec"] path = librfxcodec - url = git://github.com/neutrinolabs/librfxcodec + url = https://github.com/neutrinolabs/librfxcodec.git +[submodule "libpainter"] + path = libpainter + url = https://github.com/neutrinolabs/libpainter.git + branch = devel diff --git a/.travis.yml b/.travis.yml index cffd98c6..baf038ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ addons: - libmp3lame-dev - libx11-dev - libxrandr-dev - - libpixman-dev + - libpixman-1-dev - nasm # x11rdp #- flex diff --git a/Makefile.am b/Makefile.am index c50ea295..52ea2e61 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,25 @@ ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = --without-systemdsystemunitdir -EXTRA_DIST = bootstrap COPYING coding_style.md design.txt faq-compile.txt \ - faq-general.txt file-loc.txt install.txt m4 readme.txt +EXTRA_DIST = \ + COPYING \ + astyle_config.as \ + bootstrap \ + coding_style.md \ + description-pak \ + design.txt \ + faq-compile.txt \ + faq-general.txt \ + file-loc.txt \ + fontdump \ + install.txt \ + m4 \ + postinstall-pak \ + readme.txt \ + tcutils \ + tests \ + vrplayer \ + xorg if XRDP_NEUTRINORDP NEUTRINORDPDIR = neutrinordp @@ -16,7 +33,14 @@ else XRDPVRDIR = endif +if XRDP_RFXCODEC +RFXCODECDIR = librfxcodec +else +RFXCODECDIR = +endif + SUBDIRS = \ + libpainter \ common \ vnc \ rdp \ @@ -24,6 +48,7 @@ SUBDIRS = \ mc \ $(NEUTRINORDPDIR) \ libxrdp \ + $(RFXCODECDIR) \ xrdp \ sesman \ keygen \ diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index 3ac8504f..41c4a5ee 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -284,6 +284,24 @@ #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 */ @@ -539,9 +557,9 @@ #define COMPDESK_NOT_SUPPORTED 0x0000 #define COMPDESK_SUPPORTED 0x0001 -#define SURCMDS_SETSURFACEBITS 0x00000002 -#define SURCMDS_FRAMEMARKER 0x00000010 -#define SURCMDS_STREAMSUFRACEBITS 0x00000040 +#define SURFCMDS_SETSURFACEBITS 0x00000002 +#define SURFCMDS_FRAMEMARKER 0x00000010 +#define SURFCMDS_STREAMSUFRACEBITS 0x00000040 /* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */ #define XR_CODEC_GUID_NSCODEC \ @@ -551,6 +569,10 @@ #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" @@ -563,15 +585,6 @@ #define XR_CODEC_GUID_H264 \ "\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71" -#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 0x27 -#define RDP_CAPLEN_LPOINTER 0x06 - /* fastpath input */ #define FASTPATH_INPUT_SECURE_CHECKSUM 0x1 #define FASTPATH_INPUT_ENCRYPTED 0x2 diff --git a/configure.ac b/configure.ac index d8387114..fea0e4cb 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,8 @@ AC_C_CONST AC_PROG_LIBTOOL PKG_PROG_PKG_CONFIG +AC_CONFIG_SUBDIRS([libpainter librfxcodec]) + # Use silent rules by default if supported by Automake m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/docs/man/sesman.ini.5 b/docs/man/sesman.ini.5 index af9b35ab..9003f82e 100644 --- a/docs/man/sesman.ini.5 +++ b/docs/man/sesman.ini.5 @@ -196,12 +196,10 @@ Following parameters can be used in the \fB[X11rdp]\fR, \fB[Xvnc]\fR and \fB[Xorg]\fR sections. .TP -\fBparam0\fR=\fIfilename\fR -Path to the X11 server executable - -.TP -\fBparam\fR\fIN\fR=\fIstring\fR -Nth command line argument +\fBparam\fR=\fIstring\fR +Multiple \fIparam\fR lines are supported. This first line specifies the +path to the X11 server executable. Following lines specify command line +arguments passed to the X11 server. .SH "CHANSRV" Following parameters can be used in the \fB[Chansrv]\fR section. diff --git a/docs/man/xrdp.ini.5 b/docs/man/xrdp.ini.5 index 6a4da78c..55299d0c 100644 --- a/docs/man/xrdp.ini.5 +++ b/docs/man/xrdp.ini.5 @@ -29,9 +29,13 @@ Specify xrdp listening address. If not specified, defaults to 0.0.0.0 (all inter .TP \fBautorun\fP=\fIsession_name\fP -Automatically run the connection specified by \fIsession_name\fP, which must match a section as described below. -By default a drop-down list with all available connections is shown. -A connection can also be chosen by the connecting client by setting the \fBLOGIN DOMAIN\fP to a valid \fIsession name\fP. +Section name for automatic login. If set and the client supplies valid +username and password, the user will be logged in automatically using the +connection specified by \fIsession_name\fP. + +If \fIsession_name\fP is empty, the \fBLOGIN DOMAIN\fR from the client +with be used to select the section. If no domain name is supplied, the +first suitable section will be used for automatic login. .TP \fBbitmap_cache\fR=\fI[true|false]\fR @@ -294,8 +298,9 @@ depth of the client. Only Xvnc and X11rdp use that setting. Xorg runs at \fI24\fR bpp. .TP -\fBcode\fR=\fI<number>\fR|\fI\-1\fR -Specifies the session type, the default, \fI\0\fR, is Xvnc, \fI\10\fR, is X11rdp, and \fI\20\fR, uses Xorg driver mode. +\fBcode\fR=\fI<number>\fR|\fI0\fR +Specifies the session type. The default, \fI0\fR, is Xvnc, \fI10\fR is +X11rdp, and \fI20\fR is Xorg with xorgxrdp modules. .SH "EXAMPLES" This is an example \fBxrdp.ini\fR: diff --git a/genkeymap/Makefile.am b/genkeymap/Makefile.am index 25767395..8c295170 100644 --- a/genkeymap/Makefile.am +++ b/genkeymap/Makefile.am @@ -1,3 +1,7 @@ +EXTRA_DIST = \ + dump-keymaps.sh \ + readme.txt + AM_CFLAGS = $(X_CFLAGS) bin_PROGRAMS = \ diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am index 29472c5f..92cc9cf2 100644 --- a/instfiles/Makefile.am +++ b/instfiles/Makefile.am @@ -1,4 +1,5 @@ EXTRA_DIST = \ + keymap-names.txt \ xrdp.sh \ xrdp-sesman.service \ xrdp.service @@ -16,6 +17,7 @@ dist_startscript_DATA = \ km-0000040c.ini \ km-00000410.ini \ km-00000411.ini \ + km-00000412.ini \ km-00000414.ini \ km-00000415.ini \ km-00000416.ini \ diff --git a/instfiles/km-00000412.ini b/instfiles/km-00000412.ini new file mode 100644 index 00000000..e8cb305e --- /dev/null +++ b/instfiles/km-00000412.ini @@ -0,0 +1,1057 @@ +[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=45:45
+Key21=61:61
+Key22=65288:8
+Key23=65289:9
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=121:121
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=91:91
+Key35=93:93
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=59:59
+Key48=39:39
+Key49=96:96
+Key50=65505:0
+Key51=92:92
+Key52=122:122
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=44:44
+Key60=46:46
+Key61=47:47
+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=65514:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=95:95
+Key21=43:43
+Key22=65288:8
+Key23=65056:0
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=89:89
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=123:123
+Key35=125:125
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=58:58
+Key48=34:34
+Key49=126:126
+Key50=65505:0
+Key51=124:124
+Key52=90:90
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=60:60
+Key60=62:62
+Key61=63:63
+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=65512:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=54:54
+Key16=55:55
+Key17=56:56
+Key18=57:57
+Key19=48:48
+Key20=45:45
+Key21=61:61
+Key22=65288:8
+Key23=65289:9
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=121:121
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=91:91
+Key35=93:93
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=59:59
+Key48=39:39
+Key49=96:96
+Key50=65505:0
+Key51=92:92
+Key52=122:122
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=44:44
+Key60=46:46
+Key61=47:47
+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=65514:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=94:94
+Key16=38:38
+Key17=42:42
+Key18=40:40
+Key19=41:41
+Key20=95:95
+Key21=43:43
+Key22=65288:8
+Key23=65056:0
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=89:89
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=123:123
+Key35=125:125
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=58:58
+Key48=34:34
+Key49=126:126
+Key50=65505:0
+Key51=124:124
+Key52=90:90
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=60:60
+Key60=62:62
+Key61=63:63
+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=65512:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=45:45
+Key21=61:61
+Key22=65288:8
+Key23=65289:9
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=89:89
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=91:91
+Key35=93:93
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=59:59
+Key48=39:39
+Key49=96:96
+Key50=65505:0
+Key51=92:92
+Key52=90:90
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=44:44
+Key60=46:46
+Key61=47:47
+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=65514:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=54:54
+Key16=55:55
+Key17=56:56
+Key18=57:57
+Key19=48:48
+Key20=45:45
+Key21=61:61
+Key22=65288:8
+Key23=65289:9
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=89:89
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=91:91
+Key35=93:93
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=59:59
+Key48=39:39
+Key49=96:96
+Key50=65505:0
+Key51=92:92
+Key52=90:90
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=44:44
+Key60=46:46
+Key61=47:47
+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=65514:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=95:95
+Key21=43:43
+Key22=65288:8
+Key23=65056:0
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=121:121
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=123:123
+Key35=125:125
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=58:58
+Key48=34:34
+Key49=126:126
+Key50=65505:0
+Key51=124:124
+Key52=122:122
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=60:60
+Key60=62:62
+Key61=63:63
+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=65512:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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=94:94
+Key16=38:38
+Key17=42:42
+Key18=40:40
+Key19=41:41
+Key20=95:95
+Key21=43:43
+Key22=65288:8
+Key23=65056:0
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=121:121
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=123:123
+Key35=125:125
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=58:58
+Key48=34:34
+Key49=126:126
+Key50=65505:0
+Key51=124:124
+Key52=122:122
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=60:60
+Key60=62:62
+Key61=63:63
+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=65512:0
+Key114=0:0
+Key115=65515:0
+Key116=65516: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
+Key209=65329:0
+Key210=65332:0
diff --git a/libpainter b/libpainter new file mode 160000 +Subproject 15e9448f7cd770095d514ff1f6cf470d68245be diff --git a/librfxcodec b/librfxcodec -Subproject fb80d7d38c914af756eecb87762ea1cbb4df448 +Subproject 29fdb8f029bc887d30e0f5c097d2dee820225f3 diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am index b7d1dc26..bd044d77 100644 --- a/libxrdp/Makefile.am +++ b/libxrdp/Makefile.am @@ -1,3 +1,6 @@ +EXTRA_DIST = \ + xrdp_surface.c + AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c index c3763bf5..2d59621a 100644 --- a/libxrdp/libxrdp.c +++ b/libxrdp/libxrdp.c @@ -1332,13 +1332,13 @@ libxrdp_fastpath_send_surface(struct xrdp_session *session, s->rdp_hdr = s->sec_hdr + sec_bytes; s->end = data_pad + pad_bytes + data_bytes; s->p = s->data + (rdp_bytes + sec_bytes); - /* TS_SURFCMD_SET_SURF_BITS */ - out_uint16_le(s, 0x0001); /* CMDTYPE_SET_SURFACE_BITS */ + /* TS_SURFCMD_STREAM_SURF_BITS */ + out_uint16_le(s, CMDTYPE_STREAM_SURFACE_BITS); out_uint16_le(s, destLeft); out_uint16_le(s, destTop); out_uint16_le(s, destRight); out_uint16_le(s, destBottom); - /* TS_ BITMAP_DATA_EX */ + /* TS_BITMAP_DATA_EX */ out_uint8(s, bpp); out_uint8(s, 0); out_uint8(s, 0); diff --git a/libxrdp/xrdp_bitmap32_compress.c b/libxrdp/xrdp_bitmap32_compress.c index 083c4409..daec9f28 100644 --- a/libxrdp/xrdp_bitmap32_compress.c +++ b/libxrdp/xrdp_bitmap32_compress.c @@ -107,7 +107,7 @@ fsplit3(char *in_data, int start_line, int width, int e, } start_line--; cy++; - if (out_index > 64 * 64) + if (out_index + width + e > 64 * 64) { break; } @@ -195,7 +195,7 @@ fsplit4(char *in_data, int start_line, int width, int e, } start_line--; cy++; - if (out_index > 64 * 64) + if (out_index + width + e > 64 * 64) { break; } @@ -422,6 +422,7 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, char *sr_data; char *sg_data; char *sb_data; + char *hold_p; int a_bytes; int r_bytes; int g_bytes; @@ -449,6 +450,7 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, r_data = a_data + max_bytes; g_data = r_data + max_bytes; b_data = g_data + max_bytes; + hold_p = s->p; if (header & FLAGS_NOALPHA) { @@ -459,35 +461,44 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, fdelta(sr_data, r_data, cx, cy); fdelta(sg_data, g_data, cx, cy); fdelta(sb_data, b_data, cx, cy); - out_uint8(s, header); - r_bytes = fpack(r_data, cx, cy, s); - g_bytes = fpack(g_data, cx, cy, s); - b_bytes = fpack(b_data, cx, cy, s); - total_bytes = r_bytes + g_bytes + b_bytes; - if (1 + total_bytes > byte_limit) + while (cy > 0) { - /* failed */ - LLOGLN(0, ("xrdp_bitmap32_compress: too big, rgb " - "bytes %d %d %d total_bytes %d cx %d cy %d " - "byte_limit %d", r_bytes, g_bytes, b_bytes, - total_bytes, cx, cy, byte_limit)); - return 0; - } - max_bytes = cx * cy * 3; - if (total_bytes > max_bytes) - { - /* raw is better */ - LLOGLN(10, ("xrdp_bitmap32_compress: too big, rgb " - "bytes %d %d %d total_bytes %d cx %d cy %d " - "max_bytes %d", r_bytes, g_bytes, b_bytes, - total_bytes, cx, cy, max_bytes)); - init_stream(s, 0); - foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); + s->p = hold_p; + out_uint8(s, header); + r_bytes = fpack(r_data, cx, cy, s); + g_bytes = fpack(g_data, cx, cy, s); + b_bytes = fpack(b_data, cx, cy, s); + max_bytes = cx * cy * 3; + total_bytes = r_bytes + g_bytes + b_bytes; + if (total_bytes > max_bytes) + { + if (2 + max_bytes <= byte_limit) + { + s->p = hold_p; + foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); + break; + } + } + if (1 + total_bytes <= byte_limit) + { + break; + } + cy--; } } else { - foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); + while (cy > 0) + { + max_bytes = cx * cy * 3; + if (2 + max_bytes <= byte_limit) + { + s->p = hold_p; + foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); + break; + } + cy--; + } } } else @@ -500,36 +511,45 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, fdelta(sr_data, r_data, cx, cy); fdelta(sg_data, g_data, cx, cy); fdelta(sb_data, b_data, cx, cy); - out_uint8(s, header); - a_bytes = fpack(a_data, cx, cy, s); - r_bytes = fpack(r_data, cx, cy, s); - g_bytes = fpack(g_data, cx, cy, s); - b_bytes = fpack(b_data, cx, cy, s); - max_bytes = cx * cy * 4; - total_bytes = a_bytes + r_bytes + g_bytes + b_bytes; - if (1 + total_bytes > byte_limit) + while (cy > 0) { - /* failed */ - LLOGLN(0, ("xrdp_bitmap32_compress: too big, argb " - "bytes %d %d %d %d total_bytes %d cx %d cy %d " - "byte_limit %d", a_bytes, r_bytes, g_bytes, b_bytes, - total_bytes, cx, cy, byte_limit)); - return 0; - } - if (total_bytes > max_bytes) - { - /* raw is better */ - LLOGLN(10, ("xrdp_bitmap32_compress: too big, argb " - "bytes %d %d %d %d total_bytes %d cx %d cy %d " - "max_bytes %d", a_bytes, r_bytes, g_bytes, b_bytes, - total_bytes, cx, cy, max_bytes)); - init_stream(s, 0); - foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); + s->p = hold_p; + out_uint8(s, header); + a_bytes = fpack(a_data, cx, cy, s); + r_bytes = fpack(r_data, cx, cy, s); + g_bytes = fpack(g_data, cx, cy, s); + b_bytes = fpack(b_data, cx, cy, s); + max_bytes = cx * cy * 4; + total_bytes = a_bytes + r_bytes + g_bytes + b_bytes; + if (total_bytes > max_bytes) + { + if (2 + max_bytes <= byte_limit) + { + s->p = hold_p; + foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); + break; + } + } + if (1 + total_bytes <= byte_limit) + { + break; + } + cy--; } } else { - foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); + while (cy > 0) + { + max_bytes = cx * cy * 4; + if (2 + max_bytes <= byte_limit) + { + s->p = hold_p; + foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); + break; + } + cy--; + } } } return cy; diff --git a/libxrdp/xrdp_bitmap_compress.c b/libxrdp/xrdp_bitmap_compress.c index 03c56f10..56898776 100644 --- a/libxrdp/xrdp_bitmap_compress.c +++ b/libxrdp/xrdp_bitmap_compress.c @@ -22,6 +22,8 @@ #include "libxrdp.h" +#define BC_MAX_BYTES (16 * 1024) + /*****************************************************************************/ #define IN_PIXEL8(in_ptr, in_x, in_y, in_w, in_last_pixel, in_pixel); \ do { \ @@ -695,7 +697,7 @@ xrdp_bitmap_compress(char *in_data, int width, int height, out_count = end; line = in_data + width * start_line; - while (start_line >= 0 && out_count < 32768) + while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count; @@ -987,7 +989,7 @@ xrdp_bitmap_compress(char *in_data, int width, int height, out_count = end * 2; line = in_data + width * start_line * 2; - while (start_line >= 0 && out_count < 32768) + while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count * 2; @@ -1279,7 +1281,7 @@ xrdp_bitmap_compress(char *in_data, int width, int height, out_count = end * 3; line = in_data + width * start_line * 4; - while (start_line >= 0 && out_count < 32768) + while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count * 3; diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c index e8c32e7d..a8b9344f 100644 --- a/libxrdp/xrdp_caps.c +++ b/libxrdp/xrdp_caps.c @@ -457,7 +457,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) if (g_memcmp(codec_guid, XR_CODEC_GUID_NSCODEC, 16) == 0) { - g_writeln("xrdp_caps_process_codecs: nscodec codec id %d prop len %d", + g_writeln("xrdp_caps_process_codecs: nscodec, codec id %d, properties len %d", codec_id, codec_properties_length); self->client_info.ns_codec_id = codec_id; i1 = MIN(64, codec_properties_length); @@ -466,7 +466,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) } else if (g_memcmp(codec_guid, XR_CODEC_GUID_REMOTEFX, 16) == 0) { - g_writeln("xrdp_caps_process_codecs: rfx codec id %d prop len %d", + g_writeln("xrdp_caps_process_codecs: RemoteFX, codec id %d, properties len %d", codec_id, codec_properties_length); self->client_info.rfx_codec_id = codec_id; i1 = MIN(64, codec_properties_length); @@ -475,7 +475,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) } else if (g_memcmp(codec_guid, XR_CODEC_GUID_JPEG, 16) == 0) { - g_writeln("xrdp_caps_process_codecs: jpeg codec id %d prop len %d", + g_writeln("xrdp_caps_process_codecs: jpeg, codec id %d, properties len %d", codec_id, codec_properties_length); self->client_info.jpeg_codec_id = codec_id; i1 = MIN(64, codec_properties_length); @@ -492,7 +492,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) } else if (g_memcmp(codec_guid, XR_CODEC_GUID_H264, 16) == 0) { - g_writeln("xrdp_caps_process_codecs: h264 codec id %d prop len %d", + g_writeln("xrdp_caps_process_codecs: h264, codec id %d, properties len %d", codec_id, codec_properties_length); self->client_info.h264_codec_id = codec_id; i1 = MIN(64, codec_properties_length); @@ -534,6 +534,18 @@ xrdp_caps_process_frame_ack(struct xrdp_rdp *self, struct stream *s, int len) } /*****************************************************************************/ +static int APP_CC +xrdp_caps_process_surface_cmds(struct xrdp_rdp *self, struct stream *s, int len) +{ + int cmdFlags; + g_writeln("xrdp_caps_process_surface_cmds:"); + in_uint32_le(s, cmdFlags); + in_uint8s(s, 4); /* reserved */ + g_writeln(" cmdFlags 0x%08x", cmdFlags); + return 0; +} + +/*****************************************************************************/ int APP_CC xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s) { @@ -659,6 +671,9 @@ xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s) case 0x001E: /* CAPSSETTYPE_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; @@ -827,7 +842,7 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self) codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_NSCODEC, 16); out_uint8(s, 1); /* codec id, must be 1 */ - out_uint16_le(s, 3); + out_uint16_le(s, 3); /* codecPropertiesLength */ out_uint8(s, 0x01); /* fAllowDynamicFidelity */ out_uint8(s, 0x01); /* fAllowSubsampling */ out_uint8(s, 0x03); /* colorLossLevel */ @@ -836,15 +851,21 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self) codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_REMOTEFX, 16); out_uint8(s, 0); /* codec id, client sets */ - out_uint16_le(s, 256); - out_uint8s(s, 256); + out_uint16_le(s, 4); /* codecPropertiesLength */ + out_uint32_le(s, 0); /* reserved */ + /* image remotefx */ + codec_caps_count++; + out_uint8a(s, XR_CODEC_GUID_IMAGE_REMOTEFX, 16); + out_uint8(s, 0); /* codec id, client sets */ + out_uint16_le(s, 4); /* codecPropertiesLength */ + out_uint32_le(s, 0); /* reserved */ #endif /* jpeg */ codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_JPEG, 16); out_uint8(s, 0); /* codec id, client sets */ - out_uint16_le(s, 1); /* ext length */ - out_uint8(s, 75); + out_uint16_le(s, 1); /* codecPropertiesLength */ + out_uint8(s, 75); /* jpeg compression ratio */ /* calculate and set size and count */ codec_caps_size = (int)(s->p - codec_caps_size_ptr); codec_caps_size += 2; /* 2 bytes for RDP_CAPSET_BMPCODECS above */ @@ -901,19 +922,29 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self) out_uint16_le(s, 5); out_uint8(s, 0); /* client sets */ - if (self->client_info.use_fast_path & 1) /* fastpath output on */ + if (self->client_info.use_fast_path & FASTPATH_OUTPUT_SUPPORTED) /* fastpath output on */ { + /* multifragment update */ caps_count++; - out_uint16_le(s, 0x001A); /* 26 CAPSETTYPE_MULTIFRAGMENTUPDATE */ - out_uint16_le(s, 8); + out_uint16_le(s, RDP_CAPSET_MULTIFRAGMENT); /* 26 CAPSETTYPE_MULTIFRAGMENTUPDATE */ + out_uint16_le(s, RDP_CAPLEN_MULTIFRAGMENT); out_uint32_le(s, 3 * 1024 * 1024); /* 3MB */ - } - /* frame acks */ - caps_count++; - out_uint16_le(s, 0x001E); /* CAPSETTYPE_FRAME_ACKNOWLEDGE */ - out_uint16_le(s, 8); - out_uint32_le(s, 2); /* 2 frames in flight */ + /* frame acks */ + caps_count++; + out_uint16_le(s, RDP_CAPSET_FRAME_ACKNOWLEDGE); /* CAPSETTYPE_FRAME_ACKNOWLEDGE */ + out_uint16_le(s, RDP_CAPLEN_FRAME_ACKNOWLEDGE); + out_uint32_le(s, 2); /* 2 frames in flight */ + + /* surface commands */ + caps_count++; + out_uint16_le(s, RDP_CAPSET_SURFCMDS); /* CAPSETTYPE_SURFACE_COMMANDS */ + out_uint16_le(s, RDP_CAPLEN_SURFCMDS); /* lengthCapability */ + out_uint32_le(s, (SURFCMDS_SETSURFACEBITS | + SURFCMDS_FRAMEMARKER | + SURFCMDS_STREAMSUFRACEBITS)); /* cmdFlags */ + out_uint32_le(s, 0); /* reserved */ + } out_uint8s(s, 4); /* pad */ diff --git a/libxrdp/xrdp_jpeg_compress.c b/libxrdp/xrdp_jpeg_compress.c index 385203a6..755c20bd 100644 --- a/libxrdp/xrdp_jpeg_compress.c +++ b/libxrdp/xrdp_jpeg_compress.c @@ -365,11 +365,14 @@ jpeg_compress(char *in_data, int width, int height, *(dst8++) = red; } - for (i = 0; i < e; i++) + if (width > 0) { - *(dst8++) = blue; - *(dst8++) = green; - *(dst8++) = red; + for (i = 0; i < e; i++) + { + *(dst8++) = blue; + *(dst8++) = green; + *(dst8++) = red; + } } } } diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c index 18a5ad38..b0c28ed8 100644 --- a/libxrdp/xrdp_orders.c +++ b/libxrdp/xrdp_orders.c @@ -2235,6 +2235,11 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self, Bpp = (bpp + 7) / 8; bufsize = (width + e) * height * Bpp; + while (bufsize + 16 > MAX_ORDERS_SIZE) + { + height--; + bufsize = (width + e) * height * Bpp; + } if (xrdp_orders_check(self, bufsize + 16) != 0) { return 1; @@ -2254,33 +2259,58 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self, out_uint16_le(self->out_s, bufsize); out_uint16_le(self->out_s, cache_idx); - for (i = height - 1; i >= 0; i--) + if (Bpp == 4) { - for (j = 0; j < width; j++) + for (i = height - 1; i >= 0; i--) { - if (Bpp == 3) + for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); + out_uint8(self->out_s, pixel >> 24); } - else if (Bpp == 2) + out_uint8s(self->out_s, Bpp * e); + } + } + else if (Bpp == 3) + { + for (i = height - 1; i >= 0; i--) + { + for (j = 0; j < width; j++) { - pixel = GETPIXEL16(data, j, i, width); + pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); + out_uint8(self->out_s, pixel >> 16); } - else if (Bpp == 1) + out_uint8s(self->out_s, Bpp * e); + } + } + else if (Bpp == 2) + { + for (i = height - 1; i >= 0; i--) + { + for (j = 0; j < width; j++) { - pixel = GETPIXEL8(data, j, i, width); + pixel = GETPIXEL16(data, j, i, width); out_uint8(self->out_s, pixel); + out_uint8(self->out_s, pixel >> 8); } + out_uint8s(self->out_s, Bpp * e); } - - for (j = 0; j < e; j++) + } + else if (Bpp == 1) + { + for (i = height - 1; i >= 0; i--) { - out_uint8s(self->out_s, Bpp); + for (j = 0; j < width; j++) + { + pixel = GETPIXEL8(data, j, i, width); + out_uint8(self->out_s, pixel); + } + out_uint8s(self->out_s, Bpp * e); } } @@ -2334,20 +2364,19 @@ xrdp_orders_send_bitmap(struct xrdp_orders *self, if (bpp > 24) { lines_sending = xrdp_bitmap32_compress(data, width, height, s, - bpp, 16384, + bpp, MAX_ORDERS_SIZE, i - 1, temp_s, e, 0x10); } else { - lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384, + lines_sending = xrdp_bitmap_compress(data, width, height, s, + bpp, MAX_ORDERS_SIZE, i - 1, temp_s, e); } if (lines_sending != height) { - g_writeln("error in xrdp_orders_send_bitmap, lines_sending(%d) != \ -height(%d)", lines_sending, height); - return 1; + height = lines_sending; } bufsize = (int)(s->p - p); @@ -2458,6 +2487,7 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, int pixel = 0; int e = 0; + g_writeln("xrdp_orders_send_raw_bitmap2:"); if (width > 64) { g_writeln("error, width > 64"); @@ -2479,6 +2509,11 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, Bpp = (bpp + 7) / 8; bufsize = (width + e) * height * Bpp; + while (bufsize + 14 > MAX_ORDERS_SIZE) + { + height--; + bufsize = (width + e) * height * Bpp; + } if (xrdp_orders_check(self, bufsize + 14) != 0) { return 1; @@ -2499,7 +2534,7 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, i = cache_idx & 0xff; out_uint8(self->out_s, i); - if (1 && Bpp == 3) + if (Bpp == 4) { for (i = height - 1; i >= 0; i--) { @@ -2509,44 +2544,49 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); + out_uint8(self->out_s, pixel >> 24); } - for (j = 0; j < e; j++) - { - out_uint8s(self->out_s, Bpp); - } + out_uint8s(self->out_s, Bpp * e); } } - else - { - for (i = height - 1; i >= 0; i--) + else if (Bpp == 3) { - for (j = 0; j < width; j++) + for (i = height - 1; i >= 0; i--) { - if (Bpp == 3) + for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); } - else if (Bpp == 2) + out_uint8s(self->out_s, Bpp * e); + } + } + else if (Bpp == 2) + { + for (i = height - 1; i >= 0; i--) + { + for (j = 0; j < width; j++) { pixel = GETPIXEL16(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); } - else if (Bpp == 1) + out_uint8s(self->out_s, Bpp * e); + } + } + else if (Bpp == 1) + { + for (i = height - 1; i >= 0; i--) + { + for (j = 0; j < width; j++) { pixel = GETPIXEL8(data, j, i, width); out_uint8(self->out_s, pixel); } + out_uint8s(self->out_s, Bpp * e); } - - for (j = 0; j < e; j++) - { - out_uint8s(self->out_s, Bpp); - } - } } return 0; @@ -2599,20 +2639,19 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self, if (bpp > 24) { lines_sending = xrdp_bitmap32_compress(data, width, height, s, - bpp, 16384, + bpp, MAX_ORDERS_SIZE, i - 1, temp_s, e, 0x10); } else { - lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384, + lines_sending = xrdp_bitmap_compress(data, width, height, s, + bpp, MAX_ORDERS_SIZE, i - 1, temp_s, e); } if (lines_sending != height) { - g_writeln("error in xrdp_orders_send_bitmap2, lines_sending(%d) != \ -height(%d)", lines_sending, height); - return 1; + height = lines_sending; } bufsize = (int)(s->p - p); diff --git a/neutrinordp/Makefile.am b/neutrinordp/Makefile.am index d3adc756..fb5bf030 100644 --- a/neutrinordp/Makefile.am +++ b/neutrinordp/Makefile.am @@ -17,6 +17,7 @@ module_LTLIBRARIES = \ libxrdpneutrinordp_la_SOURCES = \ xrdp-color.c \ + xrdp-color.h \ xrdp-neutrinordp.c \ xrdp-neutrinordp.h diff --git a/sesman/Makefile.am b/sesman/Makefile.am index b5e3f138..89b99f54 100644 --- a/sesman/Makefile.am +++ b/sesman/Makefile.am @@ -1,3 +1,6 @@ +EXTRA_DIST = \ + Doxyfile + AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index 221437e9..7a2672a8 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -1,3 +1,9 @@ +EXTRA_DIST = \ + clipboard-notes.txt \ + pcsc \ + pulse \ + wave-format-server.txt + AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ diff --git a/sesman/env.c b/sesman/env.c index 1a4fa679..d8eb3106 100644 --- a/sesman/env.c +++ b/sesman/env.c @@ -150,7 +150,7 @@ env_set_user(const char *username, char **passwd_file, int display, if (0 == g_cfg->auth_file_path) { /* if no auth_file_path is set, then we go for - $HOME/.vnc/sesman_username_passwd */ + $HOME/.vnc/sesman_username_passwd:DISPLAY */ if (!g_directory_exist(".vnc")) { if (g_mkdir(".vnc") < 0) @@ -161,12 +161,24 @@ env_set_user(const char *username, char **passwd_file, int display, } } - len = g_snprintf(NULL, 0, "%s/.vnc/sesman_%s_passwd", pw_dir, username); + len = g_snprintf(NULL, 0, "%s/.vnc/sesman_%s_passwd:%d", + pw_dir, username, display); *passwd_file = (char *) g_malloc(len + 1, 1); if (*passwd_file != NULL) { - g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd", pw_dir, username); + /* Try legacy name first, remove if found */ + g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd", + pw_dir, username); + if (g_file_exist(*passwd_file)) + { + log_message(LOG_LEVEL_WARNING, "Removing insecure " + "password file %s", *passwd_file); + g_file_delete(*passwd_file); + } + + g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd:%d", + pw_dir, username, display); } } else diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am index 400a4285..df0b1558 100644 --- a/xrdp/Makefile.am +++ b/xrdp/Makefile.am @@ -1,3 +1,8 @@ +EXTRA_DIST = \ + czech.txt \ + rdp-scan-codes.txt \ + xrdpwin.c + AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ @@ -19,7 +24,7 @@ endif if XRDP_RFXCODEC AM_CPPFLAGS += -DXRDP_RFXCODEC AM_CPPFLAGS += -I$(top_srcdir)/librfxcodec/include -XRDP_EXTRA_LIBS += $(top_srcdir)/librfxcodec/src/.libs/librfxencode.a +XRDP_EXTRA_LIBS += $(top_builddir)/librfxcodec/src/.libs/librfxencode.a endif if XRDP_PIXMAN diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini index 1da90cca..242641ff 100644 --- a/xrdp/xrdp.ini +++ b/xrdp/xrdp.ini @@ -31,8 +31,10 @@ key_file= #tls_ciphers=HIGH ; Section name to use for automatic login if the client sends username -; and password -autorun=X11rdp +; and password. If empty, the domain name sent by the client is used. +; If empty and no domain name is given, the first suitable section in +; this file will be used. +autorun= allow_channels=true allow_multimon=true diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 9ffc6284..053be88b 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -149,9 +149,9 @@ xrdp_bitmap_create_with_data(int width, int height, struct xrdp_wm *wm) { struct xrdp_bitmap *self = (struct xrdp_bitmap *)NULL; + int Bpp; #if defined(NEED_ALIGN) tintptr data_as_int; - int Bpp; #endif self = (struct xrdp_bitmap *)g_malloc(sizeof(struct xrdp_bitmap), 1); @@ -160,6 +160,22 @@ xrdp_bitmap_create_with_data(int width, int height, self->height = height; self->bpp = bpp; self->wm = wm; + + Bpp = 4; + switch (bpp) + { + case 8: + Bpp = 1; + break; + case 15: + Bpp = 2; + break; + case 16: + Bpp = 2; + break; + } + self->line_size = width * Bpp; + #if defined(NEED_ALIGN) data_as_int = (tintptr) data; if (((bpp >= 24) && (data_as_int & 3)) || @@ -167,19 +183,6 @@ xrdp_bitmap_create_with_data(int width, int height, { /* got to copy data here, it's not aligned other calls in this file assume alignment */ - Bpp = 4; - switch (bpp) - { - case 8: - Bpp = 1; - break; - case 15: - Bpp = 2; - break; - case 16: - Bpp = 2; - break; - } self->data = (char *)g_malloc(width * height * Bpp, 0); g_memcpy(self->data, data, width * height * Bpp); return self; diff --git a/xrdp/xrdp_encoder.c b/xrdp/xrdp_encoder.c index 5c9832ee..0af0b85e 100644 --- a/xrdp/xrdp_encoder.c +++ b/xrdp/xrdp_encoder.c @@ -60,11 +60,6 @@ xrdp_encoder_create(struct xrdp_mm *mm) client_info = mm->wm->client_info; - if (client_info->client_os_major != OSMAJORTYPE_UNIX) - { - /* temp workaround to avoid black screen in non-supported clients */ - return 0; - } if (client_info->mcs_connection_type != 6) /* LAN */ { return 0; diff --git a/xrdp/xrdp_keyboard.ini b/xrdp/xrdp_keyboard.ini index 914ca974..3ce7644a 100644 --- a/xrdp/xrdp_keyboard.ini +++ b/xrdp/xrdp_keyboard.ini @@ -62,6 +62,7 @@ rdp_layout_de=0x00000407 rdp_layout_fr=0x0000040C rdp_layout_it=0x00000410 rdp_layout_jp=0x00000411 +rdp_layout_kr=0x00000412 rdp_layout_ru=0x00000419 rdp_layout_se=0x0000041D rdp_layout_ch=0x00000807 @@ -76,6 +77,7 @@ rdp_layout_de=de rdp_layout_fr=fr rdp_layout_it=it rdp_layout_jp=jp +rdp_layout_kr=kr rdp_layout_ru=ru rdp_layout_se=se rdp_layout_ch=ch @@ -103,6 +105,7 @@ rdp_layout_us=us rdp_layout_de=de rdp_layout_fr=fr rdp_layout_jp=jp +rdp_layout_kr=kr rdp_layout_it=it rdp_layout_ru=ru rdp_layout_se=se diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 715a18fc..bb6bc5d8 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -229,14 +229,19 @@ xrdp_mm_send_login(struct xrdp_mm *self) out_uint16_be(s, self->wm->screen->width); out_uint16_be(s, self->wm->screen->height); - if (xserverbpp > 0) + /* select and send X server bpp */ + if (xserverbpp == 0) { - out_uint16_be(s, xserverbpp); - } - else - { - out_uint16_be(s, self->wm->screen->bpp); + if (self->code == 20) + { + xserverbpp = 24; /* xorgxrdp is always at 24 bpp */ + } + else + { + xserverbpp = self->wm->screen->bpp; /* use client's bpp */ + } } + out_uint16_be(s, xserverbpp); /* send domain */ if(self->wm->client_info->domain[0]!='_') @@ -2291,7 +2296,7 @@ xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id) { int ex; - LLOGLN(0, ("xrdp_mm_frame_ack:")); + LLOGLN(10, ("xrdp_mm_frame_ack:")); self->encoder->frame_id_client = frame_id; if (self->wm->client_info->use_frame_acks == 0) { diff --git a/xrdpapi/Makefile.am b/xrdpapi/Makefile.am index 920f3d1a..fefa03fc 100644 --- a/xrdpapi/Makefile.am +++ b/xrdpapi/Makefile.am @@ -1,3 +1,8 @@ +EXTRA_DIST = \ + simple.c \ + vrplayer.c \ + vrplayer.mk + module_LTLIBRARIES = \ libxrdpapi.la diff --git a/xrdpvr/Makefile.am b/xrdpvr/Makefile.am index f9b8d421..8c907402 100644 --- a/xrdpvr/Makefile.am +++ b/xrdpvr/Makefile.am @@ -3,4 +3,5 @@ module_LTLIBRARIES = \ libxrdpvr_la_SOURCES = \ xrdpvr.c \ - xrdpvr.h + xrdpvr.h \ + xrdpvr_internal.h |
