dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosGetVersion (1.2)
Function Group  Changes                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMISC
 
USHORT DosGetVersion(pusVersion)
PUSHORT pusVersion;    /* pointer to variable receiving version number */
 
The DosGetVersion function retrieves the version number of the operating
system. For MS OS/2 version 1.1, both the major and minor version numbers
are 10. For MS OS/2 version 1.2, the minor version number is 20.
 
The DosGetVersion function is a family API function.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pusVersion  Points to the variable that receives the version number. The
            high-order byte is set to the major version number; the
            low-order byte is set to the minor version number.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value.
 
Example
 
This example retrieves and displays the major and minor version number:
 
USHORT usVersion;
CHAR ch;
 
DosGetVersion(&usVersion);
ch = (HIBYTE(usVersion) / 10) + '0'; /* gets maj. version number */
VioWrtTTY("You are using MS OS/2 version ", 30, 0);
VioWrtTTY(&ch, 1, 0);
VioWrtTTY(".", 1, 0);
ch = (LOBYTE(usVersion) / 10) + '0'; /* gets min. version number */
VioWrtTTY(&ch, 1, 0);
VioWrtTTY("\r\n", 2, 0);
 
See Also
 
DosQSysInfo, LOBYTE, HIBYTE