Enhanced GetCalendarInfo stub, added known CAL_* defines.
[wine.git] / loader / main.c
blob5e46c46fd0fc513d6ece6b322f996f29a6f7b233
1 /*
2 * Main initialization code
3 */
5 #include <locale.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 <stdio.h>
12 #include <string.h>
13 #ifdef MALLOC_DEBUGGING
14 # include <malloc.h>
15 #endif
16 #include "windef.h"
17 #include "wine/winbase16.h"
18 #include "drive.h"
19 #include "file.h"
20 #include "options.h"
21 #include "module.h"
22 #include "debugtools.h"
23 #include "wine/server.h"
25 DEFAULT_DEBUG_CHANNEL(server);
27 extern void SHELL_LoadRegistry(void);
29 /***********************************************************************
30 * Main initialisation routine
32 BOOL MAIN_MainInit(void)
34 #ifdef MALLOC_DEBUGGING
35 char *trace;
37 mcheck(NULL);
38 if (!(trace = getenv("MALLOC_TRACE")))
39 MESSAGE( "MALLOC_TRACE not set. No trace generated\n" );
40 else
42 MESSAGE( "malloc trace goes to %s\n", trace );
43 mtrace();
45 #endif
46 setbuf(stdout,NULL);
47 setbuf(stderr,NULL);
48 setlocale(LC_CTYPE,"");
50 /* Load the configuration file */
51 if (!PROFILE_LoadWineIni()) return FALSE;
53 /* Initialise DOS drives */
54 if (!DRIVE_Init()) return FALSE;
56 /* Initialise DOS directories */
57 if (!DIR_Init()) return FALSE;
59 /* Registry initialisation */
60 SHELL_LoadRegistry();
62 /* Initialize module loadorder */
63 if (CLIENT_IsBootThread()) MODULE_InitLoadOrder();
65 /* Global boot finished, the rest is process-local */
66 CLIENT_BootDone( TRACE_ON(server) );
68 return TRUE;
72 /***********************************************************************
73 * ExitKernel (KERNEL.2)
75 * Clean-up everything and exit the Wine process.
78 void WINAPI ExitKernel16( void )
80 /* Do the clean-up stuff */
82 WriteOutProfiles16();
83 TerminateProcess( GetCurrentProcess(), 0 );