diff --git a/platform/win32/contiki-main.c b/platform/win32/contiki-main.c
index 10a4cf29b..7d363a5b8 100644
--- a/platform/win32/contiki-main.c
+++ b/platform/win32/contiki-main.c
@@ -30,7 +30,7 @@
*
* Author: Oliver Schmidt
*
- * $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
@@ -55,10 +55,10 @@
#include "program-handler.h"
PROCINIT(&etimer_process,
+ &wpcap_process,
&cfs_win32_process,
&ctk_conio_service_process,
&ctk_process,
- &wpcap_process,
&tcpip_process,
&resolv_process,
&program_handler_process);
@@ -102,8 +102,6 @@ main(void)
procinit_init();
- console_init();
-
program_handler_add(&directory_dsc, "Directory", 1);
program_handler_add(&www_dsc, "Web browser", 1);
diff --git a/platform/win32/ctk/ctk-console.c b/platform/win32/ctk/ctk-console.c
index 18246a133..8b5df5110 100644
--- a/platform/win32/ctk/ctk-console.c
+++ b/platform/win32/ctk/ctk-console.c
@@ -30,7 +30,7 @@
*
* Author: Oliver Schmidt
*
- * $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
@@ -83,6 +83,12 @@ console_init(void)
{
CONSOLE_SCREEN_BUFFER_INFO consoleinfo;
CONSOLE_CURSOR_INFO cursorinfo = {1, FALSE};
+ static unsigned char done;
+
+ if(done) {
+ return;
+ }
+ done = 1;
stdinhandle = GetStdHandle(STD_INPUT_HANDLE);
stdouthandle = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -190,11 +196,15 @@ clrscr(void)
void
bgcolor(unsigned char c)
{
+ /* Presume this to be one the first calls. */
+ console_init();
}
/*-----------------------------------------------------------------------------------*/
void
bordercolor(unsigned char c)
{
+ /* Presume this to be one the first calls. */
+ console_init();
}
/*-----------------------------------------------------------------------------------*/
void