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);
57 /* Initialize relay code */
58 if (!RELAY_Init()) return 0;
60 /* Initialize Win32 relay code */
61 if (!RELAY32_Init()) return 0;
64 /* Create built-in modules */
65 if (!MODULE_Init()) return 0;
67 /* Initialise DOS drives */
68 if (!DRIVE_Init()) return 0;
70 /* Initialise DOS directories */
71 if (!DIR_Init()) return 0;
73 /* Initialize tasks */
74 if (!TASK_Init()) return 0;
77 /* Initialize interrupt vectors */
78 if (!INT_Init()) return 0;
80 /* Initialize DOS memory */
81 if (!DOSMEM_Init()) return 0;
83 /* Initialize signal handling */
87 /* Initialize communications */
91 /* Initialize the DOS memory */
94 /* Create USER heap */
95 if (!USER_HeapInit()) return 0;
98 /* Global atom table initialisation */
99 if (!ATOM_Init()) return 0;
101 /* GDI initialisation */
102 if (!GDI_Init()) return 0;
104 /* Initialize system colors and metrics*/
108 /* Create the DCEs */
111 /* Initialize dialog manager */
112 if (!DIALOG_Init()) return 0;
114 /* Initialize menus */
115 if (!MENU_Init()) return 0;
117 /* Initialize Win32 data structures */
118 if (!KERN32_Init()) return 0;
120 /* Create system message queue */
121 queueSize
= GetProfileInt( "windows", "TypeAhead", 120 );
122 if (!MSG_CreateSysMsgQueue( queueSize
)) return 0;
129 /**********************************************************************
132 int _WinMain(int argc
, char **argv
)
137 if (!MAIN_Init()) return 0;
139 for (i
= 1; i
< argc
; i
++)
141 if ((handle
= WinExec( argv
[i
], SW_SHOWNORMAL
)) < 32)
143 fprintf(stderr
, "wine: can't exec '%s': ", argv
[i
]);
146 case 2: fprintf( stderr
, "file not found\n" ); break;
147 case 11: fprintf( stderr
, "invalid exe file\n" ); break;
148 case 21: fprintf( stderr
, "win32 executable\n" ); break;
149 default: fprintf( stderr
, "error=%d\n", handle
); break;
155 if (Options
.debug
) DEBUG_SetBreakpoints( TRUE
); /* Setup breakpoints */
157 Yield(); /* Start the first task */
158 fprintf( stderr
, "WinMain: Should never happen: returned from Yield()\n" );
162 #endif /* #ifndef WINELIB */