-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows 8.1 and latter] warning C4996: deprecated GetVersionExA #25
base: master
Are you sure you want to change the base?
[Windows 8.1 and latter] warning C4996: deprecated GetVersionExA #25
Conversation
We should check for _WIN32_WINNT > _WIN32_WINNT_NT4 to use the new function… are you sure this is available from w2k? I do not believe this…. it is in w2k, but only in the kernel lib… so you need to have rtlver.lib... this lib is not available in all VS versions… See: https://docs.microsoft.com/de-de/cpp/porting/modifying-winver-and-win32-winnt |
I am sorry, I am a unix guy so not very familiar with Windows development. The situation is a bit confusing for me.
A kernel lib should be available with the OS and not bundled within VS. Am I wrong ? |
1f89fda
to
cf33163
Compare
It is a little bit complicated.... |
1 similar comment
It is a little bit complicated.... |
Ok so first question, is
All of them support XP. If I compile the code with XP SDK and VS2017, it should be okay using |
We just use |
c78a6ec
to
a7127f2
Compare
a7127f2
to
3110f60
Compare
@JochenKalmbach, could you please review again this PR ? |
Hello @JochenKalmbach, |
You now introduce STL code into project, which was not used until now… I am not happy about these changes... |
Hello @JochenKalmbach, |
Hello @JochenKalmbach, |
It is just a feeling… adding the dependency to STL for a little function… 100% of the code currently is not dependend to STL... now for 1% of the code we add this dependency… it is just a feeling... |
I would like to get rid of C4996 ([Microsoft] GetVersionEx function) triggered by VS2013, VS2015 and VS2017.
I replaced GetVersionEx by RtlGetVersion (available starting with Windows 2000). It should not create compatibility issues.
It displays now a good value:
OS-Version: 10.0.16299 0x100-0x1
vs GetVersionExAOS-Version: 6.2.9200 () 0x100-0x1
I am not sure about using
_MSC_VER
to choose this piece of code instead of the old one. The best may be to check NT version at build time. Any idea ?Do you think this fix could trigger an issue on old Windows versions ?