Compare commits

...

121 Commits

Author SHA1 Message Date
Bernhard Miklautz
91256e61b4
Merge pull request #4626 from ondrejholy/manpage-fix
Fix drive redirection in manpage
2018-10-18 12:03:00 +00:00
Ondrej Holy
030ca417d1 Fix drive redirection in manpage
Man page has been updated according to the wiki. Unfortunately, wiki
mentioned "drive" subplugin for 1.0.2, but stable-1.0 still uses "disk".
Let's fix the man page accordingly.

Closes: https://github.com/FreeRDP/FreeRDP/issues/4593
2018-05-04 09:02:04 +02:00
Bernhard Miklautz
079678bf61
Merge pull request #4417 from ondrejholy/tls1+
tls: enable tls 1+
2018-02-13 15:20:49 +01:00
Bernhard Miklautz
a3e7ce0a7d tls: enable tls 1+
Currently TLS version 1.0 is used implicitly by using the TLSv1_method.
To be able to also use TLS 1.1 and later use SSLv23_client_method
instead. To make sure SSLv2 or SSLv3 isn't used disable them.

Commit aa80f63b from master was backported by Ondrej Holy <oholy@redhat.com>.

https://github.com/FreeRDP/FreeRDP/issues/2128
2018-02-09 15:05:24 +01:00
Bernhard Miklautz
c659d348af
Merge pull request #4386 from ondrejholy/manpages-update
Fix smartcard usage in manpage
2018-02-08 16:28:45 +01:00
Ondrej Holy
ed30c466c9 Fix smartcard usage in manpage
Man page has been updated according to the wiki. Unfortunately, wiki
mentions "smartcard" subplugin, which was introduced later, but
stable-1.0 uses just scard. Let's fix the man page accordingly.
2018-01-25 13:19:57 +01:00
Bernhard Miklautz
b9fd0db009 Merge pull request #4129 from ondrejholy/manpages-update
Add description for available plugins
2017-09-21 15:02:58 +02:00
Ondrej Holy
0c050bb8cd Add description for available plugins
The man pages lack info about available plugins and its functionality.
Add description for available plugins and their parameters.

It is based on info from upstream wiki pages:
https://github.com/FreeRDP/FreeRDP/wiki/Plugins
https://github.com/FreeRDP/FreeRDP/wiki/CommandLineInterface
2017-09-12 14:33:07 +02:00
Bernhard Miklautz
50b9eb203c Merge pull request #3026 from globin/stable-1.0
Replace deprecated des_ and fix LibreSSL build
2016-02-29 17:22:46 +01:00
Robin Gloster
8c41dc1229 Replace deprecated des_ and fix LibreSSL build
des_ methods and types were marked deprecated in
OpenSSL 0.9.7 and will be removed in OpenSSL 1.1.0 . This patch replaces
the des_ methods and types with their new DES_ counterparts. This
enables building with LibreSSL as OpenSSL library.
2015-12-28 22:49:21 +00:00
Bernhard Miklautz
2331d24319 Merge pull request #2693 from ondrejholy/fix-pulse-cmd
rdpsnd/pulse: Fix crash if device isn't specified
2015-06-22 13:20:53 +02:00
Bernhard Miklautz
7ebc72bb26 Merge pull request #2694 from ondrejholy/fix-pulse-asserts
rdpsnd/pulse: Fix crashes in pulseaudio
2015-06-18 16:22:11 +02:00
Ondrej Holy
fe2a549e5d rdpsnd/pulse: Fix crashes in pulseaudio
Function pa_stream_trigger has to be called under lock to avoid
following crashes on asserts:

Assertion 'e->mainloop->n_enabled_defer_events > 0' failed at pulse/mainloop.c:257, function mainloop_defer_enable(). Aborting.
Assertion '!e->next' failed at pulsecore/queue.c:104, function pa_queue_pop(). Aborting.
Assertion 'q->front' failed at pulsecore/queue.c:81, function pa_queue_push(). Aborting.
2015-06-12 11:39:20 +02:00
Ondrej Holy
800c865bd7 rdpsnd/pulse: Fix crash if device isn't specified
Freerdp crashes if pulseaudio device isn't specified on commandline, i.e.:
xfreerdp --plugin rdpsnd --data pulse

The crash occurs, because data[1] is NULL and it is passed into strlen
function. We have to check whether data[1] was set before calling strlen
to fix this crash.
2015-06-11 14:23:31 +02:00
Marc-André Moreau
5af8de7204 Merge pull request #1667 from bmiklautz/stable-1.0_issue_1654
Stable 1.0 issue 1654
2014-02-10 08:14:24 -05:00
Marc-André Moreau
0838530c46 Merge pull request #1682 from bmiklautz/issue_1681
build: removed macosx-version-min
2014-02-10 08:10:27 -05:00
Bernhard Miklautz
9d4934bbb2 build: removed macosx-version-min
fixed #1681
2014-02-06 11:14:41 +01:00
Bernhard Miklautz
979659ad83 xfreerdp: handle negative mouse coordinates
If the pointer is moved out a window relatives coordinates can get negative
in X.

fixed #1654
2014-01-22 15:19:54 +01:00
Bernhard Miklautz
2e50a129eb xfreerdp: removed unused function 2014-01-22 15:10:20 +01:00
Marc-André Moreau
0c2e111b3a Merge pull request #1547 from bmiklautz/stable-1.0
Fixes and improvements
2013-10-16 06:19:07 -07:00
Bernhard Miklautz
e6b1974a37 transport: set pointers to NULL after free 2013-10-16 12:26:11 +02:00
Bernhard Miklautz
093470673e Merge pull request #3 from zstegi/stable-1.0
backported timezone redirection
2013-08-19 06:48:33 -07:00
Stefan Giermair
26045f1062 backported timezone redirection
should be equal with 777dff2d0b
2013-08-10 10:18:13 -04:00
Marc-André Moreau
e4ba911b02 libfreerdp-core: cleanup time zones 2013-08-10 09:29:38 -04:00
Marc-André Moreau
4947e9837d libfreerdp-core: add full timezone redirection support 2013-08-10 09:29:38 -04:00
Marc-André Moreau
36d4117c0f libfreerdp-core: add unix timezone identifier detection 2013-08-10 09:29:38 -04:00
Marc-André Moreau
fdaaaf8932 libfreerdp-core: added generated Time Zone Redirection table 2013-08-10 09:29:37 -04:00
Marc-André Moreau
87a736dfea libfreerdp-core: move timezone code from info.c to timezone.c 2013-08-10 09:29:37 -04:00
Marc-André Moreau
ea33dc74bf scripts: added Time Zone Redirection table generator 2013-08-10 09:29:37 -04:00
Marc-André Moreau
af0cac60d8 libfreerdp-core: fix timezone redirection 2013-08-10 09:29:37 -04:00
Bernhard Miklautz
4799e1742c security: add a NULL pointer check to fix a server crash
based on 7d58aac24f
2013-07-11 11:19:35 +02:00
Bernhard Miklautz
666c732085 xfreerdp/man page: added --wm-class option 2013-04-03 11:08:16 +02:00
Bernhard Miklautz
3db32e8e8e xfreerdp: added wm-class option to set WM_CLASS hint
based on 96290efd76

fixes #1138
2013-04-03 11:07:56 +02:00
Marc-André Moreau
20fbecee2d Merge pull request #1098 from bmiklautz/stable-1.0
Fixes for 1.0.3
2013-03-15 06:51:03 -07:00
Bernhard Miklautz
e0cc1e6065 kbd: set VK_DIVIDE extended
Fixes #811
2013-03-01 19:36:12 +01:00
Bernhard Miklautz
a8ab91616c Fix host fingerprint lenght in know_hosts file
The fingerprint that was written to the known_hosts file was
one byte to short. For hosts, already in know_hosts, a warning to
update the hosts key in the know_hosts is printed.
For new hosts the key is added with the right length.

Based on 495aba9
fixes #1007
2013-02-27 01:00:22 +01:00
Bernhard Miklautz
25260bd717 Merge pull request #1012 from hardening/stableFixes
backported changes on ber.c around 0x80 length
added a path to a RDP key file or the server crashes
2013-02-26 23:09:17 +01:00
hardening
6bd5070b1f Backported 026e9996d3 2013-02-26 22:31:16 +01:00
hardening
32cb59df28 Register a RDP key file to have RDP security functionnal 2013-02-26 22:30:15 +01:00
Mike McQuaid
293074f30f Add missing config.h to types.h
Without config.h the various HAVE_* macros are not used properly and
this causes a compilation error on OSX Mountain Lion.
(cherry picked from commit e32f9ed4b8)
2013-02-20 02:05:51 +01:00
Bernhard Miklautz
99492506d8 Changed some functions from inline to static inline
This fixes inline build issues with clang.
http://clang.llvm.org/compatibility.html#inline
(cherry picked from commit 1d32894775)
2013-02-20 02:04:16 +01:00
Marc-André Moreau
15069020d3 Merge pull request #972 from hardening/includeFixes
Include fixes
2013-02-15 08:17:35 -08:00
hardening
11c46d804d Fixed more function declarations that aren't prototypes 2013-02-14 21:49:58 +01:00
hardening
2064a99132 Fixed function declarations that aren't prototypes 2013-02-14 21:44:23 +01:00
Bernhard Miklautz
667b3c34c1 Increased version to 1.0.3-dev 2013-01-24 18:18:50 +01:00
Marc-André Moreau
d8562ed6a6 Merge pull request #924 from Nigel62/stable-1.0
Fix to ensure channels are rejoined on a server redirect operation
2013-01-24 08:41:57 -08:00
Nigel Reeves
43ef3785c6 Fix to ensure channels are rejoined on a server redirect operation 2013-01-24 11:40:24 +00:00
Bernhard Miklautz
616aed4ec2 Update ChangeLog and changed version to 1.0.2 2013-01-02 22:46:59 +01:00
Bernhard Miklautz
7b9dd07e00 Increased version to 1.0.2-rc2 2012-12-12 01:38:29 +01:00
Bernhard Miklautz
7d4526a874 xfreerdp: fixed crash with --authonly
Also updated documentation: --authonly returns 0 on success
and != 0 if an error occurs.

fixes #843
2012-12-11 19:52:32 +01:00
Bernhard Miklautz
9f648ca29f rdpdr/disk: fixed command line segfault
when incomplete commands are given for disk redirection freerdp crashed.
fixed #793
2012-12-03 17:29:42 +01:00
Bernhard Miklautz
c9d4abf1a5 documentation: clarify that -K
-K (Do not interfere with window manager bindings) means
not to grab keyboard
2012-12-03 16:41:42 +01:00
Bernhard Miklautz
471e852c71 Merge pull request #838 from nereocystis/stable-authonly
Spelling correction
2012-12-03 02:44:08 -08:00
Bernhard Miklautz
655d889639 Merge pull request #833 from nereocystis/stable-documentation
Stable documentation
2012-12-03 02:43:58 -08:00
Bernhard Miklautz
c535d1a170 Merge pull request #832 from nereocystis/dual-monitor-stable-2
Change derived from
2012-12-03 02:43:14 -08:00
Kevin Dalley
4758d1061e Spelling correction
Authenication=>Authentication
2012-12-01 16:15:09 -08:00
Kevin Dalley
6fff570afc More documentation changes.
Cross-checked:
	client/X11/xfreerdp.1.xml
	libfreerdp-utils/args.c

And ran with each option to verify number of options is correct.

Did not verify correct behavior.
2012-12-01 15:40:09 -08:00
Kevin Dalley
0171c42930 Change derived from
commit 0b7db6232f

    5. Draw the initial workspace correctly when running across multiple monitors. The correct size was always used, but the window was only starting on the current monitor and thus could draw the window off of the viewable area.
2012-11-29 15:21:07 -08:00
Bernhard Miklautz
f311acaffb Merge branch 'issue_799' into stable-1.0
fixes #799
2012-11-20 13:48:46 +01:00
Christian Nilsson
65f60c7353 Fix colors on bitmaps when using -a 15
(cherry picked from commit 5212426bb4)
2012-11-20 09:54:43 +01:00
Bernhard Miklautz
c2640bc05c color conversion fixes
(based on 64ad250f2d)
2012-11-20 09:49:36 +01:00
Kevin Dalley
2b43bbacb9 The following options are not in stable, so the document for these
options need to be removed:
    --pcb is not in stable
    --pcid is not in stable
    --no-salted-checksum
from commit eba79170a9ea4c585baf6
2012-11-19 17:14:32 -08:00
Kevin Dalley
e7f6248e2e Improved documentation in xfreerdp.1.xml. Minor change in args.c usage
statement.

fixed conflict regarding -c in args.c from
commit f109360c33
2012-11-19 17:12:23 -08:00
Kevin Dalley
72caedb48c Added many additional options to documentation, added missing
arguments to options in documentation.  Attempted to alphabetize
options in documentation.

resolved conflicts in merge from 023bc848a2
2012-11-19 17:09:18 -08:00
Kevin Dalley
4f7b2bfb86 Add documentation for "-X" option. 2012-11-19 17:07:34 -08:00
Kevin Dalley
f1b6dcfb6f Correct spelling of "experiance" in documentation. 2012-11-19 17:07:18 -08:00
Bernhard Miklautz
73a90be903 Merge branch 'bmiklautz/issue_806' into stable-1.0
fixes #806
2012-11-19 16:23:07 +01:00
Bernhard Miklautz
b23109d01b build: Fixed library naming
Don't add version suffix to library names.
2012-11-19 16:21:37 +01:00
Bernhard Miklautz
f5308c2005 Changelog: added known problems 2012-11-16 20:11:20 +01:00
Bernhard Miklautz
80ba35c98e Merge pull request #809 from bmiklautz/stable-1.0
Version updates
2012-11-15 01:27:16 -08:00
Brent Collins
05f5009b0a Make the XReparent Window parameter a little more flexible to support both base 16 "with 0x prefix" or decimal window numbers.
(cherry picked from commit 138f115d73)
2012-11-14 22:29:48 +01:00
Brent Collins
5fb42a20e3 Moved the call order around such that the XReparentWindow call will work as intended.
(cherry picked from commit 70ccbd1926)
2012-11-14 22:29:40 +01:00
Bernhard Miklautz
aa22d69a59 Add support for version suffix
(based on c04ea11900)
2012-11-14 17:35:25 +01:00
Bernhard Miklautz
7a9d2ec89b Updated version to 1.0.2 2012-11-14 13:01:25 +01:00
Marc-André Moreau
af940d2f24 Merge pull request #791 from bmiklautz/stable-1.0
ChangeLog updated for 1.0.2
2012-10-30 14:23:08 -07:00
Bernhard Miklautz
dc62f78297 ChangeLog updated for 1.0.2 2012-10-30 22:18:27 +01:00
Bernhard Miklautz
e0f2b3ccc9 Merge pull request #790 from bmiklautz/stable-1.0
xfreerdp: fixed build
2012-10-30 10:11:54 -07:00
Bernhard Miklautz
45ded5f6e2 xfreerdp: fixed build 2012-10-30 18:06:05 +01:00
Otavio Salvador
1eccaf0d2a smartcard: Fix build failure due wrong include paths
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-10-30 14:36:54 -02:00
Bernhard Miklautz
f637d84dd6 Merge pull request #786 from bmiklautz/stable-1.0
Fixes and cleanup for --from-stdin
2012-10-29 07:01:05 -07:00
Bernhard Miklautz
a4a6cc14e1 xfreerdp: fix for endless loop with --from-stdin
If --from-stdin was used non-interactive (e.g. in a script
echoing connection parameters) xfreerdp looped endlessly
when a certificate needed to be trusted because
fgets returns eof.
Now a hint is printed that xfreerdp should be run without
--from-stdin to set the certificate trust.
(cherry picked from commit 4d870b9421)
2012-10-28 03:47:59 +01:00
Bernhard Miklautz
10abb71b5b util/args: fixed when using --from-stdin
- Discard new lines with scanf.
- If domain is left empty (STRG+d pressed) clear EOF flag - this fixes
  an enless loop in xfreerdp on OS X when input is required after a certificate
	warning.
(cherry picked from commit 7a002270d8)
2012-10-28 03:47:13 +01:00
Bernhard Miklautz
b0d569626c utils/args: fixed formating
(cherry picked from commit e5e2ee2aaa)
2012-10-28 03:46:58 +01:00
Otavio Salvador
a2ad01ac54 Merge pull request #784 from bmiklautz/1.0-stable
1.0 stability fixes
2012-10-27 11:39:29 -07:00
Ted Gould
b6665693d7 Fixed character check. Used wrong version of patch previously.
(cherry picked from commit 9809d937ac)
2012-10-27 15:37:35 +02:00
Ted Gould
ee0cc492fd Fixing to not drop the isatty check that was there.
(cherry picked from commit 241b8af9e8)
2012-10-27 15:36:19 +02:00
Ted Gould
e8daef6574 Makes parsing of values off of stdin more robust by initializing the buffers initial and checking the returns from scanf. Also, provides for a null domain by using '.' to make it easier to pipe values into xfreerdp.
(cherry picked from commit 74306c93cb)
2012-10-27 15:35:58 +02:00
Bernhard Miklautz
db9651f48e Detect pipe/stdio for parameter --from-stdin
When --from-stdin is given and parameters are passed via pipe/file
don't use passphrase function for the password.
This fixes #698.
(cherry picked from commit d846024e85)
2012-10-27 15:33:46 +02:00
Bernhard Miklautz
1851856eb3 Fix for #629. Don't show password if --from-stdin.
(cherry picked from commit e9af573d58)
2012-10-27 15:33:29 +02:00
Rex Tsai
efcd396188 xfreerdp: fixed --from-stdin/freerdp_passphrase_read for win32
Signed-off-by: Rex Tsai <chihchun@kalug.linux.org.tw>
(cherry picked from commit ed6dd62ebd)
2012-10-27 15:32:53 +02:00
Mike Carifio
19c6f93e2d xfreerdp: Adds switch --from-stdin.
This switch will prompt username, password, domain and connection
host if not specified at the command line.

