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";
17 #include "selectors.h"
24 #include "directory.h"
28 #include "sysmetrics.h"
42 void init_wine_signals(void);
44 HANDLE32 SystemHeap
= 0;
46 /***********************************************************************
47 * Main initialisation routine
51 extern BOOL
RELAY_Init(void);
55 /* Create the system heap */
56 if (!(SystemHeap
= HeapCreate( HEAP_GROWABLE
, 0x10000, 0 ))) return 0;
58 /* Load the configuration file */
59 if (!PROFILE_LoadWineIni()) return 0;
61 /* Initialize message spying */
62 if (!SPY_Init()) return 0;
65 /* Initialize relay code */
66 if (!RELAY_Init()) return 0;
68 /* Create built-in modules */
69 if (!BUILTIN_Init()) return 0;
72 /* Initialise DOS drives */
73 if (!DRIVE_Init()) return 0;
75 /* Initialise DOS directories */
76 if (!DIR_Init()) return 0;
78 /* Initialize tasks */
79 if (!TASK_Init()) return 0;
81 /* Initialize communications */
85 /* Initialize interrupt vectors */
86 if (!INT_Init()) return 0;
88 /* Initialize DOS memory */
89 if (!DOSMEM_Init()) return 0;
91 /* Initialize signal handling */
94 /* Initialize the DOS memory */
95 if (!INT21_Init()) return 0;
98 /* Global atom table initialisation */
99 if (!ATOM_Init()) return 0;
101 /* GDI initialisation */
102 if (!GDI_Init()) return 0;
104 /* Initialise window procedures aliases */
105 if (!ALIAS_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 (!QUEUE_CreateSysMsgQueue( queueSize
)) return 0;
127 /* Set double click time */
128 SetDoubleClickTime( GetProfileInt( "windows", "DoubleClickSpeed", 452 ) );
135 /**********************************************************************
138 int _WinMain(int argc
, char **argv
)
143 if (!MAIN_Init()) return 0;
145 for (i
= 1; i
< argc
; i
++)
147 if ((handle
= WinExec( argv
[i
], SW_SHOWNORMAL
)) < 32)
149 fprintf(stderr
, "wine: can't exec '%s': ", argv
[i
]);
152 case 2: fprintf( stderr
, "file not found\n" ); break;
153 case 11: fprintf( stderr
, "invalid exe file\n" ); break;
154 case 21: fprintf( stderr
, "win32 executable\n" ); break;
155 default: fprintf( stderr
, "error=%d\n", handle
); break;
161 if (Options
.debug
) DEBUG_SetBreakpoints( TRUE
); /* Setup breakpoints */
163 Yield(); /* Start the first task */
164 fprintf( stderr
, "WinMain: Should never happen: returned from Yield()\n" );
168 #endif /* #ifndef WINELIB */