Do not change the WS_CHILD style in SetParent.
[wine.git] / loader / main.c
blobea1a70769f6a8ae61d9902867046aeeec9a97e3d
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( char *argv[] )
32 /* store the program name */
33 argv0 = argv[0];
35 /* Create the initial process */
36 if (!PROCESS_Init()) return FALSE;
38 /* Parse command line arguments */
39 OPTIONS_ParseOptions( argv );
40 MAIN_WineInit();
42 /* Load the configuration file */
43 if (!PROFILE_LoadWineIni()) return FALSE;
45 /* Initialise DOS drives */
46 if (!DRIVE_Init()) return FALSE;
48 /* Initialise DOS directories */
49 if (!DIR_Init()) return FALSE;
51 /* Registry initialisation */
52 SHELL_LoadRegistry();
54 /* Global boot finished, the rest is process-local */
55 CLIENT_BootDone( TRACE_ON(server) );
57 /* Initialize module loadorder */
58 if (!MODULE_InitLoadOrder()) return FALSE;
60 /* Initialize relay code */
61 if (!RELAY_Init()) return FALSE;
63 return TRUE;
67 /***********************************************************************
68 * ExitKernel16 (KERNEL.2)
70 * Clean-up everything and exit the Wine process.
73 void WINAPI ExitKernel16( void )
75 /* Do the clean-up stuff */
77 WriteOutProfiles16();
78 TerminateProcess( GetCurrentProcess(), 0 );