Initializing the console Just-In-Time on CTK startup and starting up the WinPcap before CTK allows WinPcap to print initialization errors (especially a missing command line arg) without clearing the shell output.

This commit is contained in:
oliverschmidt 2007-04-14 14:57:19 +00:00
parent c1b0a3f0d3
commit 3a8fb3ad9f
2 changed files with 13 additions and 5 deletions

View File

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: contiki-main.c,v 1.6 2007/04/11 00:17:25 oliverschmidt Exp $ * $Id: contiki-main.c,v 1.7 2007/04/14 14:57:19 oliverschmidt Exp $
*/ */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@ -55,10 +55,10 @@
#include "program-handler.h" #include "program-handler.h"
PROCINIT(&etimer_process, PROCINIT(&etimer_process,
&wpcap_process,
&cfs_win32_process, &cfs_win32_process,
&ctk_conio_service_process, &ctk_conio_service_process,
&ctk_process, &ctk_process,
&wpcap_process,
&tcpip_process, &tcpip_process,
&resolv_process, &resolv_process,
&program_handler_process); &program_handler_process);
@ -102,8 +102,6 @@ main(void)
procinit_init(); procinit_init();
console_init();
program_handler_add(&directory_dsc, "Directory", 1); program_handler_add(&directory_dsc, "Directory", 1);
program_handler_add(&www_dsc, "Web browser", 1); program_handler_add(&www_dsc, "Web browser", 1);

View File

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: ctk-console.c,v 1.7 2007/04/14 14:28:19 oliverschmidt Exp $ * $Id: ctk-console.c,v 1.8 2007/04/14 14:57:53 oliverschmidt Exp $
*/ */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@ -83,6 +83,12 @@ console_init(void)
{ {
CONSOLE_SCREEN_BUFFER_INFO consoleinfo; CONSOLE_SCREEN_BUFFER_INFO consoleinfo;
CONSOLE_CURSOR_INFO cursorinfo = {1, FALSE}; CONSOLE_CURSOR_INFO cursorinfo = {1, FALSE};
static unsigned char done;
if(done) {
return;
}
done = 1;
stdinhandle = GetStdHandle(STD_INPUT_HANDLE); stdinhandle = GetStdHandle(STD_INPUT_HANDLE);
stdouthandle = GetStdHandle(STD_OUTPUT_HANDLE); stdouthandle = GetStdHandle(STD_OUTPUT_HANDLE);
@ -190,11 +196,15 @@ clrscr(void)
void void
bgcolor(unsigned char c) bgcolor(unsigned char c)
{ {
/* Presume this to be one the first calls. */
console_init();
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void
bordercolor(unsigned char c) bordercolor(unsigned char c)
{ {
/* Presume this to be one the first calls. */
console_init();
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void