Signed-off-by: Rex Tsai <chihchun@kalug.linux.org.tw>
(cherry picked from commit a31f0c62e6)

Conflicts:
	client/X11/xfreerdp.1.xml
	client/X11/xfreerdp.c
	include/freerdp/settings.h
	libfreerdp-core/settings.c
	libfreerdp-utils/args.c
2012-10-27 15:28:47 +02:00
Ying-Chun Liu (PaulLiu)
69dd64c5b7 Init extensions in pre_connect stage.
Due to the client is parsing the args in pre_connect,
we should start loading the extensions after client parsing the args.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@canonical.com>
(cherry picked from commit 48ad5feb0a)

Conflicts:
	libfreerdp-core/rdp.c
2012-10-27 14:59:18 +02:00
Dorian Johnson
eecb39b5a7 svc_plugin: ignore CHANNEL_FLAG_SUSPEND/CHANNEL_FLAG_RESUME
These server flags tell the SVC layer to temporarily stop sending
data, but are currently not implemented. This patch purposefully
ignores them so they don't cause a crash.
(cherry picked from commit 4bda6b5cbc)
2012-10-27 14:35:59 +02:00
Pawel Jakub Dawidek
a8b9767d91 Remove some redundant code.
(cherry picked from commit e03734be30)
2012-10-27 14:35:45 +02:00
Marc-André Moreau
a3396a121b libfreerdp-gdi: add PatBlt DPa operation 2012-10-26 22:29:43 -02:00
Pieterjan Camerlynck
7dded76f0e libfreerdp-core: do not send SynchronizeEvent during connection finalization 2012-10-26 22:13:27 -02:00
Mads Kiilerich
58c36d60cb cache: fix off-by-one-of-the-wrong-kind in BITMAP_CACHE_WAITING_LIST_INDEX handling 2012-03-30 15:48:06 -04:00
Anthony Tong
43204d7d2e cache: fix BITMAP_CACHE_WAITING_LIST_INDEX handling 2012-03-27 15:59:57 -04:00
Mads Kiilerich
024b93933e core: reset crypto key counters when the keys are initialized
This fixes --sec rdp --salted-checksum in combination with farm redirect.

The counters are implicitly set to 0 in rdp_new, but they also has to be reset
after redirects. Resetting the counters when the keys are reset seems like the
cleanest solution.
2012-03-25 07:26:26 -05:00
Jay Sorg
dd0d0f0bdb libfreerdp-core: fix for cursor hot spot out of range 2012-03-25 07:26:26 -05:00
Mads Kiilerich
6752fb4983 core: terminate redirect cookies correctly 2012-03-25 07:26:26 -05:00
Mads Kiilerich
b5133db680 core/redirect: be aware that transport used in transport_check_fds might become invalid 2012-03-25 07:26:26 -05:00
Vic Lee
2950ccf670 core: register audio device only if plugins are registered. 2012-03-25 07:26:25 -05:00
Norbert Federa
633ef183ee xfreerdp: Fixed PIC base address corruption by inline assembly
EBX (or RBX on x86_64) is used for the PIC base address.
The current cpuid inline assembly only saved ebx which is fine
under i386 but only half of the fun on x86_64.
2012-03-25 07:26:25 -05:00
Philippe Auphelle
cb72647866 Restore not-in-place bitmap flip (saves one memcpy() per flipped scanline) 2012-03-25 07:03:27 -05:00
Michael Osborne
2c4a63e180 fix getting state when in remote app mode 2012-03-25 07:02:43 -05:00
Anthony Tong
fcd3b4a130 rdpsnd: follow rdpdr and free the stream from svc_plugin 2012-03-25 07:02:29 -05:00
Marc-André Moreau
999582ae76 xfreerdp: apply X2GO patch 2012-03-25 07:02:22 -05:00
Pawel Jakub Dawidek
a46154e231 Accept both TLSv1 and SSLv3 as a server.
This fixes SSL connections from Microsoft RDC for Mac OS X to FreeRDP server.
2012-03-25 07:00:08 -05:00
Pawel Jakub Dawidek
78a4aa83c4 For salted checksums we need separate counters, as the
encrypt_use_count and decrypt_use_count counters are reset during key
regeneration and we need counters that are never reset.
2012-03-25 06:59:56 -05:00
Anthony Tong
9ffdb7d0d3 rdpdr/scard: dont incorrectly set SCARD_STATE_IGNORE 2012-03-25 06:59:00 -05:00
Mads Kiilerich
93f0dad21b libfreerdp-core: don't add sec_bytes in fastpath_send_input_pdu
fastpath_input_pdu_init already reserved space for fastpath_get_sec_bytes()
which thus already was included in stream_get_length() in
fastpath_send_input_pdu(). Adding sec_bytes again just added extra invalid (but
correctly hashed/encrypted) bytes to the PDU.
2012-03-25 06:58:35 -05:00
Mads Kiilerich
c46cdaf3fb libfreerdp-core: fastpath_send_input_pdu can handle fastpath PDUs up to 32k 2012-03-25 06:58:35 -05:00
Anthony Tong
32aaa99541 libfreerdp-core: disable fp input if FIPS is negotiated 2012-03-25 06:57:16 -05:00
Pawel Jakub Dawidek
0a12057b1c If HOME environment variable is not configured, use / as home. Having NULL home_path will crash freerdp. 2012-03-25 06:56:32 -05:00
Asbjørn Heid
8139fdb392 xfreerdp-server: Fixed deadlock issue in event queue.
Writing to the pipe may block if the pipe is full. Holding the mutex while writing prevents listeners from
aquiring the mutex and unblocking the write. This leads to a deadlock situation.
2012-03-25 06:55:47 -05:00
Slava Dubrovskiy
967d14224e Fix not linked with libpulse (issue 418)
Signed-off-by: Slava Dubrovskiy <dubrsl@altlinux.org>
2012-03-25 06:55:14 -05:00
Pawel Jakub Dawidek
c8d961a55c Write fingerprint to proper descriptor. 2012-03-25 06:53:00 -05:00
Pawel Jakub Dawidek
9f744fc8d2 Advertise persistent bitmap cache only if it is enabled. 2012-03-25 06:46:00 -05:00
Marc-André Moreau
96dccad6fa libfreerdp-core: don't call freerdp_context_free() from freerdp_free() 2012-03-25 06:44:03 -05:00
Jay Sorg
45e5f5e713 libfreerdp-core: fix memory leaks and double free 2012-03-25 06:43:18 -05:00
82 changed files with 3394 additions and 633 deletions

View File

@ -24,6 +24,7 @@ set(CMAKE_COLOR_MAKEFILE ON)
# Include cmake modules
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian)
@ -39,10 +40,12 @@ include(GNUInstallDirsWrapper)
# Soname versioning
set(FREERDP_VERSION_MAJOR "1")
set(FREERDP_VERSION_MINOR "0")
set(FREERDP_VERSION_REVISION "1")
set(FREERDP_VERSION_REVISION "3")
set(FREERDP_VERSION_SUFFIX "dev")
set(FREERDP_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}")
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}.${FREERDP_VERSION_REVISION}")
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@ -96,16 +99,11 @@ check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdbool.h HAVE_STDBOOL_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
# Libraries that we have a hard dependency on
find_required_package(OpenSSL)
# Mac OS X
if(APPLE)
include_directories(/opt/local/include)
link_directories(/opt/local/lib)
set(CMAKE_SHARED_LINKER_FLAGS "-mmacosx-version-min=10.4")
endif()
if(NOT WIN32)
find_required_package(ZLIB)
find_optional_package(PulseAudio)

View File

@ -1,3 +1,46 @@
2013-01-02 Version 1.0.2
FreeRDP 1.0.2 is a maintenance release which contains several bug and stability fixes.
* xfreerdp:
* new parameter --from-stdin - prompts for unspecified arguments username, password, domain and host.
* fix compability with x2go
* fix keyboard state in remote app
* documentation fixes
* fixed crash when started with --authonly (#843)
* libfreerdp-core:
* several memory leaks and double frees were fixed
* support for FastPath PDUs up to 32767
* register audio only if plugin is registered
* load extensions after argument parsing
* libfreerdp-utils:
* fixed crash when HOME environment variable wasn't set
* xfreerdp-server
* deadlock fixed
* accept TLSv1 and SSLv3
* smartcard
* don't incorrectly set SCARD_STATE_IGNORE
* libfreerdp-codec
* performance improvement
* libfreerdp-gdi
* support for PatBlt DPa operation
* plugin
* ignore CHANNEL_FLAG_SUSPEND/CHANNEL_FLAG_RESUME to prevent possible crash
For a detailed list of changes use "git log 1.0.1..1.0.2"
Known problems:
* If windows input language is set to german pressing the divde key (/) on the keypad
results in minus (-) (see issue #811)
2012-02-07 Version 1.0.1
FreeRDP 1.0.1 is a maintenance release to address a certain number of

View File

@ -28,7 +28,7 @@ add_library(audin_pulse ${AUDIN_PULSE_SRCS})
set_target_properties(audin_pulse PROPERTIES PREFIX "")
target_link_libraries(audin_pulse freerdp-utils)
target_link_libraries(audin_pulse ${PULSE_LIBRARIES})
target_link_libraries(audin_pulse ${PULSEAUDIO_LIBRARY})
install(TARGETS audin_pulse DESTINATION ${FREERDP_PLUGIN_PATH})

View File

@ -28,7 +28,7 @@ add_library(tsmf_pulse ${TSMF_PULSE_SRCS})
set_target_properties(tsmf_pulse PROPERTIES PREFIX "")
target_link_libraries(tsmf_pulse freerdp-utils)
target_link_libraries(tsmf_pulse ${PULSE_LIBRARIES})
target_link_libraries(tsmf_pulse ${PULSEAUDIO_LIBRARY})
install(TARGETS tsmf_pulse DESTINATION ${FREERDP_PLUGIN_PATH})

View File

@ -91,7 +91,7 @@ void rail_send_client_window_move_order(rdpRailOrder* rail_order);
void rail_send_client_get_appid_req_order(rdpRailOrder* rail_order);
void rail_send_client_langbar_info_order(rdpRailOrder* rail_order);
rdpRailOrder* rail_order_new();
rdpRailOrder* rail_order_new(void);
void rail_order_free(rdpRailOrder* rail_order);
#endif /* __RAIL_ORDERS_H */

View File

@ -622,7 +622,7 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
name = (char*)pEntryPoints->plugin_data->data[1];
path = (char*)pEntryPoints->plugin_data->data[2];
if (name[0] && path[0])
if (name && name[0] && path && path[0])
{
disk = xnew(DISK_DEVICE);

View File

@ -23,7 +23,7 @@ set(SCARD_SRCS
)
include_directories(..)
include_directories(${PCSC_INCLUDE_DIRS})
include_directories(${PCSC_INCLUDE_DIR})
add_library(scard ${SCARD_SRCS})
set_target_properties(scard PROPERTIES PREFIX "")

View File

@ -29,9 +29,9 @@
#include <semaphore.h>
#include <pthread.h>
#include <PCSC/pcsclite.h>
#include <PCSC/reader.h>
#include <PCSC/winscard.h>
#include <pcsclite.h>
#include <reader.h>
#include <winscard.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/hexdump.h>
@ -238,7 +238,7 @@ static uint32 sc_map_state(uint32 state)
if (state & SCARD_SPECIFIC)
state = 0x00000006;
else if (state & SCARD_NEGOTIABLE)
state = 0x00000005;
state = 0x00000006;
else if (state & SCARD_POWERED)
state = 0x00000004;
else if (state & SCARD_SWALLOWED)

View File

@ -28,6 +28,6 @@ add_library(rdpsnd_pulse ${RDPSND_PULSE_SRCS})
set_target_properties(rdpsnd_pulse PROPERTIES PREFIX "")
target_link_libraries(rdpsnd_pulse freerdp-utils)
target_link_libraries(rdpsnd_pulse ${PULSE_LIBRARIES})
target_link_libraries(rdpsnd_pulse ${PULSEAUDIO_LIBRARY})
install(TARGETS rdpsnd_pulse DESTINATION ${FREERDP_PLUGIN_PATH})

View File

@ -452,7 +452,9 @@ static void rdpsnd_pulse_start(rdpsndDevicePlugin* device)
if (!pulse->stream)
return;
pa_threaded_mainloop_lock(pulse->mainloop);
pa_stream_trigger(pulse->stream, NULL, NULL);
pa_threaded_mainloop_unlock(pulse->mainloop);
}
int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
@ -474,7 +476,7 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
data = pEntryPoints->plugin_data;
if (data && strcmp((char*)data->data[0], "pulse") == 0)
{
if(strlen((char*)data->data[1]) > 0)
if(data->data[1] && strlen((char*)data->data[1]) > 0)
pulse->device_name = xstrdup((char*)data->data[1]);
else
pulse->device_name = NULL;

View File

@ -395,6 +395,7 @@ static void rdpsnd_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
if (rdpsnd->expectingWave)
{
rdpsnd_process_message_wave(rdpsnd, data_in);
stream_free(data_in);
return;
}
@ -425,6 +426,8 @@ static void rdpsnd_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
DEBUG_WARN("unknown msgType %d", msgType);
break;
}
stream_free(data_in);
}
static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, rdpsndDevicePlugin* device)

View File

@ -22,7 +22,7 @@
#include "dfreerdp.h"
void df_keyboard_init();
void df_keyboard_init(void);
boolean df_event_process(freerdp* instance, DFBEvent* event);
#endif /* __DF_EVENT_H */

View File

@ -29,6 +29,8 @@
#include "xf_event.h"
#define CLAMP_ZERO(val) val < 0 ? 0 : val
static const char* const X11_EVENT_STRINGS[] =
{
"", "",
@ -68,11 +70,6 @@ static const char* const X11_EVENT_STRINGS[] =
"GenericEvent",
};
void xf_send_mouse_motion_event(rdpInput* input, boolean down, uint32 button, uint16 x, uint16 y)
{
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
}
boolean xf_event_Expose(xfInfo* xfi, XEvent* event, boolean app)
{
int x, y;
@ -125,7 +122,7 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
return true;
}
input->MouseEvent(input, PTR_FLAGS_MOVE, event->xmotion.x, event->xmotion.y);
input->MouseEvent(input, PTR_FLAGS_MOVE, CLAMP_ZERO(event->xmotion.x), CLAMP_ZERO(event->xmotion.y));
if (xfi->fullscreen)
XSetInputFocus(xfi->display, xfi->window->handle, RevertToPointerRoot, CurrentTime);
@ -143,7 +140,7 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
{
x += window->windowOffsetX;
y += window->windowOffsetY;
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
input->MouseEvent(input, PTR_FLAGS_MOVE, CLAMP_ZERO(x), CLAMP_ZERO(y));
}
}
@ -223,7 +220,7 @@ boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app)
}
}
input->MouseEvent(input, flags, x, y);
input->MouseEvent(input, flags, CLAMP_ZERO(x), CLAMP_ZERO(y));
}
}
@ -283,7 +280,7 @@ boolean xf_event_ButtonRelease(xfInfo* xfi, XEvent* event, boolean app)
}
}
input->MouseEvent(input, flags, x, y);
input->MouseEvent(input, flags, CLAMP_ZERO(x), CLAMP_ZERO(y));
}
return true;

View File

