Hi,

I am trying to determine if any of these systems are installed. I began using int 2f, but results tells me that I am using DOS 5.0., and I am working under Windows 2000!

Function 4680h returns me that windows 3 is not running, and function 160ah is unsupported (does not modify ax), function 4a33h returns other version different from 7. The problem is that these functions are undocumented, and something has changed with systems upper to windows 95... or 98... I don't know

Is there any way to distinguish between all the windows????
Posted on 2003-07-20 13:18:35 by miguelossa
just a suggestion, try disk access on the boot sector of a drive, each is diffrent enough for you to tell what os it is.
Posted on 2003-07-20 15:22:21 by Qages
Posted on 2003-07-20 15:23:43 by Mecurius
After posting this message, I found the API function GetVersionEx. I will try to use it after int 2fh, function 4680h, in case of al = 80h. Perhaps if Windows is not installed, it will return 0.

The boot sector of the hard drive could be good, but I have to look up any other things to know in which unit is installed the current system. Maybe if the API function doesn't work...

Thank you for your suggestions.
Posted on 2003-07-20 15:37:53 by miguelossa
i am assuming your program is a 16-bit command-line program since it needs to detect DOS... in which case, i don't think you can call Windows APIs (i could be wrong). However, your program could call another program to get OS version info:
in the DOS stub of a PE file, you can get your program to call the DOS version interrupts and write a return value in a temporary file, but if your program is running within Windows, the Windows portion of the program can call GetVersionEx and, it too, can write a return value in a temporary file.
Posted on 2003-07-20 21:04:44 by jademtech
Jademtech wrote:

------------------------------------------------------------------------------------------------------------------------------------------
in the DOS stub of a PE file, you can get your program to call the DOS version interrupts and write a return value in a temporary file, but if your program is running within Windows, the Windows portion of the program can call GetVersionEx and, it too, can write a return value in a temporary file.
------------------------------------------------------------------------------------------------------------------------------------------

How could I do that? I've tried to call a Windows program from a DOS program (using tiny model, a .com file). The program is able to call another DOS program (I tested it and works ok), and restores the execution after the call point but, when I use it with my Windows program, the function returns me 'ok', the program is not executed, and the control returns to the main.

NOTE: I am using int 21h, ax=4b00h to execute the program.
Previously, the memory is released with ah=4ah
All the registers are recovered after the call.

Any ideas?
Posted on 2003-07-21 16:14:16 by miguelossa
On the getversionex api function, here is a recent thread...

http://www.asmcommunity.net/board/index.php?topic=13881
Posted on 2003-07-21 17:52:05 by RobotBob
You probably won't get the right version number from a DOS program.

I vaguely recall MS announcing the DOS version seen by DOS programs running under Windows would not change after certain versions of Windows. The exact information is probably lost in some old migration notes that nobody has needed for a while, or in a retired portion of the knowledge base.
Posted on 2003-07-22 15:50:22 by tenkey