LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetWinOSVersion

This function retrieves informations about the operating system version. I saw that:

under win2k
major version is 5, minor is 0, platform is 2.

under winXP (service pack 2)
major version is 5, minor is 1, platform is 2.

Seems the only difference in these OS is in minor version, but what about win9x? Or ME? Or XP with SP 1 only or no SP at all? Since some commands are unique to some versions (e.g. Shutdown exists under WinXP but doesn't in Win2k, where trying to shutdown the system is an afreightening task 😠 ), it would be better to accomodate program behaviour depending on windows version.

Now the question is: is there a place where those values are filed for ALL windows versions (including service packs) or do I have to test by myself on all of them to discover which values this function returns?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 7
(4,137 Views)
Here are a couple of sites that show Windows versions:
The OSVERSIONINFO structure from Microsoft shows some of the combinations used to determine the OS version:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/osversioninfo_str.asp
Here are a couple of sample programs.
http://www.codeproject.com/system/XWinVer.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
0 Kudos
Message 2 of 7
(4,131 Views)
OSVERSIONINFOEX used with GetVersionEx includes the service pack info.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/osversioninfoex_str.asp
0 Kudos
Message 3 of 7
(4,129 Views)
If you deal with older Windows versions, the build number comes in handy:
http://www.codeproject.com/system/winvertable.asp
0 Kudos
Message 4 of 7
(4,126 Views)
I've filed a report to see if we can make the documentation better. For now, the links posted by Al S will help you get the additional information you need. This function calls the GetVersionEx() Windows SDK function (refer to toolbox.c) so those links will be accurate.

Thanks for letting us know about this.
Bilal Durrani
NI
0 Kudos
Message 5 of 7
(4,105 Views)
There is also a potential issue related to the presence of a normal install vs. an embedded install (NT4E, XPE). The kernels are supposed to be fully compatible (in theory), but the service packs can be different. For example, NT4E was never officially approved to go above SP5. I've put 128 bit-SP6a on them anyway to run some software that I needed, but it causes them to misbehave occasionally.

The reason I bring it up is because you have practically full control of how the embedded OS is built and what features will be deployed. Potentially, some calls that you make through the API might lead down a road where there is nothing installed, nothing at the end of that road. I don't know if this could be a problem for you. Hopefully the API would return a message along the lines of 'this feature not installed'.

Orlan
0 Kudos
Message 6 of 7
(4,097 Views)
Good to know, Cosmo. I never had worked on embedded OSs and probably I never do since the target of my customers does not require it, but I'll store this piece of information in case I'll have to move on embedded in the future.

Thanks to all for the informations: I'll begin to study your references.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 7
(4,094 Views)