www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - Real-mode callback

Content-Transfer-Encoding: 7bit

Hi all,

I had previously made a function for PharLap and Metaware's HighC for
callbacks for real-mode functions (retf or iret). Now I need to do the same for
and dmc 32-bit targets. The attached file has the function
which does this without the need for assembly. A small real-mode wrapper
is written to allocated DOS memory. But my problem is that my prot-mode function
never gets called. It allways crashes somewhere in the extender (or after the
r2p_addr). It immediately closed the DOS-box under WinNT (no CS:IP is shown).

Can anyone spot the troubles with the code? I know the PmodeGlue() function 
probably isn't working; the registers aren't filled correctly. A small test
is included which redirects int 29 to click the speaker.

Hope to get this resolved, it's driving me crazy...

Gisle V.
Jul 11 2002