It is currently Sat Jul 20, 2019 7:01 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: OSVersion() bug?
PostPosted: Thu Apr 09, 2009 6:02 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
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.

Code:
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 09, 2009 6:23 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5777
Location: Germany
Its because XP 64bit has the same version number as Server 2003 (5.2)
I will fix the detection.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 09, 2009 6:30 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
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):

http://www.purebasic.fr/german/viewtopic.php?t=11620

Is there a chance to get a beta lib or I should use the code above for the moment?

_________________
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 09, 2009 6:46 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5777
Location: Germany
Just use that code for the moment.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 09, 2009 7:00 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
Ok, thanks.

_________________
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 10, 2009 2:58 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 5:05 pm
Posts: 1769
Location: Norway
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 10, 2009 3:03 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3237
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.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 10, 2009 3:05 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 5:05 pm
Posts: 1769
Location: Norway
Yeah, but wasn't XP 64 based on Server 2003, while 32bit XP was based on Windows 2000 though?

EDIT: Found this http://en.wikipedia.org/wiki/XP_64-Bit# ... 64_Edition


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 26, 2009 2:07 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Sep 15, 2003 5:55 am
Posts: 1336
@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

c ya,
nco2k

_________________
If OSVersion() = #PB_OS_Windows_ME : End : EndIf


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 26, 2009 5:10 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
Hi nco2k, thanks for the information and the update, it's much appreciated.

_________________
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye