For future GFX channel functions an image scaling function is required.
This moves the implementation from wayland client to core library
and adds support for the much faster SWScale library.
Clipboard formats containing plain text are specified to be terminated
by a \0 character in MS's documentation on standard clipboard formats:
https://docs.microsoft.com/en-us/windows/desktop/dataxchg/standard-clipboard-formats
xf_cliprdr_server_format_data_response receives pasted data from the
server to transfer to the client, in a sufficiently raw form that the
\0 terminator is still present, so it has to remove it. It does so by
checking only at the very end of the data. But I've observed that when
pasting out of at least one Windows program (namely Outlook 1903 on
Windows 10), the intended paste data arrives in this function followed
by \0 and then a spurious \n. In that situation the null-terminator
removal will fail to notice the \0, and will leave both bogus
characters on the end of the paste.
Fixed by using memchr to find the _first_ \0 in the paste data, which
should not lose any actually intentional data because it's in
accordance with the spec above.
found by cppcheck
[client/Windows/wf_event.c:464] -> [client/Windows/wf_event.c:468]: (warning) Variable 'xNewPos' is reassigned a value before the old one has been used. 'break;' missing?
The file clipboard delegate needs a base URI to operate on for
systems that are not WIN32. Added that to the context and abort
conversion, if that is not set. (currently not fully implemented)
found by cppcheck
[client/Wayland/wlf_cliprdr.c:143] -> [client/Wayland/wlf_cliprdr.c:158]: (warning) Either the condition 'clipboard' is redundant or there is possible null pointer dereference: clipboard.
[client/Wayland/wlf_cliprdr.c:163] -> [client/Wayland/wlf_cliprdr.c:178]: (warning) Either the condition 'clipboard' is redundant or there is possible null pointer dereference: clipboard.
The wayland buffer size always matches the current window size.
That might be different from the actual remote framebuffer size,
to when copying always use the correct strides to avoid distorted
screen content.
found by cppcheck
[client/Windows/wf_cliprdr.c:2556] -> [client/Windows/wf_cliprdr.c:2561]: (warning) Identical condition '!clipboard', second condition is always false
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:796]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:797]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:798]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[libfreerdp/codec/dsp.c:1156] -> [libfreerdp/codec/dsp.c:1154]: (warning) Either the condition '!srcFormat' is redundant or there is possible null pointer dereference: srcFormat.
[channels/drdynvc/client/drdynvc_main.c:1453] -> [channels/drdynvc/client/drdynvc_main.c:1450]: (warning) Either the condition '!drdynvc' is redundant or there is possible null pointer dereference: drdynvc.
[channels/audin/client/opensles/audin_opensl_es.c:98] -> [channels/audin/client/opensles/audin_opensl_es.c:94]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
[channels/audin/client/opensles/audin_opensl_es.c:159] -> [channels/audin/client/opensles/audin_opensl_es.c:153]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
Up until now X11 mouse button remapping was only possible for the
default buttons 1 to 3.
With this pull any X11 mouse button can be mapped to any RDP mouse
event and all X11 remappings are respected.
The cause is very simple: we didn't map the xwindow on receiving
WINDOW_SHOW. but doing that causes another problem that you can't
hide a window anymore, and that is because whlie window hiding, the
_NET_WM_STATE and WM_STATE properies of the xwindow may change, in
the function `xf_event_PropertyNotify` we just assume that windows
not maximized, not minimized, yet not showing normally should be
corrected to be shown, we just need to consider the situation that
the window is hidden here.
fix: #5078
The extended information provided by VerifyCertificateEx and
VerifyChangedCertificateEx is now exploited by the new functions
client_cli_verify_certificate_ex and client_cli_verify_changed_certificate_ex.
The old callbacks now print out deprecation warnings to inform the
user and developer about this deprecation.
To fix#4825 GFX functions must now aquire a lock before accessing surfaces.
This prevents simultaneous update of internal data by client and gfx threads.
Also enforce return value checks, where not already done.
Added a library internal function freerdp_settings_set_default_order_support
which initializes the OrderSupport array of settings.
Now clients no longer need to set this up on their own, if they
do not implement their own hardware accelerated order processing.
With #4950 client side pointer implementation was made optional.
This addresses an issue that each client had to call
pointer_cache_register_callbacks on its own.
Icons on X11 windows are configured using the _NET_WM_ICON property
described in Extended Window Manager Hints. Here we implement converison
from DIB bitmaps used by RAIL to the format expected by _NET_WM_ICON,
and actually set the icon for RAIL app windows.
Both DIB format and _NET_WM_ICON (or rather, Xlib) are weird. Let's
start with RAIL's format. That's the one used in BMP and ICO formats
on Windows. It has some strange properties but thankfully FreeRDP's
freerdp_image_copy() can handle most of them for us. (With an exception
of monochrome and 16-color formats that it does not support. Sorry, but
I'm too lazy to fix them. They are not seem to be used by any real
application either.) The one thing that it can't do is to apply the
alpha transparency bitmask so we have to do it manually. This instantly
reminds us that DIB format has HISTORY: it's vertically flipped and
each must be padded to 4 bytes. Both these quirks having reasonable
(for a certain definition of 'reason') explanations. Such is life.
(Also, 8-bit images require a color palette which we must fill in.)
So okay, now comes _NET_WM_ICON. It is more sane (or rather, easier to
deal with). The bitmap is represented with a tiny [width, height] header
followed by an array of pixels in ARGB format. There is no padding, no
weird color formats. But here's a catch: you can't simply take the
output of freerdp_image_copy() and cast to (unsigned char*) of colors.
We have to allocate an array of C's longs and copy the pixels there,
because that's what Xlib expects (and this is mentioned in the spec).
Simply casting an array of bytes causes crashes on 64-bit systems.
So don't try to cheat or "optimize" and read the docs, kids.
Note that XFlush() call after XChangeProperty(). It's there because it
seems to helps see the icon quicker with Unity on Ubuntu 14.04. I don't
know why. (And Unity does not support _NET_WM_ICON officially. But it
sorta kinda works sometimes.)
Oh, and while we're here, delete some old, unused, and commented out
code that was setting window icons in the past. It's not needed anymore.
This commit adds a cache for RAIL application icons. It is (surpisingly)
used to cache icons for remote applications. This mechanism is described
in MS-RDPERP 3.1.1.2 Icon Cache Support and related items.
Note that some (actually, most) of the icons are not cached. These are
marked with CacheId == 0xFF. In order to keep the code clean we do not
introduce a special case and instead use a 'scratch' icon and simply
pretend to return an xfRailIcon from cache.
We're going to set icons via _NET_WM_ICON property which explains
why we use "long" values to store pixel data. The icon conversion
is not implemented in this commit, it's only stubs.
However, we do implement processing of window information orders that
contain new icons or cached references to previously sent icons. Note
that it is important to not fail (i.e., to not return FALSE) if we
cannot find a window for the icon by its ID. The server occasionally
likes to be slow or something and send icon updates for nonexistent
windows. This behavior is mandated by the spec, too:
MS-RDPERP 3.2.5.1.6 Processing Window Information Orders
Upon receipt of a Window Information Order for an icon or
cached icon, as specified in sections 2.2.1.3.1.2.2 and
2.2.1.3.1.2.3, the client SHOULD locate the local RAIL window
that corresponds to the WindowId reported in the Hdr field
and apply the icon updates to the RAIL window. If no such
window can be found, the client SHOULD ignore the order.
Indeed, we silently ignore such orders now.
This patch simplifies the licensing code mutualizing encryption / decryption
routines. It also adds the support for client_info packet that allows to send a
previously saved CAL file.
cache dependancies so we are not hitting github often
update android dependancies to latest and compile.
./android-build-freerdp.sh --ndk ~/Programming/android-ndk-r15c --relWithDebug --jpeg
Still an error compiling openh264
The newly introduced option /tls-seclevel can be used to set the tls
security level on systems with openssl >= 1.1.0 or libressl.
As default level 1 is used as higher levels might prohibit connections
to older systems.