Commit Graph

8 Commits

Author SHA1 Message Date
Frediano Ziglio
dc185029ff vdcommon: Do not use GetVersionEx to get Windows version
GetVersionEx was deprecated by Microsoft in favour of utilities
in versionhelpers.h.
The new function returns the same results as:
- GetVersionEx returns maximum 6.2 version and also 6.0 version
  is Vista, not Windows 7 so SYS_VER_WIN_7_CLASS was returned
  for all system from Windows Vista;
- We don't support version earlier than Windows XP and no Windows
  versions had version >= 5.2 and < 6.0 so SYS_VER_WIN_XP_CLASS
  was returned from Windows XP;
- we don't support any system before Windows XP.

Tested under Windows XP, 7 and 10.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-12-03 17:43:17 +00:00
Frediano Ziglio
4d4977611f Remove some unused definitions
_ftime_s, vdagent_strcat_s and vdagent_strcpy_s are not used.
Code is using different string functions.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:22:11 +01:00
Frediano Ziglio
71f6d00a78 Use enumeration for supported_system_version return type
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-08-10 11:13:39 +01:00
Frediano Ziglio
9ab74bb67a Fix swprintf_s call under MingW
For some reason this call does not behave correctly.
This was causing vdservice to fail to run the agent if compiled
with MingW.
Provide a proper swprintf_s replacement.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-08-10 11:13:15 +01:00
Christophe Fergeau
a4f082b0d1 Add strcat_s/strcpy_s fallbacks
These security functions are available when building with MSVC++. With
mingw, they can be used at build time, but their availability will
depend on the version of MSVCRT the user has installed on their system.
In particular, a default install of Windows XP will not have a new
enough MSVCRT version, causing runtime failures as the binary built with
mingw and using strcat_s will not be able to find the necessary entry
point in the MSVCRT runtime.

This commit adds some strcat_s/strcpy_s-like functions used with mingw
which will always be available.
2015-03-20 10:45:12 +01:00
Arnon Gilboa
877e52386e vdservice: extract supported_system_version() to vdcommon
rhbz #919451 preparation
2013-03-18 12:54:04 +02:00
Arnon Gilboa
875cc05292 Revert "vdservice: add missing vdcommon.cpp"
This reverts commit 53b32d4db3 which becomes irrelevant due to previous revert.
2010-11-09 20:52:52 +02:00
Alon Levy
53b32d4db3 vdservice: add missing vdcommon.cpp 2010-08-29 15:07:47 +03:00