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...
It's an interesting question but wrong attitude. It is not your business checking the affairs of the user.
Or you might as well:
Require their tax declaration before selling your software to them
A written proof from police they have no criminal record (or they may be inclined to break the law again and pirate your software)
Check if they have any torrent software installed (of course it can be used legally but the very fact they have it implies they may misuse it)
Check if they have antivirus software installed (to raise their social awareness and to help fight spam bot networks)
A credit history report (to be sure they have promptly paid their bills and will also not forget to pay for your software)
A proof from their family doctor they have no terminal disease (a person feeling condemned may break the law and pirate your software)
You see where it's going right?
One of the key rules for developing software - your software should be useful, make the users happy and build as few barriers as possible.