The information in this article applies to:
SUMMARY
There are at least three ways for an application developed for Windows
version 3.x to determine the version of MS-DOS that is running on the
system. Both the first and second methods require placing a few lines of
inline assembler code into the application. The second method requires MS-
DOS version 5.0. The third method requires changing the GetVersion()
function prototype in the WINDOWS.H header file distributed with the
Microsoft Windows SDK version 3.0 (this change is not necessary if the
Microsoft Windows SDK version 3.1 is being used).
MORE INFORMATIONMethod 1This method requires only a few lines of inline assembler code and a call to the DOS3Call() function. The following code fragment demonstrates this technique:
Method 2This method requires only a few lines of inline assembler code and a call to the DOS3Call() function. Additionally, it requires that MS-DOS version 5.0 is running on the system. While this function does not report the OEM serial number, it does report whether MS-DOS is in ROM or in HMA (the High Memory Area). Also the MS-DOS version returned by this method is unaffected by the SETVER command. The following code fragment demonstrates this technique:
Important Note for Methods 1 and 2The DOS3Call() function must be prototyped. In assembly language, the appropriate prototype is as follows:
Use the DOS3Call() fucntion instead of making a direct call to MS-DOS
INT 21h. The DOS3Call() function runs a little faster than the equivalent
INT 21h call under Windows and it ensures that the interrupt will be
handled correctly under Windows.
Also note that the use of FAR and PASCAL in the definition of DOS3Call() requires use of WINDOWS.H, since these macros are defined there. Method 3The last method involves making a slight modification to the Windows SDK version 3.0 header file, WINDOWS.H. To retrieve the MS-DOS version, change the return type in the function prototype of the GetVersion function call from a WORD to a DWORD. The modified prototype should resemble the following:
NOTE: It is not necessary to make the above change to the version of
the WINDOWS.H file included with the Windows SDK version 3.1.
The following code fragment demonstrates how to use the GetVersion() function to display both the MS-DOS version and the Windows version numbers:
Additional query words: 3.00 3.10
Keywords : kb16bitonly |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |