user.exe: Store the GDI instance when it's first loaded.

This commit is contained in:
Alexandre Julliard 2010-05-24 23:35:37 +02:00
parent 598a25de82
commit a157959dbe

View file

@ -60,6 +60,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(user);
WORD USER_HeapSel = 0; /* USER heap selector */
static HINSTANCE16 gdi_inst;
struct gray_string_info
{
GRAYSTRINGPROC16 proc;
@ -1760,11 +1762,8 @@ WORD WINAPI GetFreeSystemResources16( WORD resType )
{
STACK16FRAME* stack16 = MapSL((SEGPTR)NtCurrentTeb()->WOW32Reserved);
HANDLE16 oldDS = stack16->ds;
HINSTANCE16 gdi_inst;
int userPercent, gdiPercent;
if ((gdi_inst = GetModuleHandle16( "gdi" )) < 32) return 0;
switch(resType)
{
case GFSR_USERRESOURCES:
@ -2060,7 +2059,7 @@ BOOL WINAPI DllEntryPoint( DWORD reason, HINSTANCE16 inst, WORD ds,
USER_HeapSel = ds;
register_wow_handlers();
LoadLibrary16( "gdi.exe" );
gdi_inst = LoadLibrary16( "gdi.exe" );
LoadLibrary16( "display.drv" );
LoadLibrary16( "keyboard.drv" );
LoadLibrary16( "mouse.drv" );