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"
25 #include "sysmetrics.h"
40 void init_wine_signals(void);
43 /***********************************************************************
44 * Main initialisation routine
48 extern BOOL RELAY_Init(void);
49 extern BOOL RELAY32_Init(void);
56 /* Initialize relay code */
57 if (!RELAY_Init()) return 0;
59 /* Initialize Win32 relay code */
60 if (!RELAY32_Init()) return 0;
63 /* Create built-in modules */
64 if (!MODULE_Init()) return 0;
66 /* Initialize the DOS file system */
69 /* Initialize tasks */
70 if (!TASK_Init()) return 0;
73 /* Initialize interrupt vectors */
74 if (!INT_Init()) return 0;
76 /* Initialize DOS memory */
77 if (!DOSMEM_Init()) return 0;
79 /* Initialize signal handling */
83 /* Initialize communications */
87 /* Initialize the DOS memory */
90 /* Create USER heap */
91 if (!USER_HeapInit()) return 0;
94 /* Global atom table initialisation */
95 if (!ATOM_Init()) return 0;
97 /* GDI initialisation */
98 if (!GDI_Init()) return 0;
100 /* Initialize system colors and metrics*/
104 /* Create the DCEs */
107 /* Initialize dialog manager */
108 if (!DIALOG_Init()) return 0;
110 /* Initialize menus */
111 if (!MENU_Init()) return 0;
113 /* Initialize Win32 data structures */
114 if (!KERN32_Init()) return 0;
116 /* Create system message queue */
117 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
118 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
125 /**********************************************************************
128 int _WinMain(int argc, char **argv)
133 if (!MAIN_Init()) return 0;
135 for (i = 1; i < argc; i++)
137 if ((handle = WinExec( argv[i], SW_SHOWNORMAL )) < 32)
139 fprintf(stderr, "wine: can't exec '%s': ", argv[i]);
142 case 2: fprintf( stderr, "file not found\n" ); break;
143 case 11: fprintf( stderr, "invalid exe file\n" ); break;
144 case 21: fprintf( stderr, "win32 executable\n" ); break;
145 default: fprintf( stderr, "error=%d\n", handle ); break;
151 if (Options.debug) DEBUG_SetBreakpoints( TRUE ); /* Setup breakpoints */
153 Yield(); /* Start the first task */
154 fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
158 #endif /* #ifndef WINELIB */