Mail Archives: djgpp/1993/12/10/04:11:49
The following code shows that there is something wrong with the Ctrl-Break check
in 1.11. Compile and run it; then press Ctrl-Break a couple of times and it
will crash with an exception 0x16. I have only seen crashes when int86/intdos
was used where Ctrl-Break is pressed.
=============================================================================
/* Modified samples/ctrlbrk.c */
#include <stdio.h>
#include <pc.h>
#include <go32.h>
#include <dos.h>
int main()
{
char c;
printf("waiting and polling - press Ctrl-Break to step a counter,\n");
printf("any other key to go on, 's' to stop.\n");
do
{
_go32_want_ctrl_break(1);
while (!kbhit())
{
union REGS regs;
regs.h.ah = 1; /* Harmless check for stroke. */
int86 (0x16, ®s, ®s);
}
printf("Ctrl-break was pressed %d time(s).\n",
_go32_was_ctrl_break_hit());
c= getkey();
}
while (c != 's');
return 0;
}
=============================================================================
Morten Welinder
terra AT diku DOT dk
- Raw text -