Awsome, thanks again.
I think there's a problem with the way DosBox handles event service routines, though (or I'm missing something obvious).
Somewhere between my ESR returning to the IPX service and the IPX service returning control to my application, something is causing my app to resume a dozen or so instructions ahead of where it should be. Everything functions correctly when the ESR pointer is set to 0 (don't use ESR), and when it is set, I'm certain the ESR is being called (it correctly sets a global variable). According to the DosBox source ESR is supported, but is seems that here's a near/far call/return mixup somewhere. I've tried my best but can't find it. I've attempted putting "asm retf" and "asm ret" in my ESR, but it causes a lockup in both cases. I don't have the resources to try it on regular DOS either.
It's still possible to use IPX by polling the event control block's in-use flag and completion code variables. Perhaps those programs which don't work in DosBox use ESRs, and those that do work don't? Or, again, maybe I'm missing something obvious.
The following are the relevent portion of my app; it's 16bit, real mode source compiled using Borland C++ 3.1 (DOS).
uint8 far esrcalled=0;
void far esr(void){
esrcalled=1;
}
.
.
struct ecb{
uint32 link;
uint32 esrptr;
.
.
}myecb;
.
.
myecb.esrptr = (uint32)&esr;
uint16 ecbptr = (uint16)&myecb;
asm{
mov bx, 0x0003 /* Transmit Packet */
mov ax, ds
mov es, ax
mov si, [ecbptr] /* ES:SI = -> ecb */
int 0x7A /* NetWare */
}
// while((!esrcalled)&&(!kbhit()){}
while(1){} // <- should resume here (ESR is called during the loop)
. // <- skipped instructions
. // <- actually resumes here