This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Orbital, bugale bugale, corona10, eryksun, paul.moore, shreyanavigyan, steve.dower, tim.golden, zach.ware
Date 2021-04-18.21:23:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618780998.78.0.780163958912.issue43284@roundup.psfhosted.org>
In-reply-to
Content
> But kernel32.dll (since it's of a different version) isn't 
> accurate at all right? 

To clarify, CMD's VER command calls GetVersion(). It has nothing to do with the file version of any system DLL. Because CMD is a system component, the GetVersion() call returns the true OS version number and build number, directly from its PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber values. When the PEB for a process is created, these values are copied from the kernel's NtMajorVersion, NtMinorVersion, and NtBuildNumber values. 

While the latter may be and most likely are the same as the "CurrentMajorVersionNumber", "CurrentMinorVersionNumber", and "CurrentBuildNumber" values in the registry, the kernel values are not based on the registry. They're compiled into the kernel image when it's built. At boot, the configuration manager sets the registry values to the current values, so that's all fine -- unless someone with admin or system access changes the values (but if a hacker has admin or system access; they own the OS, so such a prank would be the least of one's problems). 

My concern, if you read my previous comments, is that an engineer at Microsoft rejected someone's attempt to recommend using "CurrentBuildNumber" as a replacement for the old advice to use the file version of "kernel32.dll". That's enough to make me worry about what's planned for a future release. So I'd rather just parse the output from CMD.
History
Date User Action Args
2021-04-18 21:23:18eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, corona10, bugale bugale, shreyanavigyan, Orbital
2021-04-18 21:23:18eryksunsetmessageid: <1618780998.78.0.780163958912.issue43284@roundup.psfhosted.org>
2021-04-18 21:23:18eryksunlinkissue43284 messages
2021-04-18 21:23:18eryksuncreate