[comp.windows.ms.programmer] int86 in Windows 3.0

nee@cf_su14.Salomon.Com (Robert Nee) (01/17/91)

I am trying to write a program in windows 3.0 to return the Video
mode number.  I understand that there is a bios call to do this.
I also understand from reading tips.txt that came with the SDK
that int86 calls should work under windows 3.0 in Enhanced mode.

So here is what I did

#include <bios.h>

int gvm ()

{
	union REGS inregs, outregs;

	inregs.h.ah = 0x0F; /* Get video mode service */
	int86 (0x10h, &inregs, &outregs); /* Bios video routine */

	return outregs.h.al;
}

Pretty simple.  But this monster crashes horribly.  So I ask
whats wrong?  Any help is appreciated.

Robert Nee