Date: Fri, 29 Aug 1997 13:13:53 +0300 (IDT) From: Eli Zaretskii To: Ying Qin cc: djgpp AT delorie DOT com Subject: Re: Callback problem In-Reply-To: <3405E6D9.98D@ece.uci.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 28 Aug 1997, Ying Qin wrote: > My program is as follows. Compiled by gcc(DJGPP). CWSDPMI is > automatically loaded when running. The problem is: on the first call, it > returns well, but on the second call, it freezes. You are calling `printf' from a real-mode callback. That is a bad idea, since `printf' calls DOS functions. Please try using cprintf or some other means of telling you that the receiver works without calling DOS functions, and see whether it makes the program work. What is that call to _go32_dpmi_simulate_fcall_iret for in the function below? > /* called by the packet driver if a packet was received */ > void PacketReceive() > { > if (call_back_reg.x.ax == 1) > { /* Seconde Call */ > total++; > printf("Total: %d\n", total); > } > else > { /* First call */ > ... > call_back_reg.x.es = buf_info.rm_segment; > call_back_reg.x.di = buf_info.rm_offset; > ... > } > _go32_dpmi_simulate_fcall_iret(&call_back_reg); > }