Mail Archives: djgpp/1997/03/10/03:30:32
Andrew Crabtree <71223 DOT 3315 AT CompuServe DOT COM> wrote:
> ..into the ARP handler, and that crashed too ( I'm just trying to verify it gets
> to my routine OK). It sometimes reports the page fault, and sometimes just
> exits without any message. If no arps go out (I'm controlling them fron a
> traffic generator) then no problems.
...
> __dpmi_allocate_real_mode_callback(&ARPPacketHandler,&arpRegs,&arpSeg)
OTOH, this function requires that ARPPacketHandler() returns with a "retf".
Instead I would use:
_go32_dpmi_seginfo rm_cb;
rm_cb.pm_offset = (unsigned long) &ARPPacketHandler;
_go32_dpmi_allocate_real_mode_callback_retf (&rm_cb,&arpRegs);
Look at the info page for this function for an example.
> /* es:di - pointer to our function */
> regs.x.es = arpSeg.segment;
> regs.x.di = arpSeg.offset16;
^^
This would become:
regs.x.es = rm_cb.rm_segment;
regs.d.edi = rm_cb.rm_offset;
^^
It's safer to fill all 32-bits; One never knows if the packet-driver
ignores high-words or not.
Gisle V.
- Raw text -