2 * Main initialization code
23 #include "sysmetrics.h"
39 int __winelib
= 1; /* Winelib run-time flag */
41 /***********************************************************************
42 * Kernel initialisation routine
44 BOOL32
MAIN_KernelInit(void)
46 extern BOOL32
EVENT_Init(void);
48 /* Initialize signal handling */
49 if (!SIGNAL_Init()) return FALSE
;
51 /* Load the configuration file */
52 if (!PROFILE_LoadWineIni()) return FALSE
;
54 /* Initialize DOS memory */
55 if (!DOSMEM_Init()) return FALSE
;
57 /* Initialise DOS drives */
58 if (!DRIVE_Init()) return FALSE
;
60 /* Initialise DOS directories */
61 if (!DIR_Init()) return FALSE
;
63 /* Initialize event handling */
64 if (!EVENT_Init()) return FALSE
;
66 /* Initialize communications */
69 /* Initialize IO-port permissions */
76 /***********************************************************************
77 * USER (and GDI) initialisation routine
79 BOOL32
MAIN_UserInit(void)
81 extern BOOL32
WIDGETS_Init(void);
82 extern BOOL32
MULTIMEDIA_Init(void);
86 /* Create USER and GDI heap */
89 USER_HeapSel
= GlobalAlloc16( GMEM_FIXED
, 0x10000 );
90 LocalInit( USER_HeapSel
, 0, 0xffff );
94 GDI_HeapSel
= GlobalAlloc16( GMEM_FIXED
, GDI_HEAP_SIZE
);
95 LocalInit( GDI_HeapSel
, 0, GDI_HEAP_SIZE
-1 );
98 /* Initialize Wine tweaks */
99 if (!TWEAK_Init()) return FALSE
;
101 /* Initialize OEM Bitmaps */
102 if (!OBM_Init()) return FALSE
;
104 /* registry initialisation */
105 SHELL_LoadRegistry();
107 /* Global atom table initialisation */
108 if (!ATOM_Init()) return FALSE
;
110 /* GDI initialisation */
111 if (!GDI_Init()) return FALSE
;
113 /* Initialize system colors and metrics*/
117 /* Create the DCEs */
120 /* Initialize keyboard */
121 if (!KEYBOARD_Init()) return FALSE
;
123 /* Initialize window procedures */
124 if (!WINPROC_Init()) return FALSE
;
126 /* Initialize built-in window classes */
127 if (!WIDGETS_Init()) return FALSE
;
129 /* Initialize dialog manager */
130 if (!DIALOG_Init()) return FALSE
;
132 /* Initialize menus */
133 if (!MENU_Init()) return FALSE
;
135 /* Initialize multimedia */
136 if (!MULTIMEDIA_Init()) return FALSE
;
138 /* Create desktop window */
139 if (!WIN_CreateDesktopWindow()) return FALSE
;
141 /* Initialize message spying */
142 if (!SPY_Init()) return FALSE
;
144 /* Check wine.conf for old/bad entries */
145 if (!TWEAK_CheckConfiguration()) return FALSE
;
147 /* Create system message queue */
148 queueSize
= GetProfileInt32A( "windows", "TypeAhead", 120 );
149 if (!QUEUE_CreateSysMsgQueue( queueSize
)) return FALSE
;
151 /* Set double click time */
152 SetDoubleClickTime32( GetProfileInt32A("windows","DoubleClickSpeed",452) );
158 /***********************************************************************
159 * Winelib initialisation routine
161 BOOL32
MAIN_WinelibInit( int *argc
, char *argv
[] )
163 extern BOOL32
PROCESS_Init(void);
165 /* Create the initial process */
166 if (!PROCESS_Init()) return FALSE
;
168 /* Parse command line arguments */
169 MAIN_WineInit( argc
, argv
);
171 /* Initialize the kernel */
172 if (!MAIN_KernelInit()) return FALSE
;
174 /* Initialize all the USER stuff */
175 if (!MAIN_UserInit()) return FALSE
;