@ -328,8 +328,8 @@ void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
brush = &patblt->brush;
xf_set_rop3(xfi, gdi_rop3_code(patblt->bRop));
foreColor = freerdp_color_convert_rgb(patblt->foreColor, xfi->srcBpp, 32, xfi->clrconv);
backColor = freerdp_color_convert_rgb(patblt->backColor, xfi->srcBpp, 32, xfi->clrconv);
foreColor = freerdp_color_convert_rgb(patblt->foreColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
backColor = freerdp_color_convert_rgb(patblt->backColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
if (brush->style == GDI_BS_SOLID)
{
@ -432,7 +432,7 @@ void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
uint32 color;
xfInfo* xfi = ((xfContext*) context)->xfi;
color = freerdp_color_convert_var(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert_var(opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@ -462,7 +462,7 @@ void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult
DELTA_RECT* rectangle;
xfInfo* xfi = ((xfContext*) context)->xfi;
color = freerdp_color_convert_var(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert_var(multi_opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@ -495,7 +495,7 @@ void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, line_to->bRop2);
color = freerdp_color_convert_rgb(line_to->penColor, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert_rgb(line_to->penColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);
@ -542,7 +542,7 @@ void xf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, polyline->bRop2);
color = freerdp_color_convert_rgb(polyline->penColor, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert_rgb(polyline->penColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);

View File

@ -43,7 +43,7 @@ void xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
if (bitmap->data != NULL)
{
data = freerdp_image_convert(bitmap->data, NULL,
bitmap->width, bitmap->height, bitmap->bpp, xfi->bpp, xfi->clrconv);
bitmap->width, bitmap->height, xfi->srcBpp, xfi->bpp, xfi->clrconv);
if (bitmap->ephemeral != true)
{

View File

@ -109,7 +109,11 @@ int xf_kbd_read_keyboard_state(xfInfo* xfi)
XQueryPointer(xfi->display, xfi->window->handle,
&wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
}
else
{
XQueryPointer(xfi->display, DefaultRootWindow(xfi->display),
&wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
}
return state;
}

View File

@ -261,6 +261,7 @@ void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_st
xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, boolean decorations)
{
xfWindow* window;
XEvent xevent;
window = (xfWindow*) xzalloc(sizeof(xfWindow));
@ -287,7 +288,10 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height,
if (class_hints != NULL)
{
class_hints->res_name = "xfreerdp";
class_hints->res_class = "xfreerdp";
if (xfi->instance->settings->wm_class != NULL)
class_hints->res_class = xfi->instance->settings->wm_class;
else
class_hints->res_class = "xfreerdp";
XSetClassHint(xfi->display, window->handle, class_hints);
XFree(class_hints);
}
@ -306,8 +310,19 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height,
XChangeProperty(xfi->display, window->handle, xfi->_NET_WM_ICON, XA_CARDINAL, 32,
PropModeReplace, (uint8*) xf_icon_prop, sizeof(xf_icon_prop) / sizeof(long));
if (xfi->parent_window)
XReparentWindow(xfi->display, window->handle, xfi->parent_window, 0, 0);
XSelectInput(xfi->display, window->handle, input_mask);
XMapWindow(xfi->display, window->handle);
//NOTE: This must be done here to handle reparenting the window, so that we dont miss the event and hang waiting for the next one
/* wait for VisibilityNotify */
do
{
XMaskEvent(xfi->display, VisibilityChangeMask, &xevent);
}
while (xevent.type != VisibilityNotify);
}
XStoreName(xfi->display, window->handle, name);
@ -411,14 +426,19 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
if (class_hints != NULL)
{
char* class;
class = xmalloc(sizeof(rail_window_class));
snprintf(class, sizeof(rail_window_class), "RAIL:%08X", id);
char* class = NULL;
if (xfi->instance->settings->wm_class != NULL)
class_hints->res_class = xfi->instance->settings->wm_class;
else {
class = malloc(sizeof(rail_window_class));
snprintf(class, sizeof(rail_window_class), "RAIL:%08X", id);
class_hints->res_class = class;
}
class_hints->res_name = "RAIL";
class_hints->res_class = class;
XSetClassHint(xfi->display, window->handle, class_hints);
XFree(class_hints);
xfree(class);
if (class)
free(class);
}
XSetWMProtocols(xfi->display, window->handle, &(xfi->WM_DELETE_WINDOW), 1);

View File

@ -75,10 +75,11 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-d</term>
<term>-d <replaceable class="parameter">domain</replaceable></term>
<listitem>
<para>
Domain used in authentication.
Set the domain used in authentication to
<replaceable class="parameter">domain</replaceable>.
</para>
</listitem>
</varlistentry>
@ -129,6 +130,14 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Print help.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">id</replaceable></term>
<listitem>
@ -138,10 +147,10 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-m</term>
<term>-K</term>
<listitem>
<para>
Don't send mouse motion events.
Do not interfere with window manager bindings (don't grab keyboard).
</para>
</listitem>
</varlistentry>
@ -200,7 +209,7 @@
<term>-x <replaceable class="parameter">flag</replaceable></term>
<listitem>
<para>
Set the experiance performance flags.
Set the experience performance flags.
<replaceable class="parameter">flag</replaceable> can be one of:
<itemizedlist>
<listitem>
@ -256,6 +265,12 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-X <replaceable class="parameter">xid</replaceable></term>
<listitem>
<para>embed xfreerdp into window with <replaceable class="parameter">xid</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-z</term>
<listitem>
@ -272,14 +287,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--ext</term>
<listitem>
<para>
load an extension
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-auth</term>
<listitem>
@ -288,6 +295,48 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--authonly</term>
<listitem>
<para>
Only authenticates. This is useful to test your credentials (username and password).
Returns status code 0 if the client can connect. Requires a username,
password and connection host at the command line.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-bmp-cache</term>
<listitem>
<para>
Disable bitmap cache.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--certificate-name <replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
use <replaceable class="parameter">name</replaceable> for the logon certificate, instead of the server name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--composition</term>
<listitem>
<para>
Enable composition (RDVH only, not to be confused with remote composition).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--ext <replaceable class="parameter">extname</replaceable></term>
<listitem>
<para>
load extension <replaceable class="parameter">extname</replaceable>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-fastpath</term>
<listitem>
@ -299,10 +348,84 @@
</listitem>
</varlistentry>
<varlistentry>
<term>--gdi</term>
<term>--from-stdin</term>
<listitem>
<para>Prompts for unspecified arguments -u username, -p
password, -d domain and connection host. This is useful to
hide arguments from ps. Also useful for scripts that will
feed these arguments to the client via (what else?) stdin.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-full-window-drag</term>
<listitem>
<para>
GDI rendering backend. <replaceable class="parameter">backend</replaceable> can be either sw (software) or hw (hardware).
Disable full window drag.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--gdi <replaceable class="parameter">backend</replaceable></term>
<listitem>
<para>
GDI (Graphics Device Interface) rendering backend. <replaceable class="parameter">backend</replaceable> can be either sw (software) or hw (hardware).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--help</term>
<listitem>
<para>
Print help.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--ignore-certificate</term>
<listitem>
<para>
ignore verification of logon certificate.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--kbd-list</term>
<listitem>
<para>
list all keyboard layout ids used by -k
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-menu-animations</term>
<listitem>
<para>
Disable menu animations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-motion</term>
<listitem>
<para>
Don't send mouse motion events.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-nla</term>
<listitem>
<para>
Disable network level authentication.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--nsc</term>
<listitem>
<para>
Enable NSCodec.
</para>
</listitem>
</varlistentry>
@ -315,18 +438,150 @@
</listitem>
</varlistentry>
<varlistentry>
<term>--no-bmp-cache</term>
<term>--plugin <replaceable class="parameter">plugin</replaceable> [--data <replaceable class="parameter">data</replaceable> --]</term>
<listitem>
<para>
Disable bitmap cache.
Load one of the following <replaceable class="parameter">plugin</replaceable>:
<variablelist>
<varlistentry>
<term>cliprdr</term>
<listitem>
<para>
Synchronize client and server clipboard data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>drdynvc --data <replaceable class="parameter">subplugin</replaceable> [<replaceable class="parameter">subplugin</replaceable> ...] --</term>
<listitem>
<para>
Enable multimedia redirection.
The <replaceable class="parameter">subplugin</replaceable> must be one of the following:
</para>
<variablelist>
<varlistentry>
<term>audin</term>
<listitem>
<para>
Redirect audio recording device to the server.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>tsmf</term>
<listitem>
<para>
Enable video redirection. The --plugin rdpsnd needs to be enabled as well.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>rdpsnd [--data [<replaceable class="parameter">subplugin</replaceable>] [latency:<replaceable class="parameter">latency</replaceable>] --]</term>
<listitem>
<para>
Enable audio output using one of the following <replaceable class="parameter">subplugin</replaceable> and with a given <replaceable class="parameter">latency</replaceable> in ms:
</para>
<variablelist>
<varlistentry>
<term>alsa</term>
<listitem>
<para>
Use ALSA mixer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>pulse</term>
<listitem>
<para>
Use PulseAudio mixer.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>rail --data <replaceable class="parameter">executable</replaceable>[:<replaceable class="parameter">workingdir</replaceable>[:<replaceable class="parameter">arguments</replaceable>]] --</term>
<listitem>
<para>
Launch one <replaceable class="parameter">executable</replaceable> in a <replaceable class="parameter">workingdir</replaceable> with given <replaceable class="parameter">arguments</replaceable>.
You must use --app before you can use rail.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rdpdbg</term>
<listitem>
<para>
Enable debugging virtual channel.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rdpdr --data <replaceable class="parameter">subplugin</replaceable> [<replaceable class="parameter">subplugin</replaceable> ...] --</term>
<listitem>
<para>
Redirect filesystem devices on your client to the server.
If you want any redirection to work with Windows Server 2012 and newer you must use --plugin rdpsnd before you use any rdpdr options.
The <replaceable class="parameter">subplugin</replaceable> must be one of the following:
</para>
<variablelist>
<varlistentry>
<term>disk:<replaceable class="parameter">name</replaceable>:<replaceable class="parameter">path</replaceable></term>
<listitem>
<para>
Redirect system <replaceable class="parameter">path</replaceable> as disk with <replaceable class="parameter">name</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>scard[:<replaceable class="parameter">name</replaceable>]</term>
<listitem>
<para>
Redirect smartcard with <replaceable class="parameter">name</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>serial:<replaceable class="parameter">port</replaceable>:<replaceable class="parameter">device</replaceable></term>
<listitem>
<para>
Redirect serial <replaceable class="parameter">device</replaceable> (e.g. /dev/ttyS0) to <replaceable class="parameter">port</replaceable> (e.g. COM0).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>parallel:<replaceable class="parameter">port</replaceable>:<replaceable class="parameter">device</replaceable></term>
<listitem>
<para>
Redirect parallel <replaceable class="parameter">device</replaceable> (e.g. /dev/lp0) to <replaceable class="parameter">port</replaceable> (e.g. LPT0).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>printer:<replaceable class="parameter">cupsname</replaceable>:<replaceable class="parameter">drivername</replaceable></term>
<listitem>
<para>
Redirect printer with <replaceable class="parameter">cupsname</replaceable> and <replaceable class="parameter">drivername</replaceable>.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--plugin</term>
<term>--no-rdp</term>
<listitem>
<para>
load a plugin
Disable Standard RDP encryption.
</para>
</listitem>
</varlistentry>
@ -347,74 +602,11 @@
</listitem>
</varlistentry>
<varlistentry>
<term>--nsc</term>
<term>--ntlm <replaceable class="parameter">version</replaceable></term>
<listitem>
<para>
Enable NSCodec.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-wallpaper</term>
<listitem>
<para>
Disable wallpaper.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--composition</term>
<listitem>
<para>
Enable composition (RDVH only, not to be confused with remote composition).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-full-window-drag</term>
<listitem>
<para>
Disable full window drag.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-menu-animations</term>
<listitem>
<para>
Disable menu animations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-theming</term>
<listitem>
<para>
Disable theming.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-rdp</term>
<listitem>
<para>
Disable Standard RDP encryption.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-tls</term>
<listitem>
<para>
Disable TLS encryption.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--no-nla</term>
<listitem>
<para>
Disable network level authentication.
force NTLM protocol version to be <replaceable
class="parameter">version</replaceable>, which can be one of 1 or 2.
</para>
</listitem>
</varlistentry>
@ -427,27 +619,52 @@
</listitem>
</varlistentry>
<varlistentry>
<term>--ntlm</term>
<term>--secure-checksum</term>
<listitem>
<para>
force NTLM protocol version. <replaceable class="parameter">version</replaceable> can be one of 1 or 2.
Use salted checksums with Standard RDP encryption.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--ignore-certificate</term>
<term>--disable-theming</term>
<listitem>
<para>
ignore verification of logon certificate.
Disable theming.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--version</term>
<term>--no-tls</term>
<listitem>
<para>
Disable TLS encryption.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--version</term>
<listitem>
<para>
Print version information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--disable-wallpaper</term>
<listitem>
<para>
Disable wallpaper.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--wm-class <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Set WM_CLASS hint of xfreerdp to <replaceable class="parameter">class</replaceable>. The
resulting hint is then "xfreerdp", "<replaceable class="parameter">class</replaceable>".
</para>
</listitem>
</varlistentry>
</variablelist>

View File

@ -288,8 +288,8 @@ void xf_create_window(xfInfo* xfi)
xfi->attribs.backing_store = xfi->primary ? NotUseful : Always;
xfi->attribs.override_redirect = xfi->fullscreen;
xfi->attribs.colormap = xfi->colormap;
xfi->attribs.bit_gravity = ForgetGravity;
xfi->attribs.win_gravity = StaticGravity;
xfi->attribs.bit_gravity = NorthWestGravity;
xfi->attribs.win_gravity = NorthWestGravity;
if (xfi->instance->settings->window_title != NULL)
{
@ -309,19 +309,9 @@ void xf_create_window(xfInfo* xfi)
xfi->window = xf_CreateDesktopWindow(xfi, win_title, width, height, xfi->decorations);
xfree(win_title);
if (xfi->parent_window)
XReparentWindow(xfi->display, xfi->window->handle, xfi->parent_window, 0, 0);
if (xfi->fullscreen)
xf_SetWindowFullscreen(xfi, xfi->window, xfi->fullscreen);
/* wait for VisibilityNotify */
do
{
XMaskEvent(xfi->display, VisibilityChangeMask, &xevent);
}
while (xevent.type != VisibilityNotify);
xfi->unobscured = (xevent.xvisibility.state == VisibilityUnobscured);
XSetWMProtocols(xfi->display, xfi->window->handle, &(xfi->WM_DELETE_WINDOW), 1);
@ -353,6 +343,7 @@ boolean xf_get_pixmap_info(xfInfo* xfi)
XVisualInfo template;
XPixmapFormatValues* pf;
XPixmapFormatValues* pfs;
XWindowAttributes window_attributes;
pfs = XListPixmapFormats(xfi->display, &pf_count);
@ -379,6 +370,12 @@ boolean xf_get_pixmap_info(xfInfo* xfi)
template.class = TrueColor;
template.screen = xfi->screen_number;
if (XGetWindowAttributes(xfi->display, RootWindowOfScreen(xfi->screen), &window_attributes) == 0)
{
printf("xf_get_pixmap_info: XGetWindowAttributes failed\n");
return false;
}
vis = XGetVisualInfo(xfi->display, VisualClassMask | VisualScreenMask, &template, &vi_count);
if (vis == NULL)
@ -392,7 +389,7 @@ boolean xf_get_pixmap_info(xfInfo* xfi)
{
vi = vis + i;
if (vi->depth == xfi->depth)
if (vi->visual == window_attributes.visual)
{
xfi->visual = vi->visual;
break;
@ -481,6 +478,7 @@ boolean xf_pre_connect(freerdp* instance)
settings->os_major_type = OSMAJORTYPE_UNIX;
settings->os_minor_type = OSMINORTYPE_NATIVE_XSERVER;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;
settings->order_support[NEG_SCRBLT_INDEX] = true;
@ -508,6 +506,21 @@ boolean xf_pre_connect(freerdp* instance)
freerdp_channels_pre_connect(xfi->_context->channels, instance);
if (settings->authentication_only) {
/* Check --authonly has a username and password. */
if (settings->username == NULL ) {
fprintf(stderr, "--authonly, but no -u username. Please provide one.\n");
exit(1);
}
if (settings->password == NULL ) {
fprintf(stderr, "--authonly, but no -p password. Please provide one.\n");
exit(1);
}
fprintf(stderr, "%s:%d: Authentication only. Don't connect to X.\n", __FILE__, __LINE__);
// Avoid XWindows initialization and configuration below.
return true;
}
xfi->display = XOpenDisplay(NULL);
if (xfi->display == NULL)
@ -575,18 +588,26 @@ void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned
{
#ifdef __GNUC__
#if defined(__i386__) || defined(__x86_64__)
*eax = info;
__asm volatile
("mov %%ebx, %%edi;" /* 32bit PIC: don't clobber ebx */
"cpuid;"
"mov %%ebx, %%esi;"
"mov %%edi, %%ebx;"
:"+a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx)
: :"edi");
(
/* The EBX (or RBX register on x86_64) is used for the PIC base address
and must not be corrupted by our inline assembly. */
#if defined(__i386__)
"mov %%ebx, %%esi;"
"cpuid;"
"xchg %%ebx, %%esi;"
#else
"mov %%rbx, %%rsi;"
"cpuid;"
"xchg %%rbx, %%rsi;"
#endif
: "=a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx)
: "0" (info)
);
#endif
#endif
}
uint32 xf_detect_cpu()
{
unsigned int eax, ebx, ecx, edx = 0;
@ -615,6 +636,9 @@ boolean xf_post_connect(freerdp* instance)
cache = instance->context->cache;
channels = xfi->_context->channels;
if (instance->settings->authentication_only)
return true;
if (xf_get_pixmap_info(xfi) != true)
return false;
@ -727,7 +751,7 @@ boolean xf_authenticate(freerdp* instance, char** username, char** password, cha
{
*password = xmalloc(password_size * sizeof(char));
if (freerdp_passphrase_read("Password: ", *password, password_size) == NULL)
if (freerdp_passphrase_read("Password: ", *password, password_size, instance->settings->from_stdin) == NULL)
return false;
return true;
@ -749,6 +773,14 @@ boolean xf_verify_certificate(freerdp* instance, char* subject, char* issuer, ch
{
printf("Do you trust the above certificate? (Y/N) ");
answer = fgetc(stdin);
if (feof(stdin))
{
printf("\nError: Could not read answer from stdin.");
if (instance->settings->from_stdin)
printf(" - Run without parameter \"--from-stdin\" to set trust.");
printf("\n");
return false;
}
if (answer == 'y' || answer == 'Y')
{
@ -947,6 +979,13 @@ int xfreerdp_run(freerdp* instance)
if (!freerdp_connect(instance))
return XF_EXIT_CONN_FAILED;
if (instance->settings->authentication_only)
{
freerdp_disconnect(instance);
freerdp_free(instance);
return ret;
}
xfi = ((xfContext*) instance->context)->xfi;
channels = instance->context->channels;

View File

@ -2,6 +2,7 @@ option(WITH_DEBUG_TRANSPORT "Print transport debug messages." OFF)
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF)
option(WITH_DEBUG_SVC "Print static virtual channel debug messages." OFF)
option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." OFF)
option(WITH_DEBUG_TIMEZONE "Print timezone redirection related messages." OFF)
option(WITH_DEBUG_KBD "Print keyboard related debug messages." OFF)
option(WITH_DEBUG_NLA "Print authentication related debug messages." OFF)
option(WITH_DEBUG_NEGO "Print negotiation related debug messages." OFF)

View File

@ -1,11 +1,12 @@
#ifndef __CONFIG_H
#define __CONFIG_H
#define FREERDP_VERSION "${FREERDP_VERSION}"
#define FREERDP_VERSION_FULL "${FREERDP_VERSION_FULL}"
#define FREERDP_VERSION_MAJOR ${FREERDP_VERSION_MAJOR}
#define FREERDP_VERSION_MINOR ${FREERDP_VERSION_MINOR}
#define FREERDP_VERSION_REVISION ${FREERDP_VERSION_REVISION}
#define FREERDP_VERSION_SUFFIX "${FREERDP_VERSION_SUFFIX}"
#define FREERDP_VERSION "${FREERDP_VERSION}"
#define FREERDP_VERSION_FULL "${FREERDP_VERSION_FULL}"
/* Include files */
#cmakedefine HAVE_SYS_PARAM_H
@ -18,6 +19,8 @@
#cmakedefine HAVE_STDBOOL_H
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_TM_GMTOFF
/* Endian */
#cmakedefine BIG_ENDIAN
@ -26,6 +29,7 @@
#cmakedefine WITH_DEBUG_CHANNELS
#cmakedefine WITH_DEBUG_SVC
#cmakedefine WITH_DEBUG_DVC
#cmakedefine WITH_DEBUG_TIMEZONE
#cmakedefine WITH_DEBUG_KBD
#cmakedefine WITH_DEBUG_NLA
#cmakedefine WITH_DEBUG_NEGO

View File

@ -114,7 +114,7 @@ FREERDP_API uint32 freerdp_error_info(freerdp* instance);
FREERDP_API void freerdp_get_version(int* major, int* minor, int* revision);
FREERDP_API freerdp* freerdp_new();
FREERDP_API freerdp* freerdp_new(void);
FREERDP_API void freerdp_free(freerdp* instance);
#ifdef __cplusplus

View File

@ -23,7 +23,7 @@
#include <freerdp/api.h>
#include <freerdp/gdi/gdi.h>
FREERDP_API HGDI_DC gdi_GetDC();
FREERDP_API HGDI_DC gdi_GetDC(void);
FREERDP_API HGDI_DC gdi_CreateDC(HCLRCONV clrconv, int bpp);
FREERDP_API HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc);
FREERDP_API HGDIOBJECT gdi_SelectObject(HGDI_DC hdc, HGDIOBJECT hgdiobject);

View File

@ -65,6 +65,7 @@
#define GDI_DSPDxax 0x00E20746 /* D = (S & P) | (~S & D) */
#define GDI_SPna 0x000C0324 /* D = S & ~P */
#define GDI_DSna 0x00220326 /* D = D & ~S */
#define GDI_DPa 0x00A000C9 /* D = D & P */
#define GDI_PDxn 0x00A50065 /* D = D ^ ~P */
/* Brush Styles */

View File

@ -24,6 +24,6 @@
#include <freerdp/gdi/gdi.h>
FREERDP_API HGDI_PALETTE gdi_CreatePalette(HGDI_PALETTE palette);
FREERDP_API HGDI_PALETTE gdi_GetSystemPalette();
FREERDP_API HGDI_PALETTE gdi_GetSystemPalette(void);
#endif /* __GDI_PALETTE_H */

View File

@ -230,99 +230,6 @@
#define YORUBA 0x046A
#define ZULU 0x0435
/*
Time zones, taken from Windows Server 2008
(GMT -12:00) International Date Line West
(GMT -11:00) Midway Island, Samoa
(GMT -10:00) Hawaii
(GMT -09:00) Alaska
(GMT -08:00) Pacific Time (US & Canada)
(GMT -08:00) Tijuana, Baja California
(GMT -07:00) Arizona
(GMT -07:00) Chihuahua, La Paz, Mazatlan
(GMT -07:00) Mountain Time (US & Canada)
(GMT -06:00) Central America
(GMT -06:00) Central Time (US & Canada)
(GMT -06:00) Guadalajara, Mexico City, Monterrey
(GMT -06:00) Saskatchewan
(GMT -05:00) Bogota, Lima, Quito, Rio Branco
(GMT -05:00) Eastern Time (US & Canada)
(GMT -05:00) Indiana (East)
(GMT -04:30) Caracas
(GMT -04:00) Atlantic Time (Canada)
(GMT -04:00) La Paz
(GMT -04:00) Manaus
(GMT -04:00) Santiago
(GMT -03:30) Newfoundland
(GMT -03:00) Brasilia
(GMT -03:00) Buenos Aires
(GMT -03:00) Georgetown
(GMT -03:00) Greenland
(GMT -03:00) Montevideo
(GMT -02:00) Mid-Atlantic
(GMT -01:00) Azores
(GMT -01:00) Cape Verde Is.
(GMT +00:00) Casablanca
(GMT +00:00) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London
(GMT +00:00) Monrovia, Reykjavik
(GMT +01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
(GMT +01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
(GMT +01:00) Brussels, Copenhagen, Madrid, Paris
(GMT +01:00) Sarajevo, Skopje, Warsaw, Zagreb
(GMT +01:00) West Central Africa
(GMT +02:00) Amman
(GMT +02:00) Athens, Bucharest, Istanbul
(GMT +02:00) Beirut
(GMT +02:00) Cairo
(GMT +02:00) Harare, Pretoria
(GMT +02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
(GMT +02:00) Jerusalem
(GMT +02:00) Minsk
(GMT +02:00) Windhoek
(GMT +03:00) Baghdad
(GMT +03:00) Kuwait, Riyadh
(GMT +03:00) Moscow, St. Petersburg, Volgograd
(GMT +03:00) Nairobi
(GMT +03:00) Tbilisi
(GMT +03:30) Tehran
(GMT +04:00) Abu Dhabi, Muscat
(GMT +04:00) Baku
(GMT +04:00) Port Louis
(GMT +04:00) Yerevan
(GMT +04:30) Kabul
(GMT +05:00) Ekaterinburg
(GMT +05:00) Islamabad, Karachi
(GMT +05:00) Tashkent
(GMT +05:30) Chennai, Kolkata, Mumbai, New Delhi
(GMT +05:30) Sri Jayawardenepura
(GMT +05:45) Kathmandu
(GMT +06:00) Almaty, Novosibirsk
(GMT +06:00) Astana, Dhaka
(GMT +06:30) Yangon (Rangoon)
(GMT +07:00) Bangkok, Hanoi, Jakarta
(GMT +07:00) Krasnoyarsk
(GMT +08:00) Beijing, Chongqing, Hong Kong, Urumqi
(GMT +08:00) Irkutsk, Ulaan Bataar
(GMT +08:00) Kuala Lumpur, Singapore
(GMT +08:00) Perth
(GMT +08:00) Taipei
(GMT +09:00) Osaka, Sapporo, Tokyo
(GMT +09:00) Seoul
(GMT +09:00) Yakutsk
(GMT +09:30) Adelaide
(GMT +09:30) Darwin
(GMT +10:00) Brisbane
(GMT +10:00) Canberra, Melbourne, Sydney
(GMT +10:00) Guam, Port Moresby
(GMT +10:00) Hobart, Vladivostok
(GMT +11:00) Magadan, Solomon Is., New Caledonia
(GMT +12:00) Auckland, Wellington
(GMT +12:00) Fiji, Kamchatka, Marshall Is.
(GMT +13:00) Nuku'alofa
*/
FREERDP_API uint32 detect_keyboard_layout_from_locale();
FREERDP_API uint32 detect_keyboard_layout_from_locale(void);
#endif /* __LOCALES_H */

View File

@ -434,7 +434,7 @@ static const virtualKey virtualKeyboard[256 + 2] =
{ 0x00, 0, "VK_SEPARATOR" , NULL },
{ 0x4A, 0, "VK_SUBTRACT" , "KPSU" },
{ 0x53, 0, "VK_DECIMAL" , "KPDL" },
{ 0x35, 0, "VK_DIVIDE" , "KPDV" },
{ 0x35, 1, "VK_DIVIDE" , "KPDV" },
{ 0x3B, 0, "VK_F1" , "FK01" },
{ 0x3C, 0, "VK_F2" , "FK02" },
{ 0x3D, 0, "VK_F3" , "FK03" },

View File

@ -270,7 +270,16 @@ struct rdp_settings
boolean compression; /* 59 */
uint32 performance_flags; /* 60 */
rdpBlob* password_cookie; /* 61 */
uint32 paddingC[80 - 62]; /* 62 */
char* kerberos_kdc; /* 62 */
char* kerberos_realm; /* 63 */
boolean ts_gateway; /* 64 */
char* tsg_hostname; /* 65 */
char* tsg_username; /* 66 */
char* tsg_password; /* 67 */
boolean local; /* 68 */
boolean authentication_only; /* 69 */
boolean from_stdin; /* 70 */
uint32 paddingC[80 - 71]; /* 71 */
/* User Interface Parameters */
boolean sw_gdi; /* 80 */
@ -282,7 +291,8 @@ struct rdp_settings
boolean mouse_motion; /* 86 */
char* window_title; /* 87 */
uint64 parent_window_xid; /* 88 */
uint32 paddingD[112 - 89]; /* 89 */
char* wm_class; /* 89 */
uint32 paddingD[112 - 90]; /* 90 */
/* Internal Parameters */
char* home_path; /* 112 */
@ -309,7 +319,9 @@ struct rdp_settings
boolean console_audio; /* 160 */
boolean console_session; /* 161 */
uint32 redirected_session_id; /* 162 */
uint32 paddingG[176 - 163]; /* 163 */
boolean audio_playback; /* 163 */
boolean audio_capture; /* 164 */
uint32 paddingG[176 - 165]; /* 165 */
/* Output Control */
boolean refresh_rect; /* 176 */

View File

@ -26,6 +26,7 @@
#endif
/* Base Types */
#include "config.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>

View File

@ -31,4 +31,6 @@ FREERDP_API char* xstrdup(const char* str);
#define xnew(_type) (_type*)xzalloc(sizeof(_type))
#define ARRAY_SIZE(_x) (sizeof(_x)/sizeof(*(_x)))
#endif /* __MEMORY_UTILS_H */

View File

@ -23,6 +23,6 @@
#include <stdlib.h>
#include <freerdp/api.h>
FREERDP_API char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz);
FREERDP_API char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int from_stdin);
#endif /* __UTILS_PASSPHRASE_H */

View File

@ -42,9 +42,9 @@ FREERDP_API void profiler_free(PROFILER* profiler);
FREERDP_API void profiler_enter(PROFILER* profiler);
FREERDP_API void profiler_exit(PROFILER* profiler);
FREERDP_API void profiler_print_header();
FREERDP_API void profiler_print_header(void);
FREERDP_API void profiler_print(PROFILER* profiler);
FREERDP_API void profiler_print_footer();
FREERDP_API void profiler_print_footer(void);
#ifdef WITH_PROFILER
#define IF_PROFILER(then) then

View File

@ -34,7 +34,7 @@ struct _STOPWATCH
};
typedef struct _STOPWATCH STOPWATCH;
FREERDP_API STOPWATCH* stopwatch_create();
FREERDP_API STOPWATCH* stopwatch_create(void);
FREERDP_API void stopwatch_free(STOPWATCH* stopwatch);
FREERDP_API void stopwatch_start(STOPWATCH* stopwatch);

View File

@ -0,0 +1,36 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Time Utils
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FREERDP_TIME_UTILS_H
#define FREERDP_TIME_UTILS_H
#include <time.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#include <freerdp/api.h>
#include <freerdp/types.h>
FREERDP_API uint64 rdp_windows_gmtime();
FREERDP_API uint64 rdp_get_windows_time_from_unix_time(time_t unix_time);
FREERDP_API time_t rdp_get_unix_time_from_windows_time(uint64 windows_time);
#endif /* FREERDP_TIME_UTILS_H */

View File

@ -45,7 +45,7 @@ struct _UNICONV
};
typedef struct _UNICONV UNICONV;
FREERDP_API UNICONV* freerdp_uniconv_new();
FREERDP_API UNICONV* freerdp_uniconv_new(void);
FREERDP_API void freerdp_uniconv_free(UNICONV *uniconv);
FREERDP_API char* freerdp_uniconv_in(UNICONV *uniconv, unsigned char* pin, size_t in_len);
FREERDP_API char* freerdp_uniconv_out(UNICONV *uniconv, char *str, size_t *pout_len);

View File

@ -162,9 +162,10 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint32 id, uint32 inde
}
if (index == BITMAP_CACHE_WAITING_LIST_INDEX)
index = bitmap_cache->cells[id].number - 1;
if (index > bitmap_cache->cells[id].number)
{
index = bitmap_cache->cells[id].number;
}
else if (index > bitmap_cache->cells[id].number)
{
printf("get invalid bitmap index %d in cell id: %d\n", index, id);
return NULL;
@ -184,9 +185,10 @@ void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index, rdp
}
if (index == BITMAP_CACHE_WAITING_LIST_INDEX)
index = bitmap_cache->cells[id].number - 1;
if (index > bitmap_cache->cells[id].number)
{
index = bitmap_cache->cells[id].number;
}
else if (index > bitmap_cache->cells[id].number)
{
printf("put invalid bitmap index %d in cell id: %d\n", index, id);
return;
@ -244,7 +246,8 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
for (i = 0; i < (int) bitmap_cache->maxCells; i++)
{
bitmap_cache->cells[i].number = settings->bitmapCacheV2CellInfo[i].numEntries;
bitmap_cache->cells[i].entries = (rdpBitmap**) xzalloc(sizeof(rdpBitmap*) * bitmap_cache->cells[i].number);
/* allocate an extra entry for BITMAP_CACHE_WAITING_LIST_INDEX */
bitmap_cache->cells[i].entries = (rdpBitmap**) xzalloc(sizeof(rdpBitmap*) * (bitmap_cache->cells[i].number + 1));
}
}
@ -260,7 +263,7 @@ void bitmap_cache_free(rdpBitmapCache* bitmap_cache)
{
for (i = 0; i < (int) bitmap_cache->maxCells; i++)
{
for (j = 0; j < (int) bitmap_cache->cells[i].number; j++)
for (j = 0; j < (int) bitmap_cache->cells[i].number + 1; j++)
{
bitmap = bitmap_cache->cells[i].entries[j];

View File

@ -437,10 +437,14 @@ static boolean bitmap_decompress4(uint8* srcData, uint8* dstData, int width, int
*/
boolean bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height, int size, int srcBpp, int dstBpp)
{
uint8 * TmpBfr;
if (srcBpp == 16 && dstBpp == 16)
{
RleDecompress16to16(srcData, size, dstData, width * 2, width, height);
freerdp_bitmap_flip(dstData, dstData, width * 2, height);
TmpBfr = (uint8*) xmalloc(width * height * 2);
RleDecompress16to16(srcData, size, TmpBfr, width * 2, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 2, height);
xfree(TmpBfr);
}
else if (srcBpp == 32 && dstBpp == 32)
{
@ -449,18 +453,24 @@ boolean bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height,
}
else if (srcBpp == 15 && dstBpp == 15)
{
RleDecompress16to16(srcData, size, dstData, width * 2, width, height);
freerdp_bitmap_flip(dstData, dstData, width * 2, height);
TmpBfr = (uint8*) xmalloc(width * height * 2);
RleDecompress16to16(srcData, size, TmpBfr, width * 2, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 2, height);
xfree(TmpBfr);
}
else if (srcBpp == 8 && dstBpp == 8)
{
RleDecompress8to8(srcData, size, dstData, width, width, height);
freerdp_bitmap_flip(dstData, dstData, width, height);
TmpBfr = (uint8*) xmalloc(width * height);
RleDecompress8to8(srcData, size, TmpBfr, width, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width, height);
xfree(TmpBfr);
}
else if (srcBpp == 24 && dstBpp == 24)
{
RleDecompress24to24(srcData, size, dstData, width * 3, width, height);
freerdp_bitmap_flip(dstData, dstData, width * 3, height);
TmpBfr = (uint8*) xmalloc(width * height * 3);
RleDecompress24to24(srcData, size, TmpBfr, width * 3, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 3, height);
xfree(TmpBfr);
}
else
{

View File

@ -86,7 +86,7 @@ void freerdp_set_pixel(uint8* data, int x, int y, int width, int height, int bpp
}
}
INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
static INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
{
*red = *green = *blue = 0;
*alpha = (clrconv->alpha) ? 0xFF : 0x00;
@ -137,7 +137,7 @@ INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* g
}
}
INLINE void freerdp_color_split_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
static INLINE void freerdp_color_split_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
{
*red = *green = *blue = 0;
*alpha = (clrconv->alpha) ? 0xFF : 0x00;
@ -188,7 +188,7 @@ INLINE void freerdp_color_split_bgr(uint32* color, int bpp, uint8* red, uint8* g
}
}
INLINE void freerdp_color_make_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
static INLINE void freerdp_color_make_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
{
switch (bpp)
{
@ -229,7 +229,7 @@ INLINE void freerdp_color_make_rgb(uint32* color, int bpp, uint8* red, uint8* gr
}
}
INLINE void freerdp_color_make_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
static INLINE void freerdp_color_make_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
{
switch (bpp)
{
@ -337,17 +337,17 @@ uint32 freerdp_color_convert_var(uint32 srcColor, int srcBpp, int dstBpp, HCLRCO
uint32 freerdp_color_convert_var_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (srcBpp > 16)
return freerdp_color_convert_bgr_rgb(srcColor, srcBpp, 32, clrconv);
return freerdp_color_convert_bgr_rgb(srcColor, srcBpp, dstBpp, clrconv);
else
return freerdp_color_convert_rgb(srcColor, srcBpp, 32, clrconv);
return freerdp_color_convert_rgb(srcColor, srcBpp, dstBpp, clrconv);
}
uint32 freerdp_color_convert_var_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (srcBpp > 16)
return freerdp_color_convert_bgr(srcColor, srcBpp, 32, clrconv);
return freerdp_color_convert_bgr(srcColor, srcBpp, dstBpp, clrconv);
else
return freerdp_color_convert_rgb_bgr(srcColor, srcBpp, 32, clrconv);
return freerdp_color_convert_rgb_bgr(srcColor, srcBpp, dstBpp, clrconv);
}
uint8* freerdp_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)

View File

@ -30,7 +30,7 @@ struct _RFX_POOL
};
typedef struct _RFX_POOL RFX_POOL;
RFX_POOL* rfx_pool_new();
RFX_POOL* rfx_pool_new(void);
void rfx_pool_free(RFX_POOL* pool);
void rfx_pool_put_tile(RFX_POOL* pool, RFX_TILE* tile);
RFX_TILE* rfx_pool_get_tile(RFX_POOL* pool);

View File

@ -63,6 +63,8 @@ set(LIBFREERDP_CORE_SRCS
connection.h
redirection.c
redirection.h
timezone.c
timezone.h
rdp.c
rdp.h
per.c

View File

@ -63,7 +63,7 @@ int ber_write_length(STREAM* s, int length)
int _ber_skip_length(int length)
{
if (length > 0x7F)
if (length > 0x80)
return 3;
else
return 1;
@ -71,7 +71,7 @@ int _ber_skip_length(int length)
int ber_get_content_length(int length)
{
if (length - 1 > 0x7F)
if (length > 0x81)
return length - 4;
else
return length - 2;

View File

@ -1870,14 +1870,13 @@ void rdp_write_demand_active(STREAM* s, rdpSettings* settings)
stream_seek_uint16(s); /* numberCapabilities (2 bytes) */
stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
numberCapabilities = 14;
numberCapabilities = 13;
rdp_write_general_capability_set(s, settings);
rdp_write_bitmap_capability_set(s, settings);
rdp_write_order_capability_set(s, settings);
rdp_write_pointer_capability_set(s, settings);
rdp_write_input_capability_set(s, settings);
rdp_write_virtual_channel_capability_set(s, settings);
rdp_write_bitmap_cache_host_support_capability_set(s, settings);
rdp_write_share_capability_set(s, settings);
rdp_write_font_capability_set(s, settings);
rdp_write_multifragment_update_capability_set(s, settings);
@ -1886,6 +1885,12 @@ void rdp_write_demand_active(STREAM* s, rdpSettings* settings)
rdp_write_surface_commands_capability_set(s, settings);
rdp_write_bitmap_codecs_capability_set(s, settings);
if (settings->persistent_bitmap_cache)
{
numberCapabilities++;
rdp_write_bitmap_cache_host_support_capability_set(s, settings);
}
stream_get_mark(s, em);
stream_set_mark(s, lm); /* go back to lengthCombinedCapabilities */

View File

@ -642,7 +642,22 @@ int certificate_data_match(rdpCertificateStore* certificate_store, rdpCertificat
if (strcmp(pline, certificate_data->fingerprint) == 0)
match = 0;
else
match = -1;
{
if (strlen(pline) == strlen(certificate_data->fingerprint)-3 && strcmp(pline, certificate_data->fingerprint+3) == 0)
{
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("@ WARNING: OLD KEY FORMAT FOUND FOR HOST %s!\n", certificate_data->hostname);
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("Freerdps known_host file format was updated.\n");
printf("The new key is : %s\n", certificate_data->fingerprint);
printf("The old key was : %s\n", pline);
printf("To be secure remove or update the line containing the hostname in ~/.freerdp/known_hosts\n");
printf(" and reconnect\n");
match = 0;
}
else
match = -1;
}
break;
}
}
@ -664,7 +679,7 @@ void certificate_data_print(rdpCertificateStore* certificate_store, rdpCertifica
if (!fp)
return;
fprintf(certificate_store->fp,"%s %s\n", certificate_data->hostname, certificate_data->fingerprint);
fprintf(fp, "%s %s\n", certificate_data->hostname, certificate_data->fingerprint);
fclose(fp);
}

View File

@ -83,7 +83,7 @@ boolean certificate_read_server_proprietary_certificate(rdpCertificate* certific
boolean certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, STREAM* s);
boolean certificate_read_server_certificate(rdpCertificate* certificate, uint8* server_cert, int length);
rdpCertificate* certificate_new();
rdpCertificate* certificate_new(void);
void certificate_free(rdpCertificate* certificate);
rdpKey* key_new(const char *keyfile);

View File

@ -128,6 +128,8 @@ boolean rdp_client_redirect(rdpRdp* rdp)
rdp_client_disconnect(rdp);
rdp_clear_joined_channels(rdp);
mcs_free(rdp->mcs);
nego_free(rdp->nego);
license_free(rdp->license);
@ -343,6 +345,22 @@ boolean rdp_client_connect_mcs_attach_user_confirm(rdpRdp* rdp, STREAM* s)
return true;
}
void rdp_clear_joined_channels(rdpRdp* rdp)
{
int i;
if (rdp->mcs->user_channel_joined)
rdp->mcs->user_channel_joined = false;
if (rdp->mcs->global_channel_joined)
rdp->mcs->global_channel_joined = false;
for (i = 0; i < rdp->settings->num_channels; i++)
{
if (rdp->settings->channels[i].joined)
rdp->settings->channels[i].joined = false;
}
}
boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
{
int i;
@ -489,9 +507,6 @@ boolean rdp_client_connect_finalize(rdpRdp* rdp)
return false;
if (!rdp_send_client_control_pdu(rdp, CTRLACTION_REQUEST_CONTROL))
return false;
rdp->input->SynchronizeEvent(rdp->input, 0);
if (!rdp_send_client_persistent_key_list_pdu(rdp))
return false;
if (!rdp_send_client_font_list_pdu(rdp, FONTLIST_FIRST | FONTLIST_LAST))

View File

@ -50,6 +50,7 @@ boolean rdp_client_connect(rdpRdp* rdp);
boolean rdp_client_redirect(rdpRdp* rdp);
boolean rdp_client_connect_mcs_connect_response(rdpRdp* rdp, STREAM* s);
boolean rdp_client_connect_mcs_attach_user_confirm(rdpRdp* rdp, STREAM* s);
void rdp_clear_joined_channels(rdpRdp* rdp);
boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s);
boolean rdp_client_connect_license(rdpRdp* rdp, STREAM* s);
boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s);

View File

@ -107,6 +107,8 @@ void crypto_des3_decrypt(CryptoDes3 des3, uint32 length, const uint8* in_data, u
void crypto_des3_free(CryptoDes3 des3)
{
if (des3 == NULL)
return;
EVP_CIPHER_CTX_cleanup(&des3->des3_ctx);
xfree(des3);
}
@ -135,6 +137,8 @@ void crypto_hmac_final(CryptoHmac hmac, uint8* out_data, uint32 length)
void crypto_hmac_free(CryptoHmac hmac)
{
if (hmac == NULL)
return;
HMAC_CTX_cleanup(&hmac->hmac_ctx);
xfree(hmac);
}
@ -149,6 +153,8 @@ CryptoCert crypto_cert_read(uint8* data, uint32 length)
void crypto_cert_free(CryptoCert cert)
{
if (cert == NULL)
return;
X509_free(cert->px509);
xfree(cert);
}
@ -343,7 +349,7 @@ char* crypto_cert_fingerprint(X509* xcert)
for (i = 0; i < (int) (fp_len - 1); i++)
{
sprintf(p, "%02x:", fp[i]);
p = &fp_buffer[i * 3];
p = &fp_buffer[(i + 1) * 3];
}
sprintf(p, "%02x", fp[i]);

View File

@ -82,7 +82,7 @@ uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s)
return length;
}
INLINE void fastpath_read_update_header(STREAM* s, uint8* updateCode, uint8* fragmentation, uint8* compression)
static INLINE void fastpath_read_update_header(STREAM* s, uint8* updateCode, uint8* fragmentation, uint8* compression)
{
uint8 updateHeader;
@ -92,7 +92,7 @@ INLINE void fastpath_read_update_header(STREAM* s, uint8* updateCode, uint8* fra
*compression = (updateHeader >> 6) & 0x03;
}
INLINE void fastpath_write_update_header(STREAM* s, uint8 updateCode, uint8 fragmentation, uint8 compression)
static INLINE void fastpath_write_update_header(STREAM* s, uint8 updateCode, uint8 fragmentation, uint8 compression)
{
uint8 updateHeader = 0;
@ -531,9 +531,9 @@ boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s)
rdp = fastpath->rdp;
length = stream_get_length(s);
if (length > 127)
if (length >= (2 << 14))
{
printf("Maximum FastPath PDU length is 127\n");
printf("Maximum FastPath PDU length is 32767\n");
return false;
}
@ -553,23 +553,25 @@ boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s)
* because we can leave room for fixed-length header, store all
* the data first and then store the header.
*/
stream_write_uint16_be(s, 0x8000 | (length + sec_bytes));
stream_write_uint16_be(s, 0x8000 | length);
if (sec_bytes > 0)
{
uint8* ptr;
uint8* fpInputEvents;
uint16 fpInputEvents_length;
ptr = stream_get_tail(s) + sec_bytes;
fpInputEvents = stream_get_tail(s) + sec_bytes;
fpInputEvents_length = length - 3 - sec_bytes;
if (rdp->sec_flags & SEC_SECURE_CHECKSUM)
security_salted_mac_signature(rdp, ptr, length - 3, true, stream_get_tail(s));
security_salted_mac_signature(rdp, fpInputEvents, fpInputEvents_length, true, stream_get_tail(s));
else
security_mac_signature(rdp, ptr, length - 3, stream_get_tail(s));
security_encrypt(ptr, length - 3, rdp);
security_mac_signature(rdp, fpInputEvents, fpInputEvents_length, stream_get_tail(s));
security_encrypt(fpInputEvents, fpInputEvents_length, rdp);
}
rdp->sec_flags = 0;
stream_set_pos(s, length + sec_bytes);
stream_set_pos(s, length);
if (transport_write(fastpath->rdp->transport, s) < 0)
return false;

View File

@ -35,8 +35,6 @@ boolean freerdp_connect(freerdp* instance)
rdp = instance->context->rdp;
extension_pre_connect(rdp->extension);
IFCALLRET(instance->PreConnect, status, instance);
if (status != true)
@ -45,6 +43,9 @@ boolean freerdp_connect(freerdp* instance)
return false;
}
rdp->extension = extension_new(instance);
extension_pre_connect(rdp->extension);
status = rdp_client_connect(rdp);
if (status)
@ -192,11 +193,16 @@ void freerdp_context_new(freerdp* instance)
void freerdp_context_free(freerdp* instance)
{
if (instance->context == NULL)
return;
IFCALL(instance->ContextFree, instance, instance->context);
rdp_free(instance->context->rdp);
graphics_free(instance->context->graphics);
xfree(instance->context);
instance->context = NULL;
}
uint32 freerdp_error_info(freerdp* instance)
@ -219,11 +225,10 @@ freerdp* freerdp_new()
return instance;
}
void freerdp_free(freerdp* freerdp)
void freerdp_free(freerdp* instance)
{
if (freerdp)
if (instance)
{
freerdp_context_free(freerdp);
xfree(freerdp);
xfree(instance);
}
}

View File

@ -17,6 +17,8 @@
* limitations under the License.
*/
#include "timezone.h"
#include "info.h"
#define INFO_TYPE_LOGON 0x00000000
@ -34,182 +36,6 @@ static const char* const INFO_TYPE_LOGON_STRINGS[] =
};
*/
/**
* Read SYSTEM_TIME structure (TS_SYSTEMTIME).\n
* @msdn{cc240478}
* @param s stream
* @param system_time system time structure
*/
void rdp_read_system_time(STREAM* s, SYSTEM_TIME* system_time)
{
stream_read_uint16(s, system_time->wYear); /* wYear, must be set to 0 */
stream_read_uint16(s, system_time->wMonth); /* wMonth */
stream_read_uint16(s, system_time->wDayOfWeek); /* wDayOfWeek */
stream_read_uint16(s, system_time->wDay); /* wDay */
stream_read_uint16(s, system_time->wHour); /* wHour */
stream_read_uint16(s, system_time->wMinute); /* wMinute */
stream_read_uint16(s, system_time->wSecond); /* wSecond */
stream_read_uint16(s, system_time->wMilliseconds); /* wMilliseconds */
}
/**
* Write SYSTEM_TIME structure (TS_SYSTEMTIME).\n
* @msdn{cc240478}
* @param s stream
* @param system_time system time structure
*/
void rdp_write_system_time(STREAM* s, SYSTEM_TIME* system_time)
{
stream_write_uint16(s, system_time->wYear); /* wYear, must be set to 0 */
stream_write_uint16(s, system_time->wMonth); /* wMonth */
stream_write_uint16(s, system_time->wDayOfWeek); /* wDayOfWeek */
stream_write_uint16(s, system_time->wDay); /* wDay */
stream_write_uint16(s, system_time->wHour); /* wHour */
stream_write_uint16(s, system_time->wMinute); /* wMinute */
stream_write_uint16(s, system_time->wSecond); /* wSecond */
stream_write_uint16(s, system_time->wMilliseconds); /* wMilliseconds */
}
/**
* Get client time zone information.\n
* @param s stream
* @param settings settings
*/
void rdp_get_client_time_zone(STREAM* s, rdpSettings* settings)
{
time_t t;
struct tm* local_time;
TIME_ZONE_INFO* clientTimeZone;
time(&t);
local_time = localtime(&t);
clientTimeZone = settings->client_time_zone;
#if defined(sun)
if(local_time->tm_isdst > 0)
clientTimeZone->bias = (uint32) (altzone / 3600);
else
clientTimeZone->bias = (uint32) (timezone / 3600);
#elif defined(HAVE_TM_GMTOFF)
if(local_time->tm_gmtoff >= 0)
clientTimeZone->bias = (uint32) (local_time->tm_gmtoff / 60);
else
clientTimeZone->bias = (uint32) ((-1 * local_time->tm_gmtoff) / 60 + 720);
#else
clientTimeZone->bias = 0;
#endif
if(local_time->tm_isdst > 0)
{
clientTimeZone->standardBias = clientTimeZone->bias - 60;
clientTimeZone->daylightBias = clientTimeZone->bias;
}
else
{
clientTimeZone->standardBias = clientTimeZone->bias;
clientTimeZone->daylightBias = clientTimeZone->bias + 60;
}
strftime(clientTimeZone->standardName, 32, "%Z, Standard Time", local_time);
clientTimeZone->standardName[31] = 0;
strftime(clientTimeZone->daylightName, 32, "%Z, Summer Time", local_time);
clientTimeZone->daylightName[31] = 0;
}
/**
* Read client time zone information (TS_TIME_ZONE_INFORMATION).\n
* @msdn{cc240477}
* @param s stream
* @param settings settings
*/
boolean rdp_read_client_time_zone(STREAM* s, rdpSettings* settings)
{
char* str;
TIME_ZONE_INFO* clientTimeZone;
if (stream_get_left(s) < 172)
return false;
clientTimeZone = settings->client_time_zone;
stream_read_uint32(s, clientTimeZone->bias); /* Bias */
/* standardName (64 bytes) */
str = freerdp_uniconv_in(settings->uniconv, stream_get_tail(s), 64);
stream_seek(s, 64);
strncpy(clientTimeZone->standardName, str, sizeof(clientTimeZone->standardName));
xfree(str);
rdp_read_system_time(s, &clientTimeZone->standardDate); /* StandardDate */
stream_read_uint32(s, clientTimeZone->standardBias); /* StandardBias */
/* daylightName (64 bytes) */
str = freerdp_uniconv_in(settings->uniconv, stream_get_tail(s), 64);
stream_seek(s, 64);
strncpy(clientTimeZone->daylightName, str, sizeof(clientTimeZone->daylightName));
xfree(str);
rdp_read_system_time(s, &clientTimeZone->daylightDate); /* DaylightDate */
stream_read_uint32(s, clientTimeZone->daylightBias); /* DaylightBias */
return true;
}
/**
* Write client time zone information (TS_TIME_ZONE_INFORMATION).\n
* @msdn{cc240477}
* @param s stream
* @param settings settings
*/
void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
{
size_t length;
uint8* standardName;
uint8* daylightName;
size_t standardNameLength;
size_t daylightNameLength;
TIME_ZONE_INFO* clientTimeZone;
rdp_get_client_time_zone(s, settings);
clientTimeZone = settings->client_time_zone;
standardName = (uint8*) freerdp_uniconv_out(settings->uniconv, clientTimeZone->standardName, &length);
standardNameLength = length;
daylightName = (uint8*) freerdp_uniconv_out(settings->uniconv, clientTimeZone->daylightName, &length);
daylightNameLength = length;
if (standardNameLength > 62)
standardNameLength = 62;
if (daylightNameLength > 62)
daylightNameLength = 62;
stream_write_uint32(s, clientTimeZone->bias); /* Bias */
/* standardName (64 bytes) */
stream_write(s, standardName, standardNameLength);
stream_write_zero(s, 64 - standardNameLength);
rdp_write_system_time(s, &clientTimeZone->standardDate); /* StandardDate */
stream_write_uint32(s, clientTimeZone->standardBias); /* StandardBias */
/* daylightName (64 bytes) */
stream_write(s, daylightName, daylightNameLength);
stream_write_zero(s, 64 - daylightNameLength);
rdp_write_system_time(s, &clientTimeZone->daylightDate); /* DaylightDate */
stream_write_uint32(s, clientTimeZone->daylightBias); /* DaylightBias */
xfree(standardName);
xfree(daylightName);
}
/**
* Read Server Auto Reconnect Cookie (ARC_SC_PRIVATE_PACKET).\n
* @msdn{cc240540}
@ -243,10 +69,10 @@ boolean rdp_read_client_auto_reconnect_cookie(STREAM* s, rdpSettings* settings)
if (stream_get_left(s) < 28)
return false;
stream_write_uint32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */
stream_write_uint32(s, autoReconnectCookie->version); /* version (4 bytes) */
stream_write_uint32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */
stream_write(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */
stream_read_uint32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */
stream_read_uint32(s, autoReconnectCookie->version); /* version (4 bytes) */
stream_read_uint32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */
stream_read(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */
return true;
}
@ -473,7 +299,6 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
uint16 cbUserName;
uint8* password;
uint16 cbPassword;
size_t passwordLength;
uint8* alternateShell;
uint16 cbAlternateShell;
uint8* workingDir;
@ -486,8 +311,13 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
INFO_LOGONNOTIFY |
INFO_MAXIMIZESHELL |
INFO_ENABLEWINDOWSKEY |
INFO_DISABLECTRLALTDEL |
RNS_INFO_AUDIOCAPTURE;
INFO_DISABLECTRLALTDEL;
if (settings->audio_capture)
flags |= RNS_INFO_AUDIOCAPTURE;
if (!settings->audio_playback)
flags |= INFO_NOAUDIOPLAYBACK;
if (settings->autologon)
flags |= INFO_AUTOLOGON;
@ -511,13 +341,12 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
{
usedPasswordCookie = true;
password = (uint8*)settings->password_cookie->data;
passwordLength = settings->password_cookie->length;
cbPassword = passwordLength - 2;
cbPassword = settings->password_cookie->length - 2; /* Strip double zero termination */
}
else
{
password = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->password, &passwordLength);
cbPassword = passwordLength;
password = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->password, &length);
cbPassword = length;
}
alternateShell = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->shell, &length);
@ -544,7 +373,7 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
stream_write_uint16(s, 0);
if (cbPassword > 0)
stream_write(s, password, passwordLength);
stream_write(s, password, cbPassword);
stream_write_uint16(s, 0);
if (cbAlternateShell > 0)

View File

@ -166,7 +166,7 @@ void license_generate_hwid(rdpLicense* license);
void license_encrypt_premaster_secret(rdpLicense* license);
void license_decrypt_platform_challenge(rdpLicense* license);
PRODUCT_INFO* license_new_product_info();
PRODUCT_INFO* license_new_product_info(void);
void license_free_product_info(PRODUCT_INFO* productInfo);
void license_read_product_info(STREAM* s, PRODUCT_INFO* productInfo);
@ -175,7 +175,7 @@ void license_free_binary_blob(LICENSE_BLOB* blob);
void license_read_binary_blob(STREAM* s, LICENSE_BLOB* blob);
void license_write_binary_blob(STREAM* s, LICENSE_BLOB* blob);
SCOPE_LIST* license_new_scope_list();
SCOPE_LIST* license_new_scope_list(void);
void license_free_scope_list(SCOPE_LIST* scopeList);
void license_read_scope_list(STREAM* s, SCOPE_LIST* scopeList);

View File

@ -456,7 +456,7 @@ void ntlmssp_compute_lm_hash(char* password, char* hash)
char text[14];
char des_key1[8];
char des_key2[8];
des_key_schedule ks;
DES_key_schedule ks;
/* LM("password") = E52CAC67419A9A224A3B108F3FA6CB6D */
@ -530,7 +530,7 @@ void ntlmssp_compute_lm_response(char* password, char* challenge, char* response
char des_key1[8];
char des_key2[8];
char des_key3[8];
des_key_schedule ks;
DES_key_schedule ks;
/* A LM hash is 16-bytes long, but the LM response uses a LM hash null-padded to 21 bytes */
memset(hash, '\0', 21);

View File

@ -153,7 +153,7 @@ int ntlmssp_decrypt_message(NTLMSSP* ntlmssp, rdpBlob* encrypted_msg, rdpBlob* m
int ntlmssp_recv(NTLMSSP* ntlmssp, STREAM* s);
int ntlmssp_send(NTLMSSP* ntlmssp, STREAM* s);
NTLMSSP* ntlmssp_new();
NTLMSSP* ntlmssp_new(void);
void ntlmssp_init(NTLMSSP* ntlmssp);
void ntlmssp_free(NTLMSSP* ntlmssp);

View File

@ -138,7 +138,7 @@ static const uint8 BMF_BPP[] =
0, 1, 0, 8, 16, 24, 32
};
INLINE void update_read_coord(STREAM* s, sint32* coord, boolean delta)
static INLINE void update_read_coord(STREAM* s, sint32* coord, boolean delta)
{
sint8 lsi8;
sint16 lsi16;
@ -155,7 +155,7 @@ INLINE void update_read_coord(STREAM* s, sint32* coord, boolean delta)
}
}
INLINE void update_read_color(STREAM* s, uint32* color)
static INLINE void update_read_color(STREAM* s, uint32* color)
{
uint8 byte;
@ -167,7 +167,7 @@ INLINE void update_read_color(STREAM* s, uint32* color)
*color |= (byte << 16);
}
INLINE void update_read_colorref(STREAM* s, uint32* color)
static INLINE void update_read_colorref(STREAM* s, uint32* color)
{
uint8 byte;
@ -180,7 +180,7 @@ INLINE void update_read_colorref(STREAM* s, uint32* color)
stream_seek_uint8(s);
}
INLINE void update_read_color_quad(STREAM* s, uint32* color)
static INLINE void update_read_color_quad(STREAM* s, uint32* color)
{
uint8 byte;
@ -193,7 +193,7 @@ INLINE void update_read_color_quad(STREAM* s, uint32* color)
stream_seek_uint8(s);
}
INLINE void update_read_2byte_unsigned(STREAM* s, uint32* value)
static INLINE void update_read_2byte_unsigned(STREAM* s, uint32* value)
{
uint8 byte;
@ -211,7 +211,7 @@ INLINE void update_read_2byte_unsigned(STREAM* s, uint32* value)
}
}
INLINE void update_read_2byte_signed(STREAM* s, sint32* value)
static INLINE void update_read_2byte_signed(STREAM* s, sint32* value)
{
uint8 byte;
boolean negative;
@ -232,7 +232,7 @@ INLINE void update_read_2byte_signed(STREAM* s, sint32* value)
*value *= -1;
}
INLINE void update_read_4byte_unsigned(STREAM* s, uint32* value)
static INLINE void update_read_4byte_unsigned(STREAM* s, uint32* value)
{
uint8 byte;
uint8 count;
@ -276,7 +276,7 @@ INLINE void update_read_4byte_unsigned(STREAM* s, uint32* value)
}
}
INLINE void update_read_delta(STREAM* s, sint32* value)
static INLINE void update_read_delta(STREAM* s, sint32* value)
{
uint8 byte;
@ -294,7 +294,7 @@ INLINE void update_read_delta(STREAM* s, sint32* value)
}
}
INLINE void update_read_glyph_delta(STREAM* s, uint16* value)
static INLINE void update_read_glyph_delta(STREAM* s, uint16* value)
{
uint8 byte;
@ -306,7 +306,7 @@ INLINE void update_read_glyph_delta(STREAM* s, uint16* value)
*value = (byte & 0x3F);
}
INLINE void update_seek_glyph_delta(STREAM* s)
static INLINE void update_seek_glyph_delta(STREAM* s)
{
uint8 byte;
@ -316,7 +316,7 @@ INLINE void update_seek_glyph_delta(STREAM* s)
stream_seek_uint8(s);
}
INLINE void update_read_brush(STREAM* s, rdpBrush* brush, uint8 fieldFlags)
static INLINE void update_read_brush(STREAM* s, rdpBrush* brush, uint8 fieldFlags)
{
if (fieldFlags & ORDER_FIELD_01)
stream_read_uint8(s, brush->x);
@ -354,7 +354,7 @@ INLINE void update_read_brush(STREAM* s, rdpBrush* brush, uint8 fieldFlags)
}
}
INLINE void update_read_delta_rects(STREAM* s, DELTA_RECT* rectangles, int number)
static INLINE void update_read_delta_rects(STREAM* s, DELTA_RECT* rectangles, int number)
{
int i;
uint8 flags = 0;
@ -399,7 +399,7 @@ INLINE void update_read_delta_rects(STREAM* s, DELTA_RECT* rectangles, int numbe
}
}
INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number, sint16 x, sint16 y)
static INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number, sint16 x, sint16 y)
{
int i;
uint8 flags = 0;

View File

@ -642,7 +642,8 @@ boolean rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, uint16 securityFlags)
stream_read(s, wmac, sizeof(wmac));
length -= sizeof(wmac);
security_decrypt(s->p, length, rdp);
if (!security_decrypt(s->p, length, rdp))
return false;
if (securityFlags & SEC_SECURE_CHECKSUM)
security_salted_mac_signature(rdp, s->p, length, false, cmac);
else
@ -858,7 +859,7 @@ void rdp_set_blocking_mode(rdpRdp* rdp, boolean blocking)
int rdp_check_fds(rdpRdp* rdp)
{
return transport_check_fds(rdp->transport);
return transport_check_fds(&(rdp->transport));
}
/**
@ -878,7 +879,7 @@ rdpRdp* rdp_new(freerdp* instance)
rdp->settings = settings_new((void*) instance);
if (instance != NULL)
instance->settings = rdp->settings;
rdp->extension = extension_new(instance);
rdp->transport = transport_new(rdp->settings);
rdp->license = license_new(rdp);
rdp->input = input_new(rdp);
@ -902,6 +903,11 @@ void rdp_free(rdpRdp* rdp)
{
if (rdp != NULL)
{
crypto_rc4_free(rdp->rc4_decrypt_key);
crypto_rc4_free(rdp->rc4_encrypt_key);
crypto_des3_free(rdp->fips_encrypt);
crypto_des3_free(rdp->fips_decrypt);
crypto_hmac_free(rdp->fips_hmac);
extension_free(rdp->extension);
settings_free(rdp->settings);
transport_free(rdp->transport);

View File

@ -136,8 +136,10 @@ struct rdp_rdp
struct rdp_mppc* mppc;
struct crypto_rc4_struct* rc4_decrypt_key;
int decrypt_use_count;
int decrypt_checksum_use_count;
struct crypto_rc4_struct* rc4_encrypt_key;
int encrypt_use_count;
int encrypt_checksum_use_count;
struct crypto_des3_struct* fips_encrypt;
struct crypto_des3_struct* fips_decrypt;
struct crypto_hmac_struct* fips_hmac;

View File

@ -105,7 +105,7 @@ boolean rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s)
if (redirection->flags & LB_PASSWORD)
{
uint32 passwordLength;
stream_read_uint32(s, passwordLength);
stream_read_uint32(s, passwordLength); /* Note: length (hopefully) includes double zero termination */
freerdp_blob_alloc(&redirection->password_cookie, passwordLength);
stream_read(s, redirection->password_cookie.data, passwordLength);

View File

@ -63,7 +63,7 @@ typedef struct rdp_redirection rdpRedirection;
boolean rdp_recv_redirection_packet(rdpRdp* rdp, STREAM* s);
boolean rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, STREAM* s);
rdpRedirection* redirection_new();
rdpRedirection* redirection_new(void);
void redirection_free(rdpRedirection* redirection);
#ifdef WITH_DEBUG_REDIR

