Added checking for broken font cache.
[wine.git] / loader / main.c
blob44cb3d20c7653925344f4a0aef245cf9d95278cb
1 /*
2 * Main initialization code
3 */
5 #include <assert.h>
6 #include <stdlib.h>
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <fcntl.h>
10 #include <unistd.h>
11 #include <string.h>
12 #include <errno.h>
13 #include "windef.h"
14 #include "wine/winbase16.h"
15 #include "main.h"
16 #include "drive.h"
17 #include "file.h"
18 #include "options.h"
19 #include "process.h"
20 #include "shell.h"
21 #include "debugtools.h"
22 #include "server.h"
23 #include "loadorder.h"
25 DEFAULT_DEBUG_CHANNEL(server);
27 /***********************************************************************
28 * Main initialisation routine
30 BOOL MAIN_MainInit(void)
32 MAIN_WineInit();
34 /* Load the configuration file */
35 if (!PROFILE_LoadWineIni()) return FALSE;
37 /* Initialise DOS drives */
38 if (!DRIVE_Init()) return FALSE;
40 /* Initialise DOS directories */
41 if (!DIR_Init()) return FALSE;
43 /* Registry initialisation */
44 SHELL_LoadRegistry();
46 /* Global boot finished, the rest is process-local */
47 CLIENT_BootDone( TRACE_ON(server) );
49 /* Initialize module loadorder */
50 if (!MODULE_InitLoadOrder()) return FALSE;
52 /* Initialize relay code */
53 if (!RELAY_Init()) return FALSE;
55 return TRUE;
59 /***********************************************************************
60 * ExitKernel16 (KERNEL.2)
62 * Clean-up everything and exit the Wine process.
65 void WINAPI ExitKernel16( void )
67 /* Do the clean-up stuff */
69 WriteOutProfiles16();
70 TerminateProcess( GetCurrentProcess(), 0 );