2 static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
3 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
16 #include "selectors.h"
24 #include "sysmetrics.h"
39 /***********************************************************************
40 * Main initialisation routine
44 extern BOOL RELAY_Init(void);
45 extern BOOL RELAY32_Init(void);
51 /* Initialize relay code */
52 if (!RELAY_Init()) return 0;
54 /* Initialize Win32 relay code */
55 if (!RELAY32_Init()) return 0;
57 /* Create built-in modules */
58 if (!MODULE_Init()) return 0;
60 /* Initialize tasks */
61 if (!TASK_Init()) return 0;
63 /* Initialize interrupt vectors */
64 if (!INT_Init()) return 0;
66 /* Initialize the DOS file system */
69 /* Create DOS environment */
72 /* Initialize signal handling */
75 /* Initialize communications */
79 /* Initialize the DOS memory */
82 /* Create USER heap */
83 if (!USER_HeapInit()) return 0;
86 /* Global atom table initialisation */
87 if (!ATOM_Init()) return 0;
89 /* GDI initialisation */
90 if (!GDI_Init()) return 0;
92 /* Initialize system colors and metrics*/
99 /* Initialize dialog manager */
100 if (!DIALOG_Init()) return 0;
102 /* Initialize menus */
103 if (!MENU_Init()) return 0;
105 /* Create system message queue */
106 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
107 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
114 /**********************************************************************
117 int _WinMain(int argc, char **argv)
122 if (!MAIN_Init()) return 0;
124 for (i = 1; i < argc; i++)
126 if ((handle = WinExec( argv[i], SW_SHOWNORMAL )) < 32)
128 fprintf(stderr, "wine: can't exec '%s': ", argv[i]);
131 case 2: fprintf( stderr, "file not found\n" ); break;
132 case 11: fprintf( stderr, "invalid exe file\n" ); break;
133 case 21: fprintf( stderr, "win32 executable\n" ); break;
134 default: fprintf( stderr, "error=%d\n", handle ); break;
140 if (Options.debug) DEBUG_SetBreakpoints( TRUE ); /* Setup breakpoints */
142 Yield(); /* Start the first task */
143 fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
147 #endif /* #ifndef WINELIB */