Why does GetFileVersionInfo on kernel32.dll in Windows 10 return version 6.2?

后端 未结 2 1992
一向
一向 2021-01-06 06:09

I am trying to retrieve kernel32.dll version in order to perform a Windows version check. Yet, for some reason, even though kernel32.dll\'s version

相关标签:
2条回答
  • 2021-01-06 06:48

    You are reading the wrong fields from the version information for this task. Instead of dwFileVersionMS and dwFileVersionLS use dwProductVersionMS and dwProductVersionLS.

    The file version fields are subject to supportedOS compatibility issues. That is their values depend on the supportedOS levels declared in your application manifest. On the other hand the product version fields do not depend on the manifest.

    0 讨论(0)
  • 2021-01-06 07:12

    Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2).

    this is from GetVersionEx function MSDN description. for GetFileVersionInfo no such note, but really this doing same. i look under debugger:

    so 10.0 ( 0xA000) in dwFileVersionMS can be fixed to 6.2 or 6.3 but dwProductVersionMS - not changed (0xA000 ~ 10.0) think need fix MSDN documentation for GetFileVersionInfo[Ex] :)

    0 讨论(0)
提交回复
热议问题