Commit ebdb9dc7 authored by Alexandre Julliard's avatar Alexandre Julliard

Cleaned up local heap initialisation.

parent 680919c2
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "gdi.h" #include "gdi.h"
#include "global.h" #include "global.h"
#include "module.h"
#include "psdrv.h" #include "psdrv.h"
#include "tweak.h" #include "tweak.h"
#include "win16drv.h" #include "win16drv.h"
...@@ -19,22 +18,13 @@ ...@@ -19,22 +18,13 @@
*/ */
BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
NE_MODULE *pModule; HINSTANCE16 instance;
if ( GDI_HeapSel ) return TRUE; if ( GDI_HeapSel ) return TRUE;
/* Create GDI heap */ /* Create GDI heap */
pModule = NE_GetPtr( GetModuleHandle16( "GDI" ) ); if ((instance = LoadLibrary16( "GDI.EXE" )) < 32) return FALSE;
if ( pModule ) GDI_HeapSel = GlobalHandleToSel16( instance );
{
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 (!TWEAK_Init()) return FALSE; if (!TWEAK_Init()) return FALSE;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "keyboard.h" #include "keyboard.h"
#include "menu.h" #include "menu.h"
#include "message.h" #include "message.h"
#include "module.h"
#include "mouse.h" #include "mouse.h"
#include "queue.h" #include "queue.h"
#include "spy.h" #include "spy.h"
...@@ -29,23 +28,14 @@ ...@@ -29,23 +28,14 @@
*/ */
BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
NE_MODULE *pModule; HINSTANCE16 instance;
int queueSize; int queueSize;
if ( USER_HeapSel ) return TRUE; if ( USER_HeapSel ) return TRUE;
/* Create USER heap */ /* Create USER heap */
pModule = NE_GetPtr( GetModuleHandle16( "USER" ) ); if ((instance = LoadLibrary16( "USER.EXE" )) < 32) return FALSE;
if ( pModule ) USER_HeapSel = GlobalHandleToSel16( instance );
{
USER_HeapSel = GlobalHandleToSel16( (NE_SEG_TABLE( pModule ) +
pModule->dgroup - 1)->hSeg );
}
else
{
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
LocalInit16( USER_HeapSel, 0, 0xffff );
}
/* Global atom table initialisation */ /* Global atom table initialisation */
if (!ATOM_Init( USER_HeapSel )) return FALSE; if (!ATOM_Init( USER_HeapSel )) return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment