Skip to main content

Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Hi,

Length of WS-MYOSVER is 156 bytes, not 148.

Regards Yvon


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Now i become this for Windows 8.1:

MajorVersion    6
MinorVersion    2
BuildNumber     9200
MajorAndMonir 0
PlattformId        2
CSDVersion    
ServicePack     0
MinorPack        65792
SuiteMask        0
ProductType 

I need the ProductType for identifire is this Windows 8.1 or not !?       

 

 

 

 


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

This seems to be a change that was made to this API call for Windows 8.1 in that it will return the same info as Windows 8 unless the application from which the call is made is specifically targeted to Windows 8.1 by using a manifest file.

Please see the description:

msdn.microsoft.com/.../ms724451(v=vs.85).aspx


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

I Need the API not the .Net Part!


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

The same is with Windows VISTA and 2003

What I Need is the "dwProductType" Information!

With that parameter you can find out wich Windows Version is running!


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Have a looked @ msdn.microsoft.com/.../ms724833(v=vs.85).aspx

wProductType:

Any additional information about the system. This member can be one of the following values.

VER_NT_DOMAIN_CONTROLLER 0x0000002

The system is a domain controller and the operating system is Windows Server 2012 , Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

VER_NT_SERVER 0x0000003

The operating system is Windows Server 2012, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

Note that a server that is also a domain controller is reported as VER_NT_DOMAIN_CONTROLLER, not VER_NT_SERVER.

VER_NT_WORKSTATION 0x0000001

The operating system is Windows 8, Windows 7, Windows Vista, Windows XP Professional, Windows XP Home Edition, or Windows 2000 Professional.

The next link shows you how to make your application target Windows 8.1 (or anything else):

msdn.microsoft.com/.../dn481241(v=vs.85).aspx

Lastly if you want to ensure your app works on an particular platform use the VerifyVersionInfo API

msdn.microsoft.com/.../ms725491(v=vs.85).aspx

--

Stephen


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Yes I Need the "wProductType" but the API will not give me the Information back!


Hi!

I have a Problem with the API "GetVersionEx" i Need the Information wich Windows System is running.

Microsoft mean this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

But I become sometimes the wrong Version back e.g:

Windows VISTA and Windows 2008 Server have the same Version Number the different is:

OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION /  OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

But i become not the Information back about wProductType...

Her are more Details:

       01 OSVERSIONINFO             is typedef.           
            03 dwOSVersionInfoSize   DWORD.            
            03 dwMajorVersion            DWORD.           
            03 dwMinorVersion            DWORD.           
            03 dwBuildNumberFull.                
                  05 dwBuildNumber       USHORT.               
                  05 dwMajorAndMinor   USHORT.            
            03 dwPlatformId            DWORD.           
            03 szCSDVersion          PIC X(128).            
            03 dwServicePack        DWORD.            
            03 dwMinorPack           DWORD.           
            03 dwSuiteMask           DWORD.           
            03 dwProductType        BYTE.           
            03 wReserved               BYTE.

       78 OSVERSIZE               VALUE 148.       
       78 GetVersionEx              VALUE "GetVersionExA".       
       01 WS-MYOSVER           OSVERSIONINFO.       
       01 WS-MYOSOK                 BOOL.

here is the call:

           INITIALIZE  VERSIONINFOEX.
           move OSVERSIZE to dwOSVersionInfoSize of ws-myOSVer.
           CALL WINAPI GetVersionEx uSING
                BY REFERENCE WS-MYOSVER
                RETURNING WS-MYOSOK
           END-CALL.

 The "dwProductType" is every time 0 on everey Windows Version

The same Problem is between Windows 8 and 2012 Server and so on...

Have anyone an idea whats wrong?

Best Regards

Bernd

 

 


#APIGetVersionEx

Your example program was using the VERSIONINFO, for GetVersionEx which is wrong you need to use OSVERSIONINFOEX for GetVersionEx.

Here is a working example:

    $set ans85 noosvs mf defaultbyte"00"
      copy "windows.cpy".
     $IF 32-BIT NOT DEFINED
     $ set constant 32-BIT(1)
     $ set case
     $END
      IDENTIFICATION DIVISION.
      PROGRAM-ID. getv.
       special-names.
     $IF 32-BIT = 0
               call-convention 11 is WINAPI.
     $ELSE
               call-convention 74 is WINAPI.
     $END
       data division.
      01 VERSIONINFOEX.
       03 dwOSVersionInfoSize DWORD.
        03 dwMajorVersion      DWORD.
        03 dwMinorVersion      DWORD.
        03 dwBuildNumber       DWORD.
        03 dwPlatformId        DWORD.
        03 szCSDVersion        pic x(128).
        03 wServicePackMajor   WORD.
        03 wServicePackMinor   WORD.
        03 wSuiteMask          WORD.
        03 wProductType        BYTE.
        03 wReserved           BYTE.
      78 GetVersionEx              VALUE "GetVersionExA".        
      01 WS-MYOSOK                 BOOL.
      procedure division.
         INITIALIZE  VERSIONINFOEX.
         move length of VERSIONINFOEX to
               dwOSVersionInfoSize of VERSIONINFOEX
         CALL WINAPI GetVersionEx uSING
               BY REFERENCE VERSIONINFOEX
               RETURNING WS-MYOSOK
         END-CALL
         display wProductType
         evaluate wProductType
               when 1 display "Workstation"
               when 2 display "Domain Controller"
         end-evaluate
        end program.