Commit 796346f8 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Get rid of the 16-bit heap support.

parent db79a9f2
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
371 pascal -ret16 SetWindowPlacement(word ptr) SetWindowPlacement16 371 pascal -ret16 SetWindowPlacement(word ptr) SetWindowPlacement16
372 stub GetInternalIconHeader 372 stub GetInternalIconHeader
373 pascal -ret16 SubtractRect(ptr ptr ptr) SubtractRect16 373 pascal -ret16 SubtractRect(ptr ptr ptr) SubtractRect16
#374 DllEntryPoint 374 pascal -ret16 DllEntryPoint(long word word word long word)
375 stub DrawTextEx 375 stub DrawTextEx
376 stub SetMessageExtraInfo 376 stub SetMessageExtraInfo
378 stub SetPropEx 378 stub SetPropEx
......
...@@ -56,6 +56,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user); ...@@ -56,6 +56,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user);
WORD WINAPI DestroyIcon32(HGLOBAL16, UINT16); WORD WINAPI DestroyIcon32(HGLOBAL16, UINT16);
WORD USER_HeapSel = 0; /* USER heap selector */
struct gray_string_info struct gray_string_info
{ {
...@@ -1206,6 +1207,20 @@ BOOL16 WINAPI SubtractRect16( LPRECT16 dest, const RECT16 *src1, ...@@ -1206,6 +1207,20 @@ BOOL16 WINAPI SubtractRect16( LPRECT16 dest, const RECT16 *src1,
/********************************************************************** /**********************************************************************
* DllEntryPoint (USER.374)
*/
BOOL WINAPI DllEntryPoint( DWORD reason, HINSTANCE16 inst, WORD ds,
WORD heap, DWORD reserved1, WORD reserved2 )
{
if (reason != DLL_PROCESS_ATTACH) return TRUE;
if (USER_HeapSel) return TRUE; /* already called */
USER_HeapSel = ds;
return TRUE;
}
/**********************************************************************
* SetMenuContextHelpId (USER.384) * SetMenuContextHelpId (USER.384)
*/ */
BOOL16 WINAPI SetMenuContextHelpId16( HMENU16 hMenu, DWORD dwContextHelpID) BOOL16 WINAPI SetMenuContextHelpId16( HMENU16 hMenu, DWORD dwContextHelpID)
......
...@@ -36,7 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(graphics); ...@@ -36,7 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(graphics);
#define DESKTOP_ALL_ACCESS 0x01ff #define DESKTOP_ALL_ACCESS 0x01ff
WORD USER_HeapSel = 0; /* USER heap selector */
HMODULE user32_module = 0; HMODULE user32_module = 0;
static SYSLEVEL USER_SysLevel; static SYSLEVEL USER_SysLevel;
...@@ -267,15 +266,7 @@ static void winstation_init(void) ...@@ -267,15 +266,7 @@ static void winstation_init(void)
*/ */
static BOOL process_attach(void) static BOOL process_attach(void)
{ {
HINSTANCE16 instance; LoadLibrary16( "user.exe" );
/* Create USER heap */
if ((instance = LoadLibrary16( "USER.EXE" )) >= 32) USER_HeapSel = instance | 7;
else
{
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 65536 );
LocalInit16( USER_HeapSel, 32, 65534 );
}
/* some Win9x dlls expect keyboard to be loaded */ /* some Win9x dlls expect keyboard to be loaded */
if (GetVersion() & 0x80000000) LoadLibrary16( "keyboard.drv" ); if (GetVersion() & 0x80000000) LoadLibrary16( "keyboard.drv" );
......
...@@ -29,55 +29,9 @@ ...@@ -29,55 +29,9 @@
#include "winreg.h" #include "winreg.h"
#include "winternl.h" #include "winternl.h"
#include "wine/windef16.h" #include "wine/windef16.h"
#include "wine/winbase16.h"
extern WORD USER_HeapSel DECLSPEC_HIDDEN; extern WORD USER_HeapSel DECLSPEC_HIDDEN;
static inline HLOCAL16 LOCAL_Alloc( HANDLE16 ds, UINT16 flags, WORD size )
{
STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
HANDLE16 oldDS = stack16->ds;
HLOCAL16 ret;
stack16->ds = ds;
ret = LocalAlloc16 (flags, size);
stack16->ds = oldDS;
return ret;
}
static inline HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, UINT16 flags )
{
STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
HANDLE16 oldDS = stack16->ds;
HLOCAL16 ret;
stack16->ds = ds;
ret = LocalReAlloc16 (handle, size, flags);
stack16->ds = oldDS;
return ret;
}
static inline HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle )
{
STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
HANDLE16 oldDS = stack16->ds;
HLOCAL16 ret;
stack16->ds = ds;
ret = LocalFree16 (handle);
stack16->ds = oldDS;
return ret;
}
#define USER_HEAP_ALLOC(size) \
((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
#define USER_HEAP_REALLOC(handle,size) \
((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
#define USER_HEAP_FREE(handle) \
LOCAL_Free( USER_HeapSel, LOWORD(handle) )
#define USER_HEAP_LIN_ADDR(handle) \
((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
#define GET_WORD(ptr) (*(const WORD *)(ptr)) #define GET_WORD(ptr) (*(const WORD *)(ptr))
#define GET_DWORD(ptr) (*(const DWORD *)(ptr)) #define GET_DWORD(ptr) (*(const DWORD *)(ptr))
......
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