summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-06-28Reuse spice-protocol macros instead of defining new ones for alignmentHEADmasterFrediano Ziglio2-10/+4
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-05-31vdagent: Fix loss of mouse movement eventsfree.user.name1-69/+64
send_input() may not be immediately called from handle_mouse_event() on movement. INPUT structure is generated and stored and a timer may be set instead. If subsequent call to handle_mouse_event() occurs before timer expires, prepared INPUT structure gets overwritten and MOUSEEVENTF_MOVE bit is lost. Windows doesn't see updated mouse position as the result. Make handle_mouse_event() merely store the new mouse state, and move INPUT structure generation to send_input(). Shuffle new mouse state to previous only after mouse events are submitted to SendInput() Windows API function. This patch was sent to the mailing list by an anonymous contributor with minimal style changes. You can easily test increasing VD_INPUT_INTERVAL_MS (like 1000). For instance you can try in a word processor to move the cursor clicking the mouse on different positions. Acked-by: Victor Toso <victortoso@redhat.com>
2018-05-28file_xfer: Use shared_ptr to simplify memory managementFrediano Ziglio2-22/+6
Clear automatically tasks items. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28file_xfer: Use destructor for FileXferTaskFrediano Ziglio2-10/+18
Limit too much manual work. By default delete the file, unless success() is called. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28file_xfer: Remove too C syntax for C++Frediano Ziglio1-2/+2
In C++ simply declaring the struct add the structure name to the global namespace, no needs for additional typedef. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28file_xfer: Remove FileXferTask structure alignmentFrediano Ziglio1-2/+2
There's no reason beside losing performances to align that structure, is not passed as binary data. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28msi: Do not generate deps.txtFrediano Ziglio2-8/+1
There's no reason to tell the package installed on the build system used. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28Avoid unused variable warningFrediano Ziglio1-1/+1
Currently happens using Visual Studio 2015. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28Fix minor compiler compatibilityFrediano Ziglio1-0/+4
Ensure std::min is declared including directly algorithm header. Undefine possible min and max macros, some Windows headers define them. Currently happens using Visual Studio 2015. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28vcproj: Add some missing filesFrediano Ziglio1-0/+12
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-28vcproj: Remove reference to CxImageFrediano Ziglio1-8/+8
Not used anymore. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-25Revert "Enable some security options on output executables"Frediano Ziglio1-24/+3
This reverts commit 5d5a268d94c5ba32cb134bea9ce6039ec7e66f37. Committed by mistake
2018-05-25Enable some security options on output executablesFrediano Ziglio1-3/+24
Enable NX (prevent data to be executable) and ASLR (address randomisation). Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-25Avoid to use names with reserved characters.Frediano Ziglio1-0/+10
Some characters are reserved and should not be used in Windows independently by the file system used. This avoid to use paths in the filename which could lead to some nasty hacks (like names like "..\hack.txt"). The return statement cause the file transfer to be aborted with VD_AGENT_FILE_XFER_STATUS_ERROR as status. ":" is used to separate filenames from stream names and can be used to create hidden streams. Also is used for drive separator (A:) or device names (NUL:). "/" and "\" are reserved for components (directory, filename, drive, share, server) separators. "*" and "?" are wildcards (which on Windows are supported by different APIs too). "<", ">", """ and "|" are reserved for shell usage. More information on "Naming Files, Paths, and Namespaces" page at https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx This fixes also https://bugzilla.redhat.com/show_bug.cgi?id=1520393. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-25vdagent: Removed unused declarationFrediano Ziglio1-1/+0
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-08-22imagetest: Save BMP file using BitmapCoderFrediano Ziglio3-16/+8
This allows to test BitmapCoder::from_bitmap. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
2017-08-22imagetest: Save PNG file using a helper functionFrediano Ziglio1-10/+18
This allows to reuse the code to save a DIB to a file. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
2017-08-22Make BitmapCoder::from_bitmap return a BMP file formatFrediano Ziglio1-3/+12
The network expect the format of the data to match a file format so prepending DIB data with BITMAPFILEHEADER change the format from DIB to BMP file. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
2017-08-14build: Update NEWS file for 0.9.0 releaseChristophe Fergeau1-0/+9
2017-08-07Do not use dash in rpm versionFrediano Ziglio2-3/+5
RPM does not allow dash in version string. Replace dashes with underscores. This make easier to run "make dist" followed by rpmbuild. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pavelgrunt@gmail.com>
2017-07-27Ignore auxiliary build filesFrediano Ziglio1-1/+1
This allows git.mk to include some missing files to ignore. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-27Update git.mk fileFrediano Ziglio1-42/+242
This sync git.mk file with https://github.com/behdad/git.mk. New version is able to create ignore files that take into account some files currently ignored (like vdagent/.deps directory). Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Add a test for logging functionsFrediano Ziglio3-0/+68
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Expand PRINT_LINE macrosFrediano Ziglio1-5/+4
This complicated macro was used as an helper for LOG macro which expand PRINT_LINE macro twice. Now that LOG expand PRINT_LINE only once there's no need to have this macro which make logging code more complicated. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Make VDLog::printf staticFrediano Ziglio2-9/+8
VDLog::printf is called only using a VDLog pointer. Since this class is a singleton, there can only be one instance of it, so LOG() does not really need to deal with it, VDLog::printf can do that instead. This simplifies LOG macros by not having to choose between printf and VDLog::printf. The manual GNU __attribute__ is used as the format to use is not the standard __printf__ format used in SPICE_GNUC_PRINTF but you need to use the gnu_printf format. For instance the "%llu" syntax is accepted by gnu_print format but not by __printf__ one. MinGW C++ by default uses gnu_printf format for all formatting functions. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Avoid using LTO by default during compilationFrediano Ziglio1-1/+0
LTO option allows to have smaller executable stripping unneeded part of code. These options were added by a095f4806e ("build-sys: statically build agent"). The gain of using these options currently are quite small, from a small test: $ ll *.exe -rwxrwxr-x. 1 freddy freddy 506880 Jul 26 11:26 vdagent.exe -rwxrwxr-x. 1 freddy freddy 198656 Jul 26 11:26 vdservice.exe $ ll *.exe -rwxrwxr-x. 1 freddy freddy 509952 Jul 26 11:26 vdagent.exe -rwxrwxr-x. 1 freddy freddy 200192 Jul 26 11:26 vdservice.exe Considering that there are some bug in some recent MinGW distributions like https://bugzilla.redhat.com/show_bug.cgi?id=1475237 and the small gain I would disable these options. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26spec: run tests during RPM build if possibleFrediano Ziglio1-0/+27
Currently to fully run checks we need Wine for both 32 and 64 bit. Some distros (like RHEL 7) don't seem to allow installing both 32 and 64 bit versions so turn on checks based on distro versions. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Add test for PNG filesFrediano Ziglio3-0/+160
Test various image and formats. The idea is to decode and encode again an image and check for differences. ImageMagick is used to create some test image and compare results. Wine is used to execute a test helper. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Support encoding PNG imagesFrediano Ziglio1-3/+115
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Write code to decode PNG formatFrediano Ziglio5-9/+278
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Initial rewrite of image conversion codeFrediano Ziglio5-53/+158
Remove CxImage linking. Support Windows BMP format. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Move image handling to a separate fileFrediano Ziglio4-49/+146
This will make easier to change code that handle images. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-26Prevent possible future buffer overflowFrediano Ziglio1-1/+2
event_type should come only with specific values but this in theory can change in the future. To prevent overflows (just for logging) check value size against lookup array. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-07-24fix format string for Visual StudioFrediano Ziglio1-1/+2
The "z" size specifier is not supported by Visual Studio. Cast to unsigned long and use "l" specifier as the type has enough precision for this vector. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-24log: add comment to make code clearerFrediano Ziglio1-0/+2
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-24log: rewrite log_version using config.h definitionsFrediano Ziglio1-29/+3
Instead of having to get the version information from the executable resources get from the build configuration file. The same version is used to build the version information resource. This also remove a bug in log_version where "throw" statements were used to raise again a not existing exception on case of failures. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-22Remove small memory leak in log_versionFrediano Ziglio1-5/+4
log_version() declares 2 info_buf variables, the inner one is used to hold allocated memory, but then we free the outer one, which is NULL. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-21Use single variable for path computationsFrediano Ziglio1-6/+5
This saves some stack memory not reducing any readability. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-19Split long if statementFrediano Ziglio1-5/+6
Instead of having a long if statement with checks and assignment split in two. The conditions where used to compute 2 different path, this does not help much with code readability. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
2017-07-14event_dispatcher: vd_printf calls -- remove __func__Uri Lublin1-2/+2
vd_printf adds __FUNCTION__ Signed-off-by: Uri Lublin <uril@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-14clipboard: log format usedUri Lublin1-1/+1
Signed-off-by: Uri Lublin <uril@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-10Avoid log_level warning using a static constFrediano Ziglio1-4/+4
Compiler warnings for unused static variable. Not for constants. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-07-10Enable debug information build on spec fileFrediano Ziglio1-1/+1
The spec file cause the generation of debuginfo packages however the build fails as the executables are not compiled with debugging information. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-07-08Store agent process handle instead of using PROCESS_INFORMATIONFrediano Ziglio1-14/+14
We just need the handle of the process. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-08Use process handle to mark agent existenceFrediano Ziglio1-6/+3
Avoid extra field that could be out of sync. Having a valid process handle is enough. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-08Close agent thread handleFrediano Ziglio1-1/+2
This is not needed so we can close it Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-08Make some functions staticFrediano Ziglio1-15/+17
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-07Update project URLFrediano Ziglio2-2/+2
Uses secure version https://www.spice-space.org. Avoid not secure and use same full name. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-23Fix hdesk handle leak in vdagentkunming.xie1-1/+2
Signed-off-by: kunming.xie <kunming.xie@hotmail.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-23spec: Add missing mingwXX-winpthreads-static dependencyFrediano Ziglio1-0/+2
Without this dependency mock builds fails to build. Tried Fedora 25, Fedora 26 and Rawhide (all x86-64) and all mock builds are failing with "cannot find -lpthread" error. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>