en:docs:fapi:dosgetversion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:fapi:dosgetversion [2018/09/01 16:55] prokusheven:docs:fapi:dosgetversion [2021/10/17 06:28] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}}
  
 ====== DosGetVersion ====== ====== DosGetVersion ======
Line 5: Line 5:
 This call returns the OS version number. This call returns the OS version number.
  
-==Syntax==+===== Syntax =====
  
-  DosGetVersion (VersionWord)+<code c> 
 +DosGetVersion (VersionWord) 
 +</code>
  
-==Parameters==+===== Parameters =====
  
-  * VersionWord (PUSHORT) - output:Address of the OS version number. The version is stored as two bytes, with the minor version in the first byte and major version in the second byte.+  * VersionWord ([[PUSHORT]]) - output:Address of the OS version number. The version is stored as two bytes, with the minor version in the first byte and major version in the second byte.
  
-==Return Code==+===== Return Code =====
  
-  * rc (USHORT) - return+  * rc ([[USHORT]]) - return
      
 Return code description is: Return code description is:
Line 21: Line 23:
   * 0 NO_ERROR   * 0 NO_ERROR
  
-==Bindings== +===== Bindings =====
-===C===+
  
 +==== C ====
 +<code c>
   #define INCL_DOSMISC   #define INCL_DOSMISC
      
Line 29: Line 32:
   PUSHORT VersionWord;   /* Version number (returned) */   PUSHORT VersionWord;   /* Version number (returned) */
   USHORT  rc;            /* return code */   USHORT  rc;            /* return code */
 +</code>
  
-===MASM===+==== MASM ====
  
 +<code asm>
   EXTRN DosGetVersion:FAR   EXTRN DosGetVersion:FAR
   INCL_DOSMISC  EQU 1   INCL_DOSMISC  EQU 1
Line 37: Line 42:
   PUSH@  WORD    VersionWord   ;Version number(returned)   PUSH@  WORD    VersionWord   ;Version number(returned)
   CALL   DosGetVersion   CALL   DosGetVersion
 +</code>
 Returns WORD Returns WORD
  
-==Example==+==== Example ==== 
  
 The following example shows how one may obtain information for program initialization. The program locates the environment segment and prints the name of the command from the command line. It then obtains the OS version number and prints it. The following example shows how one may obtain information for program initialization. The program locates the environment segment and prints the name of the command from the command line. It then obtains the OS version number and prints it.
  
 +<code c>
   #define INCL_DOS   #define INCL_DOS
   #include <os2.h>   #include <os2.h>
Line 82: Line 89:
     }     }
   }   }
 +</code>
  
-====== Note ====== +===== Note =====
- +
-Example code doesn't support check is executed under DOS or not. +
- +
-====== Note ======+
  
 Text based on [[http://www.edm2.com/index.php/DosGetVersion]] Text based on [[http://www.edm2.com/index.php/DosGetVersion]]