none
MSDN feedback is broken, here's my contribution, please forward

    Question

  • I've tried to add my observations about the GetVersionEx function to the MSDN website, but it's broken (duh).

    Here's the website: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx

    And here's my contribution:

    Title: It does not lie in application compatibility mode.

    I've tried with a .NET 4.0 application under the following operating systems: Windows XP SP3, Windows 7 SP1, Windows 8

    The following were my observations:

    Environment.OSVersion is always true, also in app compat mode.

    Native GetVersionEx is always true, also in app compat mode.

    WMI Win32_OperatingSystem.Version et al. is always true, also in app compat mode.

    Registry HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion regards app compat mode, but not in Windows 8 where it's still true (reports 6.2). The CurrentBuildNumber value is also simulated in Windows 7, but not in Windows XP.

    Windows 2000 SP4 only supports .NET 2.0 and doesn't have an app compat mode. Everything works as expected there.

    Considering this, it basically doesn't matter where you get the Windows version from as long as you don't read the registry.

    Tuesday, July 09, 2013 6:11 PM

All replies

  • WHen did you try to post that feedback on the site LonelyPixel?  I think we have a delay in place for profanity and spam checking type things.  When I did this a few weeks ago, it took a day for mine to appear.  

    Thanks,
    Mike


    MSDN and TechNet Subscriptions Support
    Read the Subscriptions Blog!

    Tuesday, July 09, 2013 6:43 PM
  • I just tried it a few minutes before posting here. I typed in my text, clicked the submit button and the page was loading for maybe a minute, then coming back to me saying *An error has occured or something as useful as that. Tried three times, no success.
    Tuesday, July 09, 2013 6:45 PM
  • Sounds similar to this thread: http://social.technet.microsoft.com/Forums/en-US/371d1f08-5f8a-45f1-a869-f817209588ab/technet-article-omission-and-community-input-correction

    Mike


    MSDN and TechNet Subscriptions Support
    Read the Subscriptions Blog!

    Tuesday, July 09, 2013 6:49 PM
  • Strange, my post that I made a few minutes ago just showed up, this time using chrome:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx

    Do you want to try again, or I could edit my post to include your info?

    Mike


    MSDN and TechNet Subscriptions Support
    Read the Subscriptions Blog!

    Wednesday, July 10, 2013 6:20 PM
  • Thanks, Mike. I'll try again, with more of my findings, but not today.

    Wednesday, July 10, 2013 8:24 PM
  • It still doesn't work. The message is "*Error occurred while saving your data.". Maybe an admin should look into it, I guess nobody else can give accurate information about the error.

    Here's my updated content:

    I've tried with a .NET 4.0 application under the following operating systems: Windows XP SP3, Windows 7 SP1, Windows 8

    The following were my observations:

    Environment.OSVersion is always true, also in app compat mode, but not in Windows 8.1 without the manifest.

    Native GetVersionEx is always true, also in app compat mode, but not in Windows 8.1 without the manifest.

    WMI Win32_OperatingSystem.Version et al. is always true, also in app compat mode and Windows 8.1.

    Registry HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion regards app compat mode, but not in Windows 8 where it's still true (reports 6.2). The CurrentBuildNumber value is also simulated in Windows 7's compat mode, but not in Windows XP's.

    Windows 2000 SP4 only supports .NET 2.0 and doesn't have an app compat mode. Everything works as expected there.

    Considering this, WMI is the best place to get accurate OS version information. The other methods are basically of equal reliability. Reading the registry is the worst idea.

    Thursday, July 18, 2013 7:58 PM