2 * Main initialization code
19 #include "multimedia.h"
24 #include "sysmetrics.h"
42 int __winelib
= 1; /* Winelib run-time flag */
44 /***********************************************************************
45 * Kernel initialisation routine
47 BOOL32
MAIN_KernelInit(void)
49 /* Initialize syslevel handling */
52 /* Initialize signal handling */
53 if (!SIGNAL_Init()) return FALSE
;
55 /* Load the configuration file */
56 if (!PROFILE_LoadWineIni()) return FALSE
;
58 /* Initialize DOS memory */
59 if (!DOSMEM_Init(0)) return FALSE
;
61 /* Initialise DOS drives */
62 if (!DRIVE_Init()) return FALSE
;
64 /* Initialise DOS directories */
65 if (!DIR_Init()) return FALSE
;
67 /* Initialize event handling */
68 if (!EVENT_Init()) return FALSE
;
70 /* Initialize communications */
73 /* Initialize IO-port permissions */
80 /***********************************************************************
81 * USER (and GDI) initialisation routine
83 BOOL32
MAIN_UserInit(void)
87 /* Create USER and GDI heap */
90 USER_HeapSel
= GlobalAlloc16( GMEM_FIXED
, 0x10000 );
91 LocalInit( USER_HeapSel
, 0, 0xffff );
95 GDI_HeapSel
= GlobalAlloc16( GMEM_FIXED
, GDI_HEAP_SIZE
);
96 LocalInit( GDI_HeapSel
, 0, GDI_HEAP_SIZE
-1 );
99 /* Initialize Wine tweaks */
100 if (!TWEAK_Init()) return FALSE
;
102 /* Initialize OEM Bitmaps */
103 if (!OBM_Init()) return FALSE
;
105 /* registry initialisation */
106 SHELL_LoadRegistry();
108 /* Global atom table initialisation */
109 if (!ATOM_Init()) return FALSE
;
111 /* GDI initialisation */
112 if (!GDI_Init()) return FALSE
;
114 /* Initialize system colors and metrics*/
118 /* Create the DCEs */
121 /* Initialize keyboard */
122 if (!KEYBOARD_Init()) return FALSE
;
124 /* Initialize window procedures */
125 if (!WINPROC_Init()) return FALSE
;
127 /* Initialize built-in window classes */
128 if (!WIDGETS_Init()) return FALSE
;
130 /* Initialize dialog manager */
131 if (!DIALOG_Init()) return FALSE
;
133 /* Initialize menus */
134 if (!MENU_Init()) return FALSE
;
136 /* Initialize multimedia */
137 if (!MULTIMEDIA_Init()) return FALSE
;
139 /* Create desktop window */
140 if (!WIN_CreateDesktopWindow()) return FALSE
;
142 /* Initialize message spying */
143 if (!SPY_Init()) return FALSE
;
145 /* Check wine.conf for old/bad entries */
146 if (!TWEAK_CheckConfiguration()) return FALSE
;
148 /* Create system message queue */
149 queueSize
= GetProfileInt32A( "windows", "TypeAhead", 120 );
150 if (!QUEUE_CreateSysMsgQueue( queueSize
)) return FALSE
;
152 /* Set double click time */
153 SetDoubleClickTime32( GetProfileInt32A("windows","DoubleClickSpeed",452) );
159 /***********************************************************************
160 * Winelib initialisation routine
162 BOOL32
MAIN_WinelibInit( int *argc
, char *argv
[] )
164 /* Create the initial process */
165 if (!PROCESS_Init()) return FALSE
;
167 /* Parse command line arguments */
168 MAIN_WineInit( argc
, argv
);
170 /* Initialize the kernel */
171 if (!MAIN_KernelInit()) return FALSE
;
173 /* Initialize all the USER stuff */
174 if (!MAIN_UserInit()) return FALSE
;