View File

@ -262,14 +262,17 @@ void security_salted_mac_signature(rdpRdp *rdp, uint8* data, uint32 length, bool
security_uint32_le(length_le, length); /* length must be little-endian */
if (encryption)
security_uint32_le(use_count_le, rdp->encrypt_use_count);
{
security_uint32_le(use_count_le, rdp->encrypt_checksum_use_count);
}
else
{
/*
* We calculate checksum on plain text, so we must have already
* decrypt it, which means decrypt_use_count is off by one.
* decrypt it, which means decrypt_checksum_use_count is
* off by one.
*/
security_uint32_le(use_count_le, rdp->decrypt_use_count - 1);
security_uint32_le(use_count_le, rdp->decrypt_checksum_use_count - 1);
}
/* SHA1_Digest = SHA1(MACKeyN + pad1 + length + data) */
@ -358,6 +361,9 @@ boolean security_establish_keys(uint8* client_random, rdpRdp* rdp)
printf("FIPS Compliant encryption level.\n");
/* disable fastpath input; it doesnt handle FIPS encryption yet */
rdp->settings->fastpath_input = false;
sha1 = crypto_sha1_init();
crypto_sha1_update(sha1, client_random + 16, 16);
crypto_sha1_update(sha1, server_random + 16, 16);
@ -414,6 +420,10 @@ boolean security_establish_keys(uint8* client_random, rdpRdp* rdp)
memcpy(rdp->decrypt_update_key, rdp->decrypt_key, 16);
memcpy(rdp->encrypt_update_key, rdp->encrypt_key, 16);
rdp->decrypt_use_count = 0;
rdp->decrypt_checksum_use_count = 0;
rdp->encrypt_use_count =0;
rdp->encrypt_checksum_use_count =0;
return true;
}
@ -458,12 +468,16 @@ boolean security_encrypt(uint8* data, int length, rdpRdp* rdp)
rdp->encrypt_use_count = 0;
}
crypto_rc4(rdp->rc4_encrypt_key, length, data, data);
rdp->encrypt_use_count += 1;
rdp->encrypt_use_count++;
rdp->encrypt_checksum_use_count++;
return true;
}
boolean security_decrypt(uint8* data, int length, rdpRdp* rdp)
{
if (rdp->decrypt_key == NULL)
return false;
if (rdp->decrypt_use_count >= 4096)
{
security_key_update(rdp->decrypt_key, rdp->decrypt_update_key, rdp->rc4_key_len);
@ -473,6 +487,7 @@ boolean security_decrypt(uint8* data, int length, rdpRdp* rdp)
}
crypto_rc4(rdp->rc4_decrypt_key, length, data, data);
rdp->decrypt_use_count += 1;
rdp->decrypt_checksum_use_count++;
return true;
}

