Merged msacm and msacm32 dlls.
[wine] / loader / main.c
1 /*
2  * Main initialization code
3  */
4
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"
24
25 DEFAULT_DEBUG_CHANNEL(server);
26
27 /***********************************************************************
28  *           Main initialisation routine
29  */
30 BOOL MAIN_MainInit(void)
31 {
32     MAIN_WineInit();
33
34     /* Load the configuration file */
35     if (!PROFILE_LoadWineIni()) return FALSE;
36
37     /* Initialise DOS drives */
38     if (!DRIVE_Init()) return FALSE;
39
40     /* Initialise DOS directories */
41     if (!DIR_Init()) return FALSE;
42
43     /* Registry initialisation */
44     SHELL_LoadRegistry();
45     
46     /* Global boot finished, the rest is process-local */
47     CLIENT_BootDone( TRACE_ON(server) );
48
49     /* Initialize module loadorder */
50     if (!MODULE_InitLoadOrder()) return FALSE;
51
52     /* Initialize relay code */
53     if (!RELAY_Init()) return FALSE;
54
55     return TRUE;
56 }
57
58
59 /***********************************************************************
60  *           ExitKernel16 (KERNEL.2)
61  *
62  * Clean-up everything and exit the Wine process.
63  *
64  */
65 void WINAPI ExitKernel16( void )
66 {
67     /* Do the clean-up stuff */
68
69     WriteOutProfiles16();
70     TerminateProcess( GetCurrentProcess(), 0 );
71 }
72