Cedric Blancher via Cygwin wrote:
How does cygwin uname -s work, i.e. how does it get the OS version,
revision and build number ('10.0-19045')?
I tried to replicate it via GetVersionEx(), but that is deprecated.


AFAICS, MS does not offer an official way to retrieve the actual Windows version via the Win32 API layer. GetVersionEx() is unable to detect Windows versions which are more recent than the compatibility level advertised in the application manifest.

Cygwin uses the undocumented RtlGetNtVersionNumbers() from ntdll.dll because even RtlGetVersion() may not return the correct values. See function wincapc::init()
https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc

--
Regards,
Christian


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to