Cleaned up local heap initialisation.
This commit is contained in:
parent
680919c2e6
commit
ebdb9dc7b4
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "gdi.h"
|
||||
#include "global.h"
|
||||
#include "module.h"
|
||||
#include "psdrv.h"
|
||||
#include "tweak.h"
|
||||
#include "win16drv.h"
|
||||
|
@ -19,22 +18,13 @@
|
|||
*/
|
||||
BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
NE_MODULE *pModule;
|
||||
HINSTANCE16 instance;
|
||||
|
||||
if ( GDI_HeapSel ) return TRUE;
|
||||
|
||||
/* Create GDI heap */
|
||||
pModule = NE_GetPtr( GetModuleHandle16( "GDI" ) );
|
||||
if ( pModule )
|
||||
{
|
||||
GDI_HeapSel = GlobalHandleToSel16( (NE_SEG_TABLE( pModule ) +
|
||||
pModule->dgroup - 1)->hSeg );
|
||||
}
|
||||
else
|
||||
{
|
||||
GDI_HeapSel = GlobalAlloc16( GMEM_FIXED, GDI_HEAP_SIZE );
|
||||
LocalInit16( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
|
||||
}
|
||||
if ((instance = LoadLibrary16( "GDI.EXE" )) < 32) return FALSE;
|
||||
GDI_HeapSel = GlobalHandleToSel16( instance );
|
||||
|
||||
if (!TWEAK_Init()) return FALSE;
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "keyboard.h"
|
||||
#include "menu.h"
|
||||
#include "message.h"
|
||||
#include "module.h"
|
||||
#include "mouse.h"
|
||||
#include "queue.h"
|
||||
#include "spy.h"
|
||||
|
@ -29,23 +28,14 @@
|
|||
*/
|
||||
BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
NE_MODULE *pModule;
|
||||
HINSTANCE16 instance;
|
||||
int queueSize;
|
||||
|
||||
if ( USER_HeapSel ) return TRUE;
|
||||
|
||||
/* Create USER heap */
|
||||
pModule = NE_GetPtr( GetModuleHandle16( "USER" ) );
|
||||
if ( pModule )
|
||||
{
|
||||
USER_HeapSel = GlobalHandleToSel16( (NE_SEG_TABLE( pModule ) +
|
||||
pModule->dgroup - 1)->hSeg );
|
||||
}
|
||||
else
|
||||
{
|
||||
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
|
||||
LocalInit16( USER_HeapSel, 0, 0xffff );
|
||||
}
|
||||
if ((instance = LoadLibrary16( "USER.EXE" )) < 32) return FALSE;
|
||||
USER_HeapSel = GlobalHandleToSel16( instance );
|
||||
|
||||
/* Global atom table initialisation */
|
||||
if (!ATOM_Init( USER_HeapSel )) return FALSE;
|
||||
|
|
Loading…
Reference in New Issue