I'm not interested in getting version information. All I want to do is to make sure my application will only run on a legal version of Windows and not on a pirated version. Windows uses some trick to determine this but still allows pirated versions to continue to run, although with some limits.
So, is there a way to check if the application is installed on a legal, genuine Windows version? (Vista and better, at least.)
Let me clear something up: Microsoft isn't preventing users to use a non-validated or illegal version of their operating system. Thus I don't have any reasons to block my application on such a version either. But I do want my application to be aware of the illegal version and warn the user that his Windows version isn't validated. Maybe he forgot, maybe he doesn't want to validate. There could be plenty of reasons for this and I don't want to block them, just making them aware of a problem with their Windows version.
Also, when someone uses a non-valid version of Windows then I might want to do a more strict validation check of my own software, if it's a commercial product. In my free products, I just want an annoying popup, which will just appear once per day.
The main problem with non-validated Windows versions is that they might contain additional spyware and other malware and there's a chance that they don't get all required updates. These Windows versions have a weaker protection than validated Windows versions. Since several of my applications use sensitive data, I don't want any malware leaking away this sensitive data.
Plus, I consider pirated software harmful for any free alternatives. Linux and FreeBSD would have been much more popular if it wasn't for all those pirated Windows versions that are roaming around. People who use pirated software are unlikely to have bought the product in the first place but I would prefer them to use a free alternative instead. Pirated software does a little harm to Microsoft, but it does a lot more harm to the Free community since it keeps people connected to those commercial products...
Not even Microsoft can do this reliably. It is a constant arms race as Microsoft updates WGA against people who seemingly have to do very little to bypass it. This is exacerbated by the needs of OEMs who (rightly) need to have preinstalled and prevalidated copies of OSs so they don't annoy their customers, whom may well be business customers. I think that a lot of the "hacks" around this have to do with OEM master keys.
Basically, pirating software (including Windows and your software) is a social problem not a technical one. The worst thing you can do as a software vendor (imho) is to annoy your legitimate customers in the quest to stop pirates to the point that you make your legitimate customers pirates. Example: some games have gone so far as to install rootkits as well as limiting the number of activations (eg Spore).
Limiting activations in particular is an evil practice. People have an innate sense of fairness about these things. If they have two activations of something, are running Windows XP and switch to Windows 7 RC and will then switch to a real version of Windows 7 when released then they've just gone over the limit. As in the case of Spore, you can request additional activations over the phone but this kind of thing just rubs people the wrong way. Some to the point that they'll feel quite justified in bypassing such restrictions.
As for downvoting your question, I suspect it's because people don't like your intent, probably for reasons that are similar to the ones I've listed above.