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;
57 /* Initialize message spying */
58 if (!SPY_Init()) return 0;
61 /* Initialize relay code */
62 if (!RELAY_Init()) return 0;
64 /* Initialize Win32 relay code */
65 if (!RELAY32_Init()) return 0;
68 /* Create built-in modules */
69 if (!MODULE_Init()) return 0;
71 /* Initialise DOS drives */
72 if (!DRIVE_Init()) return 0;
74 /* Initialise DOS directories */
75 if (!DIR_Init()) return 0;
77 /* Initialize tasks */
78 if (!TASK_Init()) return 0;
80 /* Initialize communications */
84 /* Initialize interrupt vectors */
85 if (!INT_Init()) return 0;
87 /* Initialize DOS memory */
88 if (!DOSMEM_Init()) return 0;
90 /* Initialize signal handling */
93 /* Initialize the DOS memory */
94 if (!INT21_Init()) return 0;
96 /* Create USER heap */
97 if (!USER_HeapInit()) return 0;
100 /* Global atom table initialisation */
101 if (!ATOM_Init()) return 0;
103 /* GDI initialisation */
104 if (!GDI_Init()) return 0;
106 /* Initialize system colors and metrics*/
110 /* Create the DCEs */
113 /* Initialize dialog manager */
114 if (!DIALOG_Init()) return 0;
116 /* Initialize menus */
117 if (!MENU_Init()) return 0;
119 /* Initialize Win32 data structures */
120 if (!KERN32_Init()) return 0;
122 /* Create system message queue */
123 queueSize
= GetProfileInt( "windows", "TypeAhead", 120 );
124 if (!QUEUE_CreateSysMsgQueue( queueSize
)) return 0;
126 /* Set double click time */
127 SetDoubleClickTime( GetProfileInt( "windows", "DoubleClickSpeed", 452 ) );
134 /**********************************************************************
137 int _WinMain(int argc
, char **argv
)
142 if (!MAIN_Init()) return 0;
144 for (i
= 1; i
< argc
; i
++)
146 if ((handle
= WinExec( argv
[i
], SW_SHOWNORMAL
)) < 32)
148 fprintf(stderr
, "wine: can't exec '%s': ", argv
[i
]);
151 case 2: fprintf( stderr
, "file not found\n" ); break;
152 case 11: fprintf( stderr
, "invalid exe file\n" ); break;
153 case 21: fprintf( stderr
, "win32 executable\n" ); break;
154 default: fprintf( stderr
, "error=%d\n", handle
); break;
160 if (Options
.debug
) DEBUG_SetBreakpoints( TRUE
); /* Setup breakpoints */
162 Yield(); /* Start the first task */
163 fprintf( stderr
, "WinMain: Should never happen: returned from Yield()\n" );
167 #endif /* #ifndef WINELIB */