delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/29/06:14:10

Date: Fri, 29 Aug 1997 13:13:53 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ying Qin <yqin AT ece DOT uci DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: Callback problem
In-Reply-To: <3405E6D9.98D@ece.uci.edu>
Message-ID: <Pine.SUN.3.91.970829131243.13196G-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019