OT Windows Seven os identification

OT Windows Seven os identification

Postby Richard Chidiak » Fri Oct 09, 2009 8:34 pm

Hello

can someone tell me what is the return of xharbour os() function under windows seven ?

msginfo(os())

Thanks in advance for your help,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: OT Windows Seven os identification

Postby Antonio Linares » Fri Oct 09, 2009 10:00 pm

Richard,

xharbour is returning a wrong value:
Windows Windows Vista Professional 6.01.7600

Harbour returns it right:
Windows 7 6.1.7600

The wrong code is in source\common\hbver.c where it does (in xHarbour):
Code: Select all  Expand view

            case VER_PLATFORM_WIN32_NT:

               if( osVer.dwMajorVersion == 6 )
               {
                  szName = " Windows Vista";
               }
   ...
 

but in Harbour the code is fine:
Code: Select all  Expand view

            case VER_PLATFORM_WIN32_NT:

               if( osVer.dwMajorVersion == 6 )
               {
#if !defined( HB_OS_WIN_CE ) && !defined( __DMC__ ) && ( !defined( _MSC_VER ) || _MSC_VER >= 1400 )
                  OSVERSIONINFOEXA osVerEx;

                  osVerEx.dwOSVersionInfoSize = sizeof( osVerEx );

                  if( GetVersionExA( ( OSVERSIONINFOA * ) &osVerEx ) )
                  {
                     if( osVer.dwMinorVersion == 1 )
                     {
                        if( osVerEx.wProductType == VER_NT_WORKSTATION )
                           pszName = " 7";
                        else
                           pszName = " Server 2008 R2";
                     }
                     else if( osVer.dwMinorVersion == 0 )
                     {
                        if( osVerEx.wProductType == VER_NT_WORKSTATION )
                           pszName = " Vista";
                        else
                           pszName = " Server 2008";
                     }
                     else
                        pszName = "";
                  }
  ...
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests