www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/25/08:26:08

To: Travis Kuhn <trav AT clark DOT edu>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Interrupts
Date: Fri, 25 Nov 94 13:55:35 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

>  _go32_dpmi_allocate_real_mode_callback_iret(&info, &reg);
>
> /* This sets up the mouse driver to call the function at es:dx when the
>    right mouse button is pressed.
> */
>   reg.x.ax=12;
>   reg.x.cx=8;
>   reg.x.es=info.rm_segment;
>   reg.x.dx=info.rm_offset;
>   
>   _go32_dpmi_simulate_int(0x33, &reg);

That particular mouse driver function needs an *ordinary* function,
not an interrupt one, so you should call
 go32_dpmi_allocate_real_mode_callback_retf() instead of ...._iret().
I did this, and it worked for me.      ^^^^

Also, the libc info file explains that your callback is called with
a REGS variable which should be defined as global, so your declaration of
handler() should be this:

	void handler(_go32_dpmi_registers *regs)

Otherwise, you won't be able to use the info which the mouse driver
passes to you.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019