🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2679

Windows3/TSR interface HELP

#2679
From: Dave Lockwood
Date: Wed, 15 May 1991 13:36
44 lines
2146 bytes
This is the second posting - I didn't see any replies the first time :-(

I'm trying to write a Windows 3 application which needs to interface to a
DOS TSR which communicates via an interrupt. Everything works fine in real
mode, but I get UAEs and reboots in both standard and 386 enhanced mode.

The code segment that's causing the trouble:

	union	REGS	InRegs;
	union	REGS	OutRegs;
	struct	SREGS	SegRegs;
	HANDLE		hBuffer;
	LPSTR		lpBuffer;

	InRegs.h.ah = 11;
	InRegs.h.al = 1;
	InRegs.x.dx = FP_OFF(lpBuffer);

	hBuffer = GlobalAlloc(GHND,512L);
	lpBuffer = GlobalLock(hBuffer);
	InRegs.x.di = FP_OFF(lpBuffer);
	SegRegs.es = FP_SEG(lpBuffer);

	int86x(0x7f,&InRegs,&OutRegs,&SegRegs);

I've done a lot of RTFM-ing, but to no avail (at least, the problem isn't
solved). I didn't write the TSR, so it's difficult to get changes done
there (I don't have the source).

My suspicions are that lpBuffer above is a 'selector' (whatever that is)
rather than a true, _far address, and when the TSR (assembler) uses the
ES:DI register pair, some sort of protect trap takes place.

Any ideas on how to solve this? Do I need to spend $500 on the DDK and write
a special device driver? Please help - any comments would be appreciated;
if you did respond via a posting last time, please respond again. My upstream
site lost some news just about the "right" time :-(.

Thanks in advance!

-- 
Dave Lockwood          dave@mgc.uucp                 G4CLI@GB7DCC._199.GBR.EU
Head of Technology           ...!uunet!mcsun!ukc!mgc!dave
----MG Computer Systems Ltd, PO Box 50, Doncaster, DN4 5AW +44-302-738770----
Technical Details
Message-ID: <1991May15.133642.40@mgc.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!vision!mgc!dave

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!vision!mgc!dave
From: dave@mgc.uucp (Dave Lockwood)
Newsgroups: comp.windows.ms.programmer
Subject: Windows3/TSR interface HELP
Keywords: win3 tsr interrupt selector far
Message-ID: <1991May15.133642.40@mgc.uucp>
Date: 15 May 91 13:36:42 GMT
Reply-To: dave@mgc.UUCP (Dave Lockwood)
Followup-To: comp.windows.ms.programmer
Organization: MG Computer Systems
Lines: 44