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"
23 #include "directory.h"
27 #include "sysmetrics.h"
41 void init_wine_signals(void);
44 /***********************************************************************
45 * Main initialisation routine
49 extern BOOL RELAY_Init(void);
50 extern BOOL RELAY32_Init(void);
54 /* Load the configuration file */
55 if (!PROFILE_LoadWineIni()) return 0;
60 /* Initialize relay code */
61 if (!RELAY_Init()) return 0;
63 /* Initialize Win32 relay code */
64 if (!RELAY32_Init()) return 0;
67 /* Create built-in modules */
68 if (!MODULE_Init()) return 0;
70 /* Initialise DOS drives */
71 if (!DRIVE_Init()) return 0;
73 /* Initialise DOS directories */
74 if (!DIR_Init()) return 0;
76 /* Initialize tasks */
77 if (!TASK_Init()) return 0;
80 /* Initialize interrupt vectors */
81 if (!INT_Init()) return 0;
83 /* Initialize DOS memory */
84 if (!DOSMEM_Init()) return 0;
86 /* Initialize signal handling */
90 /* Initialize communications */
94 /* Initialize the DOS memory */
95 if (!INT21_Init()) return 0;
97 /* Create USER heap */
98 if (!USER_HeapInit()) return 0;
101 /* Global atom table initialisation */
102 if (!ATOM_Init()) return 0;
104 /* GDI initialisation */
105 if (!GDI_Init()) return 0;
107 /* Initialize system colors and metrics*/
111 /* Create the DCEs */
114 /* Initialize dialog manager */
115 if (!DIALOG_Init()) return 0;
117 /* Initialize menus */
118 if (!MENU_Init()) return 0;
120 /* Initialize Win32 data structures */
121 if (!KERN32_Init()) return 0;
123 /* Create system message queue */
124 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
125 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
132 /**********************************************************************
135 int _WinMain(int argc, char **argv)
140 if (!MAIN_Init()) return 0;
142 for (i = 1; i < argc; i++)
144 if ((handle = WinExec( argv[i], SW_SHOWNORMAL )) < 32)
146 fprintf(stderr, "wine: can't exec '%s': ", argv[i]);
149 case 2: fprintf( stderr, "file not found\n" ); break;
150 case 11: fprintf( stderr, "invalid exe file\n" ); break;
151 case 21: fprintf( stderr, "win32 executable\n" ); break;
152 default: fprintf( stderr, "error=%d\n", handle ); break;
158 if (Options.debug) DEBUG_SetBreakpoints( TRUE ); /* Setup breakpoints */
160 Yield(); /* Start the first task */
161 fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
165 #endif /* #ifndef WINELIB */