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>
_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>
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>
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.