Cleaned up local heap initialisation.
[wine] / dlls / gdi / gdi_main.c
1 /*
2  * GDI initialization code
3  */
4
5 #include "windef.h"
6 #include "wingdi.h"
7 #include "wine/winbase16.h"
8
9 #include "gdi.h"
10 #include "global.h"
11 #include "psdrv.h"
12 #include "tweak.h"
13 #include "win16drv.h"
14
15
16 /***********************************************************************
17  *           GDI initialisation routine
18  */
19 BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
20 {
21     HINSTANCE16 instance;
22
23     if ( GDI_HeapSel ) return TRUE;
24
25     /* Create GDI heap */
26     if ((instance = LoadLibrary16( "GDI.EXE" )) < 32) return FALSE;
27     GDI_HeapSel = GlobalHandleToSel16( instance );
28
29     if (!TWEAK_Init()) return FALSE;
30
31     /* GDI initialisation */
32     if(!GDI_Init()) return FALSE;
33
34     /* Create the Win16 printer driver */
35     if (!WIN16DRV_Init()) return FALSE;
36
37     /* PSDRV initialization */
38     if(!PSDRV_Init()) return FALSE;
39
40     return TRUE;
41 }