[AD] This Allegro app can freeze under Windows 2000

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Attatched is a test-program that can freeze the system under Windows 2000. When running, move the mouse around. Eventually, the program should lock-up and appear inactive. To get out of it when this happens: Press CTRL-ALT-DEL, wait a few seconds and the "Windows security" dialog should appear. Press ALT-T to go to the task-manager, and ALT-E to end the task (if the "applications" tab of the task manager is not the active tab, press CTRL-TAB to cycle through the tabs). However sometimes when the task is ended, the machine reboots. I strongly recommend you save all unsaved data in your open applications before you try this.

The values of TERECTW, TERECTH and TEDRAWSOMETHINGITERATIONS might have to be tweaked to get the freeze to occur.

I am using a 600MhZ Athlon with a Matrox Marvel G400TV Graphocs card. The freeze only happens under Windows 2000. I have so far not been able to reproduce it under Windows 98.


AE.


/***************************************************************************
 *
 * freezetest.c
 * Test program to show the app freezing under Windows 2000 when the mouse enters a rectangle.
 *
 **************************************************************************/


/****************************************************************************
 Includes
 */

#include <allegro.h>


/****************************************************************************
  Types
 */

typedef int TeBool;


/****************************************************************************
 Defines
 */

/* These may need to be tweaked to get the app to freeze */

#define TERECTW 125
#define TERECTH 125

#define TEDRAWSOMETHINGITERATIONS 20






void
teDrawSomething(int x1, int y1)
{
	int nI;

	for(nI=0;nI<TEDRAWSOMETHINGITERATIONS;nI++)
	{
		rectfill(screen,x1+nI,y1+nI,x1+TERECTW-nI,y1+TERECTH-nI,nI);
		circlefill(screen,x1+TERECTW/2,y1+TERECTH/2,(MIN(TERECTW,TERECTH)/2)-(nI+2),nI+1);
	}

}



void
teDoTest()
{

	set_gfx_mode(GFX_DIRECTX, 640, 480, 0, 0);

	
		
	set_palette(desktop_palette);


	show_mouse(screen);


	while(!key[KEY_ESC] && !key[KEY_SPACE])
	{


		vsync();


		acquire_bitmap(screen);

		scare_mouse();

		teDrawSomething(50,0);
		teDrawSomething(200,0);
		teDrawSomething(350,0);
		teDrawSomething(500,0);

		teDrawSomething(50,150);
		teDrawSomething(200,150);
		teDrawSomething(350,150);
		teDrawSomething(500,150);

		teDrawSomething(50,300);
		teDrawSomething(200,300);
		teDrawSomething(350,300);
		teDrawSomething(500,300);


		unscare_mouse();

		release_bitmap(screen);

	}



	show_mouse(NULL);

}



TeBool
teSetup()
{
	if(allegro_init())
	{
		TRACE("Error Initialising Allegro.\n");
		return FALSE;
	}


	if(install_keyboard())
	{
		TRACE("Error Initialising Keyboard.\n");
		return FALSE;
	}


	if(install_timer())
	{
		TRACE("Error Initialising Timer.\n");
		return FALSE;
	}


	if(install_mouse() == -1)
	{
		TRACE("Error Initialising Mouse.\n");
		return FALSE;
	}

	

	return TRUE;
}



void
teCleanUp()
{
	remove_mouse();
	remove_timer();
	remove_keyboard();

	allegro_exit();
}



int main(void)
{
	if(!teSetup())
	{
		teCleanUp();
		return -1;
	}


	teDoTest();


	teCleanUp();

	return 0;
}
END_OF_MAIN();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/