From: nikki AT gameboutique DOT co (nikki) Newsgroups: comp.os.msdos.djgpp Subject: Re: real mode calls pmode Date: 23 Feb 1997 19:06:14 GMT Organization: GameBoutique Ltd. Lines: 55 Message-ID: <5eq4f6$4nu@flex.uunet.pipex.com> References: NNTP-Posting-Host: www.gameboutique.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Please post your code whcih installs the callback. You are probably doing > something wrong. One thing you should do is lock all the code and data in > your callback; did you do that? If not, the easiest way to see if that's > the problem is to set the `_CRT0_FLAG_LOCK_MEMORY' bit in the > `_crt0_startup_flags' variable (the FAQ explains this in section 18.9). yep, all memory is locked with that flag set. the procedure is : unsigned short access_type(unsigned char if_class,unsigned short if_type,unsigne { __dpmi_regs r; callback_info.pm_offset = (unsigned int)receiver; _go32_dpmi_allocate_real_mode_callback_retf(&callback_info,&callback_regs); r.h.al=if_class; r.h.ah=2; r.x.bx=if_type; r.h.dl=if_number; r.x.cx=typelen; r.x.es=callback_info.rm_segment; r.x.di=callback_info.rm_offset; __dpmi_int(pktdrv.irq,&r); if (r.x.flags & 1) { pktdrv.error=r.h.dh; return(0); } return(r.x.ax); } callback_info and callback_regs are global as described in the faq. the flags check just tells me if it installed the callback correctly according to the hardware, it says no errors. receiver is the function i'm calling void receiver() { printf("rec\n"); } which doesn't do much as you can see :) i tried running this without the printf even and it still gives the error incidentally. all the variables passed are valid and correct, and like i said, it works 90% of the time :) it just seems to throw up occasion rmcb errors for no apparent reason :( regards, nik -- Graham Tootell nikki AT gameboutique DOT com