Beispiel #1
0
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
  ReserveBottomMemory();
  
  app::Application app(hInstance,lpCmdLine,nShowCmd);
  //app.InitConsole();
  
  return app.Run();
}
Beispiel #2
0
int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShowCmd)
{
	ReserveBottomMemory();

	tick_thd.Start();

	int argc=0;
	wchar* cmd_line=GetCommandLineA();
	wchar** argv=CommandLineToArgvA(cmd_line,&argc);
	if(strstr(cmd_line,"NoConsole")==0)
	{
		if (AllocConsole())
		{
			freopen("CON","w",stdout);
			freopen("CON","w",stderr);
			freopen("CON","r",stdin);
		}
		SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE );
	}

	SetupPath();

	//SetUnhandledExceptionFilter(&ExeptionHandler);
	__try
	{
		int dc_init(int argc,wchar* argv[]);
		void dc_run();
		void dc_term();
		dc_init(argc,argv);

		#ifdef _WIN64
				setup_seh();
		#endif

		dc_run();
		dc_term();
	}
	__except( ExeptionHandler(GetExceptionInformation()) )
	{
		printf("Unhandled exception - Emulation thread halted...\n");
	}
	SetUnhandledExceptionFilter(0);

	return 0;
}
BottomMemoryAllocator::BottomMemoryAllocator()
{
	ReserveBottomMemory();
}