Mail Archives: djgpp/1997/08/29/06:14:10
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);
> }
- Raw text -