Fixed Win16 documentation not fixed because of a bug in winapi_check.
[wine] / loader / main.c
1 /*
2  * Main initialization code
3  */
4
5 #include <stdlib.h>
6 #include <sys/types.h>
7 #include <sys/stat.h>
8 #include <fcntl.h>
9 #include <unistd.h>
10 #include <string.h>
11 #include "windef.h"
12 #include "wine/winbase16.h"
13 #include "main.h"
14 #include "drive.h"
15 #include "file.h"
16 #include "options.h"
17 #include "debugtools.h"
18 #include "server.h"
19 #include "loadorder.h"
20
21 DEFAULT_DEBUG_CHANNEL(server);
22
23 /***********************************************************************
24  *           Main initialisation routine
25  */
26 BOOL MAIN_MainInit(void)
27 {
28     MAIN_WineInit();
29
30     /* Load the configuration file */
31     if (!PROFILE_LoadWineIni()) return FALSE;
32
33     /* Initialise DOS drives */
34     if (!DRIVE_Init()) return FALSE;
35
36     /* Initialise DOS directories */
37     if (!DIR_Init()) return FALSE;
38
39     /* Registry initialisation */
40     SHELL_LoadRegistry();
41     
42     /* Global boot finished, the rest is process-local */
43     CLIENT_BootDone( TRACE_ON(server) );
44
45     /* Initialize module loadorder */
46     if (!MODULE_InitLoadOrder()) return FALSE;
47
48     /* Initialize relay code */
49     if (!RELAY_Init()) return FALSE;
50
51     return TRUE;
52 }
53
54
55 /***********************************************************************
56  *           ExitKernel16 (KERNEL.2)
57  *
58  * Clean-up everything and exit the Wine process.
59  *
60  */
61 void WINAPI ExitKernel16( void )
62 {
63     /* Do the clean-up stuff */
64
65     WriteOutProfiles16();
66     TerminateProcess( GetCurrentProcess(), 0 );
67 }
68