View File

@ -72,6 +72,8 @@ rdpSettings* settings_new(void* instance)
settings->encryption_level = ENCRYPTION_LEVEL_NONE;
settings->authentication = true;
settings->authentication_only = false;
settings->from_stdin = false;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;

1868
libfreerdp-core/timezone.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Time Zone Redirection
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __TIMEZONE_H
#define __TIMEZONE_H
#include "rdp.h"
#include "config.h"
#include <freerdp/freerdp.h>
#include <freerdp/utils/stream.h>
#include <freerdp/utils/time.h>
void rdp_read_system_time(STREAM* s, SYSTEM_TIME* system_time);
void rdp_write_system_time(STREAM* s, SYSTEM_TIME* system_time);
void rdp_get_client_time_zone(STREAM* s, rdpSettings* settings);
boolean rdp_read_client_time_zone(STREAM* s, rdpSettings* settings);
void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings);
#ifdef WITH_DEBUG_TIMEZONE
#define DEBUG_TIMEZONE(fmt, ...) DEBUG_CLASS(TIMEZONE, fmt, ## __VA_ARGS__)
#else
#define DEBUG_TIMEZONE(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* __TIMEZONE_H */

View File

@ -25,8 +25,9 @@
boolean tls_connect(rdpTls* tls)
{
int connection_status;
int options = 0;
tls->ctx = SSL_CTX_new(TLSv1_client_method());
tls->ctx = SSL_CTX_new(SSLv23_client_method());
if (tls->ctx == NULL)
{
@ -42,7 +43,15 @@ boolean tls_connect(rdpTls* tls)
* block padding is normally used, but the Microsoft TLS implementation
* won't recognize it and will disconnect you after sending a TLS alert.
*/
SSL_CTX_set_options(tls->ctx, SSL_OP_ALL);
options |= SSL_OP_ALL;
/**
* disable SSLv2 and SSLv3
*/
options |= SSL_OP_NO_SSLv2;
options |= SSL_OP_NO_SSLv3;
SSL_CTX_set_options(tls->ctx, options);
tls->ssl = SSL_new(tls->ctx);
@ -73,7 +82,7 @@ boolean tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_fi
{
int connection_status;
tls->ctx = SSL_CTX_new(TLSv1_server_method());
tls->ctx = SSL_CTX_new(SSLv23_server_method());
if (tls->ctx == NULL)
{
@ -81,6 +90,12 @@ boolean tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_fi
return false;
}
/*
* We only want SSLv3 and TLSv1, so disable SSLv2.
* SSLv3 is used by, eg. Microsoft RDC for Mac OS X.
*/
SSL_CTX_set_options(tls->ctx, SSL_OP_NO_SSLv2);
if (SSL_CTX_use_RSAPrivateKey_file(tls->ctx, privatekey_file, SSL_FILETYPE_PEM) <= 0)
{
printf("SSL_CTX_use_RSAPrivateKey_file failed\n");

View File

@ -121,10 +121,12 @@ boolean transport_connect_nla(rdpTransport* transport)
"If credentials are valid, the NTLMSSP implementation may be to blame.\n");
credssp_free(transport->credssp);
transport->credssp = NULL;
return false;
}
credssp_free(transport->credssp);
transport->credssp = NULL;
return true;
}
@ -277,12 +279,13 @@ void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount)
wait_obj_get_fds(transport->recv_event, rfds, rcount);
}
int transport_check_fds(rdpTransport* transport)
int transport_check_fds(rdpTransport** ptransport)
{
int pos;
int status;
uint16 length;
STREAM* received;
rdpTransport* transport = *ptransport;
wait_obj_clear(transport->recv_event);
@ -360,6 +363,9 @@ int transport_check_fds(rdpTransport* transport)
if (status < 0)
return status;
/* transport might now have been freed by rdp_client_redirect and a new rdp->transport created */
transport = *ptransport;
}
return 0;

