2 * Main initialization code
19 #include "multimedia.h"
24 #include "sysmetrics.h"
41 int __winelib
= 1; /* Winelib run-time flag */
43 /***********************************************************************
44 * Kernel initialisation routine
46 BOOL32
MAIN_KernelInit(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)
83 /* Create USER and GDI heap */
86 USER_HeapSel
= GlobalAlloc16( GMEM_FIXED
, 0x10000 );
87 LocalInit( USER_HeapSel
, 0, 0xffff );
91 GDI_HeapSel
= GlobalAlloc16( GMEM_FIXED
, GDI_HEAP_SIZE
);
92 LocalInit( GDI_HeapSel
, 0, GDI_HEAP_SIZE
-1 );
95 /* Initialize Wine tweaks */
96 if (!TWEAK_Init()) return FALSE
;
98 /* Initialize OEM Bitmaps */
99 if (!OBM_Init()) return FALSE
;
101 /* registry initialisation */
102 SHELL_LoadRegistry();
104 /* Global atom table initialisation */
105 if (!ATOM_Init()) return FALSE
;
107 /* GDI initialisation */
108 if (!GDI_Init()) return FALSE
;
110 /* Initialize system colors and metrics*/
114 /* Create the DCEs */
117 /* Initialize keyboard */
118 if (!KEYBOARD_Init()) return FALSE
;
120 /* Initialize window procedures */
121 if (!WINPROC_Init()) return FALSE
;
123 /* Initialize built-in window classes */
124 if (!WIDGETS_Init()) return FALSE
;
126 /* Initialize dialog manager */
127 if (!DIALOG_Init()) return FALSE
;
129 /* Initialize menus */
130 if (!MENU_Init()) return FALSE
;
132 /* Initialize multimedia */
133 if (!MULTIMEDIA_Init()) return FALSE
;
135 /* Create desktop window */
136 if (!WIN_CreateDesktopWindow()) return FALSE
;
138 /* Initialize message spying */
139 if (!SPY_Init()) return FALSE
;
141 /* Check wine.conf for old/bad entries */
142 if (!TWEAK_CheckConfiguration()) return FALSE
;
144 /* Create system message queue */
145 queueSize
= GetProfileInt32A( "windows", "TypeAhead", 120 );
146 if (!QUEUE_CreateSysMsgQueue( queueSize
)) return FALSE
;
148 /* Set double click time */
149 SetDoubleClickTime32( GetProfileInt32A("windows","DoubleClickSpeed",452) );
155 /***********************************************************************
156 * Winelib initialisation routine
158 BOOL32
MAIN_WinelibInit( int *argc
, char *argv
[] )
160 /* Create the initial process */
161 if (!PROCESS_Init()) return FALSE
;
163 /* Parse command line arguments */
164 MAIN_WineInit( argc
, argv
);
166 /* Initialize the kernel */
167 if (!MAIN_KernelInit()) return FALSE
;
169 /* Initialize all the USER stuff */
170 if (!MAIN_UserInit()) return FALSE
;