The following code compiled with the 32 bit version of PureBasic then run on XP Pro 64 bit displays "#PB_OS_Windows_Server_2003". Is that correct or am I missing something? On XP 32 bit it displays XP, as expected.
Select OSVersion()
Case #PB_OS_Windows_NT3_51
MessageRequester("","#PB_OS_Windows_NT3_51")
Case #PB_OS_Windows_95
MessageRequester("","#PB_OS_Windows_95")
Case #PB_OS_Windows_NT_4
MessageRequester("","#PB_OS_Windows_NT_4")
Case #PB_OS_Windows_98
MessageRequester("","#PB_OS_Windows_98")
Case #PB_OS_Windows_ME
MessageRequester("","#PB_OS_Windows_ME")
Case #PB_OS_Windows_2000
MessageRequester("","#PB_OS_Windows_2000")
Case #PB_OS_Windows_XP
MessageRequester("","#PB_OS_Windows_XP")
Case #PB_OS_Windows_Server_2003
MessageRequester("","#PB_OS_Windows_Server_2003")
Case #PB_OS_Windows_Vista
MessageRequester("","#PB_OS_Windows_Vista")
Case #PB_OS_Windows_Server_2008
MessageRequester("","#PB_OS_Windows_Server_2008")
Case #PB_OS_Windows_Future
MessageRequester("","#PB_OS_Windows_Future")
EndSelect
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Thanks for the information Timo. I had a look at GetVersionEx and you are right, it has the same minor and major version. I found some code that works OK on the german forum (it checks for wProductType as well):
Hey freak, does XP 64 and Server2003 have the same API though? If they do, then no harm done, but if XP 64 is more like XP and thus lack features that 2003 have then obviously they should be differentiated.
XP and Windows Server have different APIs. For example, Windows Server can create a DFS (Distributed File System) root node while Windows XP, even though the same API is exposed, cannot. There are also additional services and dynamic libraries.
@Inf0Byt3
that code was somewhere in this forum for 2-3 years. i updated it now to support Windows 7 and Windows Server 2008 R2 and posted it in tricks n tips: http://www.purebasic.fr/english/viewtopic.php?t=37240