View File

@ -72,7 +72,7 @@ boolean transport_accept_nla(rdpTransport* transport);
int transport_read(rdpTransport* transport, STREAM* s);
int transport_write(rdpTransport* transport, STREAM* s);
void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount);
int transport_check_fds(rdpTransport* transport);
int transport_check_fds(rdpTransport** ptransport);
boolean transport_set_blocking_mode(rdpTransport* transport, boolean blocking);
rdpTransport* transport_new(rdpSettings* settings);
void transport_free(rdpTransport* transport);

View File

@ -175,6 +175,17 @@ void update_read_pointer_color(STREAM* s, POINTER_COLOR_UPDATE* pointer_color)
stream_read_uint16(s, pointer_color->lengthAndMask); /* lengthAndMask (2 bytes) */
stream_read_uint16(s, pointer_color->lengthXorMask); /* lengthXorMask (2 bytes) */
/**
* There does not seem to be any documentation on why
* xPos / yPos can be larger than width / height
* so it is missing in documentation or a bug in implementation
* 2.2.9.1.1.4.4 Color Pointer Update (TS_COLORPOINTERATTRIBUTE)
*/
if (pointer_color->xPos >= pointer_color->width)
pointer_color->xPos = 0;
if (pointer_color->yPos >= pointer_color->height)
pointer_color->yPos = 0;
if (pointer_color->lengthXorMask > 0)
{
pointer_color->xorMaskData = (uint8*) xmalloc(pointer_color->lengthXorMask);

View File

@ -434,6 +434,31 @@ static int BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth
return 0;
}
static int BitBlt_DPa_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
uint16* dstp;
uint16* patp;
for (y = 0; y < nHeight; y++)
{
dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp & *patp;
dstp++;
}
}
}
return 0;
}
static int BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
@ -778,6 +803,10 @@ int PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
return BitBlt_WHITENESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_DPa:
return BitBlt_DPa_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_PDxn:
return BitBlt_PDxn_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
@ -791,96 +820,96 @@ int PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
return 1;
}
INLINE void SetPixel_BLACK_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_BLACK_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = 0 */
*pixel = 0;
}
INLINE void SetPixel_NOTMERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOTMERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = ~(D | P) */
*pixel = ~(*pixel | *pen);
}
INLINE void SetPixel_MASKNOTPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MASKNOTPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = D & ~P */
*pixel &= ~(*pen);
}
INLINE void SetPixel_NOTCOPYPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOTCOPYPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = ~P */
*pixel = ~(*pen);
}
INLINE void SetPixel_MASKPENNOT_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MASKPENNOT_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = P & ~D */
*pixel = *pen & ~*pixel;
}
INLINE void SetPixel_NOT_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOT_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = ~D */
*pixel = ~(*pixel);
}
INLINE void SetPixel_XORPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_XORPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = D ^ P */
*pixel = *pixel ^ *pen;
}
INLINE void SetPixel_NOTMASKPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOTMASKPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = ~(D & P) */
*pixel = ~(*pixel & *pen);
}
INLINE void SetPixel_MASKPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MASKPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = D & P */
*pixel &= *pen;
}
INLINE void SetPixel_NOTXORPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOTXORPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = ~(D ^ P) */
*pixel = ~(*pixel ^ *pen);
}
INLINE void SetPixel_NOP_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_NOP_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = D */
}
INLINE void SetPixel_MERGENOTPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MERGENOTPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = D | ~P */
*pixel |= ~(*pen);
}
INLINE void SetPixel_COPYPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_COPYPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = P */
*pixel = *pen;
}
INLINE void SetPixel_MERGEPENNOT_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MERGEPENNOT_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = P | ~D */
*pixel = *pen | ~(*pixel);
}
INLINE void SetPixel_MERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_MERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = P | D */
*pixel |= *pen;
}
INLINE void SetPixel_WHITE_16bpp(uint16 *pixel, uint16 *pen)
static INLINE void SetPixel_WHITE_16bpp(uint16 *pixel, uint16 *pen)
{
/* D = 1 */
*pixel = 0xFFFF;

View File

@ -487,6 +487,31 @@ static int BitBlt_DSna_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth
return 0;
}
static int BitBlt_DPa_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
uint32* dstp;
uint32* patp;
for (y = 0; y < nHeight; y++)
{
dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp & *patp;
dstp++;
}
}
}
return 0;
}
static int BitBlt_PDxn_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
@ -807,6 +832,10 @@ int PatBlt_32bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
return BitBlt_WHITENESS_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_DPa:
return BitBlt_DPa_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_PDxn:
return BitBlt_PDxn_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
@ -820,96 +849,96 @@ int PatBlt_32bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
return 1;
}
INLINE void SetPixel_BLACK_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_BLACK_32bpp(uint32* pixel, uint32* pen)
{
/* D = 0 */
*pixel = 0;
}
INLINE void SetPixel_NOTMERGEPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOTMERGEPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = ~(D | P) */
*pixel = ~(*pixel | *pen);
}
INLINE void SetPixel_MASKNOTPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MASKNOTPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = D & ~P */
*pixel &= ~(*pen);
}
INLINE void SetPixel_NOTCOPYPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOTCOPYPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = ~P */
*pixel = ~(*pen);
}
INLINE void SetPixel_MASKPENNOT_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MASKPENNOT_32bpp(uint32* pixel, uint32* pen)
{
/* D = P & ~D */
*pixel = *pen & ~*pixel;
}
INLINE void SetPixel_NOT_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOT_32bpp(uint32* pixel, uint32* pen)
{
/* D = ~D */
*pixel = ~(*pixel);
}
INLINE void SetPixel_XORPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_XORPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = D ^ P */
*pixel = *pixel ^ *pen;
}
INLINE void SetPixel_NOTMASKPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOTMASKPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = ~(D & P) */
*pixel = ~(*pixel & *pen);
}
INLINE void SetPixel_MASKPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MASKPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = D & P */
*pixel &= *pen;
}
INLINE void SetPixel_NOTXORPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOTXORPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = ~(D ^ P) */
*pixel = ~(*pixel ^ *pen);
}
INLINE void SetPixel_NOP_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_NOP_32bpp(uint32* pixel, uint32* pen)
{
/* D = D */
}
INLINE void SetPixel_MERGENOTPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MERGENOTPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = D | ~P */
*pixel |= ~(*pen);
}
INLINE void SetPixel_COPYPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_COPYPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = P */
*pixel = *pen;
}
INLINE void SetPixel_MERGEPENNOT_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MERGEPENNOT_32bpp(uint32* pixel, uint32* pen)
{
/* D = P | ~D */
*pixel = *pen | ~(*pixel);
}
INLINE void SetPixel_MERGEPEN_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_MERGEPEN_32bpp(uint32* pixel, uint32* pen)
{
/* D = P | D */
*pixel |= *pen;
}
INLINE void SetPixel_WHITE_32bpp(uint32* pixel, uint32* pen)
static INLINE void SetPixel_WHITE_32bpp(uint32* pixel, uint32* pen)
{
/* D = 1 */
*pixel = 0xFFFFFF;

View File

@ -339,6 +339,31 @@ static int BitBlt_SPna_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth,
return 0;
}
static int BitBlt_DPa_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
uint8* dstp;
uint8* patp;
for (y = 0; y < nHeight; y++)
{
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
patp = gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp & *patp;
dstp++;
}
}
}
return 0;
}
static int BitBlt_PDxn_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
@ -688,6 +713,10 @@ int PatBlt_8bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, in
return BitBlt_WHITENESS_8bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_DPa:
return BitBlt_DPa_8bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
case GDI_PDxn:
return BitBlt_PDxn_8bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
break;
@ -700,96 +729,96 @@ int PatBlt_8bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, in
return 1;
}
INLINE void SetPixel_BLACK_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_BLACK_8bpp(uint8* pixel, uint8* pen)
{
/* D = 0 */
*pixel = 0;
}
INLINE void SetPixel_NOTMERGEPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOTMERGEPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = ~(D | P) */
*pixel = ~(*pixel | *pen);
}
INLINE void SetPixel_MASKNOTPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MASKNOTPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = D & ~P */
*pixel &= ~(*pen);
}
INLINE void SetPixel_NOTCOPYPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOTCOPYPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = ~P */
*pixel = ~(*pen);
}
INLINE void SetPixel_MASKPENNOT_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MASKPENNOT_8bpp(uint8* pixel, uint8* pen)
{
/* D = P & ~D */
*pixel = *pen & ~*pixel;
}
INLINE void SetPixel_NOT_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOT_8bpp(uint8* pixel, uint8* pen)
{
/* D = ~D */
*pixel = ~(*pixel);
}
INLINE void SetPixel_XORPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_XORPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = D ^ P */
*pixel = *pixel ^ *pen;
}
INLINE void SetPixel_NOTMASKPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOTMASKPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = ~(D & P) */
*pixel = ~(*pixel & *pen);
}
INLINE void SetPixel_MASKPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MASKPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = D & P */
*pixel &= *pen;
}
INLINE void SetPixel_NOTXORPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOTXORPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = ~(D ^ P) */
*pixel = ~(*pixel ^ *pen);
}
INLINE void SetPixel_NOP_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_NOP_8bpp(uint8* pixel, uint8* pen)
{
/* D = D */
}
INLINE void SetPixel_MERGENOTPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MERGENOTPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = D | ~P */
*pixel |= ~(*pen);
}
INLINE void SetPixel_COPYPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_COPYPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = P */
*pixel = *pen;
}
INLINE void SetPixel_MERGEPENNOT_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MERGEPENNOT_8bpp(uint8* pixel, uint8* pen)
{
/* D = P | ~D */
*pixel = *pen | ~(*pixel);
}
INLINE void SetPixel_MERGEPEN_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_MERGEPEN_8bpp(uint8* pixel, uint8* pen)
{
/* D = P | D */
*pixel |= *pen;
}
INLINE void SetPixel_WHITE_8bpp(uint8* pixel, uint8* pen)
static INLINE void SetPixel_WHITE_8bpp(uint8* pixel, uint8* pen)
{
/* D = 1 */
*pixel = 0xFF;

View File

@ -628,7 +628,27 @@ void gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
void gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
{
printf("Mem3Blt\n");
}
void gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
{
printf("PolygonSC\n");
}
void gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
{
printf("PolygonCB\n");
}
void gdi_ellipse_sc(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc)
{
printf("EllipseSC\n");
}
void gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
{
printf("EllipseCB\n");
}
int tilenum = 0;
@ -776,10 +796,10 @@ void gdi_register_update_callbacks(rdpUpdate* update)
primary->GlyphIndex = NULL;
primary->FastIndex = NULL;
primary->FastGlyph = NULL;
primary->PolygonSC = NULL;
primary->PolygonCB = NULL;
primary->EllipseSC = NULL;
primary->EllipseCB = NULL;
primary->PolygonSC = gdi_polygon_sc;
primary->PolygonCB = gdi_polygon_cb;
primary->EllipseSC = gdi_ellipse_sc;
primary->EllipseCB = gdi_ellipse_cb;
update->SurfaceBits = gdi_surface_bits;
}

View File

@ -46,6 +46,7 @@ set(FREERDP_UTILS_SRCS
string.c
svc_plugin.c
thread.c
time.c
unicode.c
wait_obj.c)

View File

@ -22,10 +22,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <freerdp/settings.h>
#include <freerdp/utils/print.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/args.h>
#include <freerdp/utils/passphrase.h>
void freerdp_parse_hostname(rdpSettings* settings, char* hostname) {
char* p;
if (hostname[0] == '[' && (p = strchr(hostname, ']'))
&& (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':')))) {
/* Either "[...]" or "[...]:..." with at most one : after the brackets */
settings->hostname = xstrdup(hostname + 1);
if ((p = strchr((char*)settings->hostname, ']'))) {
*p = 0;
if (p[1] == ':')
settings->port = atoi(p + 2);
}
} else {
/* Port number is cut off and used if exactly one : in the string */
settings->hostname = xstrdup(hostname);
if ((p = strchr((char*)settings->hostname, ':')) && !strchr(p + 1, ':')) {
*p = 0;
settings->port = atoi(p + 1);
}
}
}
/**
* Parse command-line arguments and update rdpSettings members accordingly.
@ -59,8 +85,8 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
"\n"
"Usage: %s [options] server:port\n"
" -0: connect to console session\n"
" -a: set color depth in bit, default is 16\n"
" -c: initial working directory\n"
" -a: set color depth in bits, default is 16\n"
" -c: shell working directory\n"
" -D: hide window decorations\n"
" -T: window title\n"
" -d: domain\n"
@ -68,22 +94,25 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
" -g: set geometry, using format WxH or X%% or 'workarea', default is 1024x768\n"
" -h: print this help\n"
" -k: set keyboard layout ID\n"
" -K: do not interfere with window manager bindings\n"
" -m: don't send mouse motion events\n"
" -K: do not interfere with window manager bindings (don't grab keyboard)\n"
" -n: hostname\n"
" -o: console audio\n"
" -p: password\n"
" -s: set startup-shell\n"
" -t: alternative port number, default is 3389\n"
" -u: username\n"
" -x: performance flags (m[odem], b[roadband] or l[an])\n"
" -x: performance flags (m[odem], b[roadband] l[an], or a bit-mask)\n"
" -X: embed into another window with a given XID.\n"
" -z: enable compression\n"
" --app: RemoteApp connection. This implies -g workarea\n"
" --ext: load an extension\n"
" --no-auth: disable authentication\n"
" --authonly: authentication only, no UI\n"
" --from-stdin: unspecified username, password, domain and hostname params are prompted\n"
" --help: print this help\n"
" --no-fastpath: disable fast-path\n"
" --gdi: graphics rendering (hw, sw)\n"
" --no-motion: don't send mouse motion events\n"
" --no-osb: disable offscreen bitmaps\n"
" --no-bmp-cache: disable bitmap cache\n"
" --plugin: load a virtual channel plugin\n"
@ -95,13 +124,16 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
" --disable-full-window-drag: disables full window drag\n"
" --disable-menu-animations: disables menu animations\n"
" --disable-theming: disables theming\n"
" --kbd-list: list all keyboard layout ids used by -k\n"
" --no-rdp: disable Standard RDP encryption\n"
" --no-tls: disable TLS encryption\n"
" --no-nla: disable network level authentication\n"
" --ntlm: force NTLM authentication protocol version (1 or 2)\n"
" --certificate-name: use the argument as the logon certificate, instead of the server name\n"
" --ignore-certificate: ignore verification of logon certificate\n"
" --sec: force protocol security (rdp, tls or nla)\n"
" --secure-checksum: use salted checksums with Standard RDP encryption\n"
" --wm-class: set window WM_CLASS hint\n"
" --version: print version information\n"
"\n", argv[0]);
return FREERDP_ARGS_PARSE_HELP; //TODO: What is the correct return
@ -302,6 +334,14 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
{
settings->authentication = false;
}
else if (strcmp("--authonly", argv[index]) == 0)
{
settings->authentication_only = true;
}
else if (strcmp("--from-stdin", argv[index]) == 0)
{
settings->from_stdin = true;
}
else if (strcmp("--ignore-certificate", argv[index]) == 0)
{
settings->ignore_certificate = true;
@ -477,7 +517,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
return FREERDP_ARGS_PARSE_FAILURE;
}
settings->parent_window_xid = strtoul(argv[index], NULL, 16);
settings->parent_window_xid = strtol(argv[index], NULL, 0);
if (settings->parent_window_xid == 0)
{
@ -542,6 +582,8 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
return FREERDP_ARGS_PARSE_FAILURE;
}
plugin_data = NULL;
if (strstr(argv[t], "rdpsnd"))
settings->audio_playback = true;
if (index < argc - 1 && strcmp("--data", argv[index + 1]) == 0)
{
index += 2;
@ -553,6 +595,9 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
else
plugin_data = (RDP_PLUGIN_DATA*) xrealloc(plugin_data, sizeof(RDP_PLUGIN_DATA) * (i + 2));
if (strstr(argv[t], "drdynvc") && strstr(argv[index], "audin"))
settings->audio_capture = true;
plugin_data[i].size = sizeof(RDP_PLUGIN_DATA);
plugin_data[i].data[0] = NULL;
plugin_data[i].data[1] = NULL;
@ -621,35 +666,28 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
{
settings->secure_checksum = true;
}
else if (strcmp("--wm-class", argv[index]) == 0)
{
index++;
if (index == argc)
{
printf("missing WM_CLASS value\n");
return -1;
}
settings->wm_class = xstrdup(argv[index]);
}
else if (strcmp("--version", argv[index]) == 0)
{
printf("This is FreeRDP version %s\n", FREERDP_VERSION_FULL);
if (strlen(FREERDP_VERSION_SUFFIX))
printf("This is FreeRDP version %s-%s\n", FREERDP_VERSION_FULL, FREERDP_VERSION_SUFFIX);
else
printf("This is FreeRDP version %s\n", FREERDP_VERSION_FULL);
return FREERDP_ARGS_PARSE_VERSION;
}
else if (argv[index][0] != '-')
{
if (argv[index][0] == '[' && (p = strchr(argv[index], ']'))
&& (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':'))))
{
/* Either "[...]" or "[...]:..." with at most one : after the brackets */
settings->hostname = xstrdup(argv[index] + 1);
if ((p = strchr((char*)settings->hostname, ']')))
{
*p = 0;
if (p[1] == ':')
settings->port = atoi(p + 2);
}
}
else
{
/* Port number is cut off and used if exactly one : in the string */
settings->hostname = xstrdup(argv[index]);
if ((p = strchr((char*)settings->hostname, ':')) && !strchr(p + 1, ':'))
{
*p = 0;
settings->port = atoi(p + 1);
}
}
freerdp_parse_hostname(settings, argv[index]);
/* server is the last argument for the current session. arguments
followed will be parsed for the next session. */
index++;
@ -672,7 +710,8 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
if (settings->disable_theming)
settings->performance_flags |= PERF_DISABLE_THEMING;
return index;
break; /* post process missing arguments */
}
else
{
@ -690,6 +729,86 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
}
index++;
}
printf("missing server name\n");
return FREERDP_ARGS_PARSE_FAILURE;
/* --from-stdin will prompt for missing arguments only.
You can prompt for username, password, domain and hostname to avoid disclosing
these settings to ps. */
if (settings->from_stdin)
{
/* username */
if (NULL == settings->username)
{
char input[512];
input[0] = '\0';
printf("username: ");
if (scanf("%511s%*c", input) > 0)
{
settings->username = xstrdup(input);
}
}
/* password */
if (NULL == settings->password)
{
settings->password = xmalloc(512 * sizeof(char));
if (isatty(STDIN_FILENO))
{
freerdp_passphrase_read("password: ", settings->password, 512, settings->from_stdin);
}
else
{
printf("password: ");
if (scanf("%511s%*c", settings->password) <= 0)
{
free(settings->password);
settings->password = NULL;
}
}
}
/* domain */
if (NULL == settings->domain)
{
char input[512];
input[0] = '\0';
printf("domain (control-D to skip): ");
if (scanf("%511s%*c", input) > 0)
{
/* Try to catch the cases where the string is NULL-ish right
at the get go */
if (input[0] != '\0' && !(input[0] == '.' && input[1] == '\0'))
{
settings->domain = xstrdup(input);
}
}
if (feof(stdin))
{
printf("\n");
clearerr(stdin);
}
}
/* hostname */
if (NULL == settings->hostname)
{
char input[512];
input[0] = '\0';
printf("hostname: ");
if (scanf("%511s%*c", input) > 0)
{
freerdp_parse_hostname(settings, input);
}
}
}
/* Must have a hostname. Do you? */
if (NULL == settings->hostname)
{
printf("missing server name\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
else
{
return index;
}
}

View File

@ -82,6 +82,8 @@ char* freerdp_get_home_path(rdpSettings* settings)
{
if (settings->home_path == NULL)
settings->home_path = getenv(HOME_ENV_VARIABLE);
if (settings->home_path == NULL)
settings->home_path = xstrdup("/");
return settings->home_path;
}

View File

@ -20,7 +20,7 @@
#include <errno.h>
#include <freerdp/utils/passphrase.h>
#ifdef _WIN32
char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz)
char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int from_stdin)
{
errno=ENOSYS;
return NULL;
@ -34,7 +34,7 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz)
#include <unistd.h>
#include <freerdp/utils/signal.h>
char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz)
char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int from_stdin)
{
char read_char;
char* buf_iter;
@ -50,7 +50,7 @@ char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz)
}
ctermid(term_name);
if(strcmp(term_name, "") == 0
if(from_stdin || strcmp(term_name, "") == 0
|| (term_file = open(term_name, O_RDWR)) == -1)
{
write_file = STDERR_FILENO;

View File

@ -140,13 +140,6 @@ void registry_init(rdpRegistry* registry)
registry->available = true;
if (home_path == NULL)
{
printf("could not get home path\n");
registry->available = false;
return;
}
registry->home = (char*) xstrdup(home_path);
printf("home path: %s\n", registry->home);

View File

@ -144,6 +144,15 @@ static void svc_plugin_process_received(rdpSvcPlugin* plugin, void* pData, uint3
{
STREAM* data_in;
svc_data_in_item* item;
if ( (dataFlags & CHANNEL_FLAG_SUSPEND) || (dataFlags & CHANNEL_FLAG_RESUME))
{
/* According to MS-RDPBCGR 2.2.6.1, "All virtual channel traffic MUST be suspended.
This flag is only valid in server-to-client virtual channel traffic. It MUST be
ignored in client-to-server data." Thus it would be best practice to cease data
transmission. However, simply returing here avoids a crash. */
return;
}
if (dataFlags & CHANNEL_FLAG_FIRST)
{

45
libfreerdp-utils/time.c Normal file
View File

@ -0,0 +1,45 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Time Utils
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <freerdp/utils/time.h>
uint64 rdp_windows_gmtime()
{
time_t unix_time;
uint64 windows_time;
time(&unix_time);
windows_time = rdp_get_windows_time_from_unix_time(unix_time);
return windows_time;
}
uint64 rdp_get_windows_time_from_unix_time(time_t unix_time)
{
uint64 windows_time;
windows_time = ((uint64)unix_time * 10000000) + 621355968000000000ULL;
return windows_time;
}
time_t rdp_get_unix_time_from_windows_time(uint64 windows_time)
{
time_t unix_time;
unix_time = (windows_time - 621355968000000000ULL) / 10000000;
return unix_time;
}

247
scripts/TimeZones.cs Normal file
View File

@ -0,0 +1,247 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Time Zone Redirection Table Generator
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.IO;
using System.Globalization;
using System.Collections.ObjectModel;
namespace TimeZones
{
struct SYSTEM_TIME_ENTRY
{
public UInt16 wYear;
public UInt16 wMonth;
public UInt16 wDayOfWeek;
public UInt16 wDay;
public UInt16 wHour;
public UInt16 wMinute;
public UInt16 wSecond;
public UInt16 wMilliseconds;
};
struct TIME_ZONE_RULE_ENTRY
{
public long TicksStart;
public long TicksEnd;
public Int32 DaylightDelta;
public SYSTEM_TIME_ENTRY StandardDate;
public SYSTEM_TIME_ENTRY DaylightDate;
};
struct TIME_ZONE_ENTRY
{
public string Id;
public UInt32 Bias;
public bool SupportsDST;
public string DisplayName;
public string StandardName;
public string DaylightName;
public string RuleTable;
public UInt32 RuleTableCount;
};
class TimeZones
{
static void Main(string[] args)
{
int i;
UInt32 index;
const string file = @"TimeZones.txt";
TimeZoneInfo.AdjustmentRule[] rules;
StreamWriter stream = new StreamWriter(file, false);
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
stream.WriteLine();
stream.WriteLine("struct _SYSTEM_TIME_ENTRY");
stream.WriteLine("{");
stream.WriteLine("\tuint16 wYear;");
stream.WriteLine("\tuint16 wMonth;");
stream.WriteLine("\tuint16 wDayOfWeek;");
stream.WriteLine("\tuint16 wDay;");
stream.WriteLine("\tuint16 wHour;");
stream.WriteLine("\tuint16 wMinute;");
stream.WriteLine("\tuint16 wSecond;");
stream.WriteLine("\tuint16 wMilliseconds;");
stream.WriteLine("};");
stream.WriteLine("typedef struct _SYSTEM_TIME_ENTRY SYSTEM_TIME_ENTRY;");
stream.WriteLine();
stream.WriteLine("struct _TIME_ZONE_RULE_ENTRY");
stream.WriteLine("{");
stream.WriteLine("\tuint64 TicksStart;");
stream.WriteLine("\tuint64 TicksEnd;");
stream.WriteLine("\tsint32 DaylightDelta;");
stream.WriteLine("\tSYSTEM_TIME_ENTRY StandardDate;");
stream.WriteLine("\tSYSTEM_TIME_ENTRY DaylightDate;");
stream.WriteLine("};");
stream.WriteLine("typedef struct _TIME_ZONE_RULE_ENTRY TIME_ZONE_RULE_ENTRY;");
stream.WriteLine();
stream.WriteLine("struct _TIME_ZONE_ENTRY");
stream.WriteLine("{");
stream.WriteLine("\tconst char* Id;");
stream.WriteLine("\tuint32 Bias;");
stream.WriteLine("\tboolean SupportsDST;");
stream.WriteLine("\tconst char* DisplayName;");
stream.WriteLine("\tconst char* StandardName;");
stream.WriteLine("\tconst char* DaylightName;");
stream.WriteLine("\tTIME_ZONE_RULE_ENTRY* RuleTable;");
stream.WriteLine("\tuint32 RuleTableCount;");
stream.WriteLine("};");
stream.WriteLine("typedef struct _TIME_ZONE_ENTRY TIME_ZONE_ENTRY;");
stream.WriteLine();
index = 0;
foreach (TimeZoneInfo timeZone in timeZones)
{
rules = timeZone.GetAdjustmentRules();
if ((!timeZone.SupportsDaylightSavingTime) || (rules.Length < 1))
{
index++;
continue;
}
stream.WriteLine("static const TIME_ZONE_RULE_ENTRY TimeZoneRuleTable_{0}[] =", index);
stream.WriteLine("{");
i = 0;
foreach (TimeZoneInfo.AdjustmentRule rule in rules)
{
DateTime time;
TIME_ZONE_RULE_ENTRY tzr;
TimeZoneInfo.TransitionTime transition;
tzr.TicksStart = rule.DateEnd.ToUniversalTime().Ticks;
tzr.TicksEnd = rule.DateStart.ToUniversalTime().Ticks;
tzr.DaylightDelta = (Int32)rule.DaylightDelta.TotalMinutes;
transition = rule.DaylightTransitionEnd;
time = transition.TimeOfDay;
tzr.StandardDate.wYear = (UInt16)0;
tzr.StandardDate.wMonth = (UInt16)transition.Month;
tzr.StandardDate.wDayOfWeek = (UInt16)transition.DayOfWeek;
tzr.StandardDate.wDay = (UInt16)transition.Day;
tzr.StandardDate.wHour = (UInt16)time.Hour;
tzr.StandardDate.wMinute = (UInt16)time.Minute;
tzr.StandardDate.wSecond = (UInt16)time.Second;
tzr.StandardDate.wMilliseconds = (UInt16)time.Millisecond;
transition = rule.DaylightTransitionStart;
time = transition.TimeOfDay;
tzr.DaylightDate.wYear = (UInt16)0;
tzr.DaylightDate.wMonth = (UInt16)transition.Month;
tzr.DaylightDate.wDayOfWeek = (UInt16)transition.DayOfWeek;
tzr.DaylightDate.wDay = (UInt16)transition.Day;
tzr.DaylightDate.wHour = (UInt16)time.Hour;
tzr.DaylightDate.wMinute = (UInt16)time.Minute;
tzr.DaylightDate.wSecond = (UInt16)time.Second;
tzr.DaylightDate.wMilliseconds = (UInt16)time.Millisecond;
stream.Write("\t{");
stream.Write(" {0}, {1}, {2},", tzr.TicksStart, tzr.TicksEnd, tzr.DaylightDelta);
stream.Write(" { ");
stream.Write("{0}, {1}, {2}, {3}, {4}, {5}",
tzr.StandardDate.wYear, tzr.StandardDate.wMonth, tzr.StandardDate.wDayOfWeek,
tzr.StandardDate.wDay, tzr.StandardDate.wHour, tzr.StandardDate.wMinute,
tzr.StandardDate.wSecond, tzr.StandardDate.wMilliseconds);
stream.Write(" }, ");
stream.Write("{ ");
stream.Write("{0}, {1}, {2}, {3}, {4}, {5}",
tzr.DaylightDate.wYear, tzr.DaylightDate.wMonth, tzr.DaylightDate.wDayOfWeek,
tzr.DaylightDate.wDay, tzr.DaylightDate.wHour, tzr.DaylightDate.wMinute,
tzr.DaylightDate.wSecond, tzr.DaylightDate.wMilliseconds);
stream.Write(" },");
if (++i < rules.Length)
stream.WriteLine(" },");
else
stream.WriteLine(" }");
}
stream.WriteLine("};");
stream.WriteLine();
index++;
}
index = 0;
stream.WriteLine("static const TIME_ZONE_ENTRY TimeZoneTable[] =");
stream.WriteLine("{");
foreach (TimeZoneInfo timeZone in timeZones)
{
TIME_ZONE_ENTRY tz;
TimeSpan offset = timeZone.BaseUtcOffset;
rules = timeZone.GetAdjustmentRules();
tz.Id = timeZone.Id;
if (offset.Hours >= 0)
tz.Bias = (UInt32)((offset.Hours * 60) + offset.Minutes);
else
tz.Bias = (UInt32)(((-1 * offset.Hours) * 60) + offset.Minutes + 720);
tz.SupportsDST = timeZone.SupportsDaylightSavingTime;
tz.DisplayName = timeZone.DisplayName;
tz.StandardName = timeZone.StandardName;
tz.DaylightName = timeZone.DaylightName;
if ((!tz.SupportsDST) || (rules.Length < 1))
{
tz.RuleTableCount = 0;
tz.RuleTable = "NULL";
}
else
{
tz.RuleTableCount = (UInt32)rules.Length;
tz.RuleTable = "&TimeZoneRuleTable_" + index;
tz.RuleTable = "(TIME_ZONE_RULE_ENTRY*) &TimeZoneRuleTable_" + index;
}
stream.WriteLine("\t{");
stream.WriteLine("\t\t\"{0}\", {1}, {2}, \"{0}\",",
tz.Id, tz.Bias, tz.SupportsDST ? "true" : "false", tz.DisplayName);
stream.WriteLine("\t\t\"{0}\", \"{0}\",", tz.StandardName, tz.DaylightName);
stream.WriteLine("\t\t{0}, {1}", tz.RuleTable, tz.RuleTableCount);
index++;
if ((int) index < timeZones.Count)
stream.WriteLine("\t},");
else
stream.WriteLine("\t}");
}
stream.WriteLine("};");
stream.WriteLine();
stream.Close();
}
}
}

90
scripts/WindowsZones.cs Normal file
View File

@ -0,0 +1,90 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* TZID to Windows TimeZone Identifier Table Generator
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Collections;
using System.Collections.Generic;
/*
* this script uses windowsZones.xml which can be obtained at:
* http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
*/
namespace WindowsZones
{
class MainClass
{
public static void Main(string[] args)
{
string tzid, windows;
const string file = @"WindowsZones.txt";
List<string> list = new List<string>();
StreamWriter stream = new StreamWriter(file, false);
XmlTextReader reader = new XmlTextReader(@"windowsZones.xml");
stream.WriteLine("struct _WINDOWS_TZID_ENTRY");
stream.WriteLine("{");
stream.WriteLine("\tconst char* windows;");
stream.WriteLine("\tconst char* tzid;");
stream.WriteLine("};");
stream.WriteLine("typedef struct _WINDOWS_TZID_ENTRY WINDOWS_TZID_ENTRY;");
stream.WriteLine();
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
if (reader.Name.Equals("mapZone"))
{
tzid = reader.GetAttribute("type");
windows = reader.GetAttribute("other");
string entry = String.Format("\"{0}\", \"{1}\"", windows, tzid);
if (!list.Contains(entry))
list.Add(entry);
}
break;
}
}
list.Sort();
stream.WriteLine("const WINDOWS_TZID_ENTRY WindowsTimeZoneIdTable[] =");
stream.WriteLine("{");
foreach (string entry in list)
{
stream.Write("\t{ ");
stream.Write(entry);
stream.WriteLine(" },");
}
stream.WriteLine("};");
stream.Close();
}
}
}

View File

@ -86,9 +86,9 @@ void xf_event_push(xfEventQueue* event_queue, xfEvent* event)
event_queue->events[(event_queue->count)++] = event;
xf_set_event(event_queue);
pthread_mutex_unlock(&(event_queue->mutex));
xf_set_event(event_queue);
}
xfEvent* xf_event_peek(xfEventQueue* event_queue)

View File

@ -69,7 +69,7 @@ void xf_event_region_free(xfEventRegion* event_region);
xfEvent* xf_event_new(int type);
void xf_event_free(xfEvent* event);
xfEventQueue* xf_event_queue_new();
xfEventQueue* xf_event_queue_new(void);
void xf_event_queue_free(xfEventQueue* event_queue);
#endif /* __XF_EVENT_H */

View File

@ -624,6 +624,7 @@ void* xf_peer_main_loop(void* arg)
settings->cert_file = freerdp_construct_path(server_file_path, "server.crt");
settings->privatekey_file = freerdp_construct_path(server_file_path, "server.key");
settings->rdp_key_file = freerdp_construct_path(server_file_path, "server.key");
settings->nla_security = false;
settings->rfx_codec = true;