Alexandre Julliard : user.exe: Make sure 16-bit user and gdi never get unloaded.

Alexandre Julliard julliard at winehq.org
Mon May 24 11:30:51 CDT 2010


Module: wine
Branch: master
Commit: 5d9801bc7f8404734cee7f505d768e463ff42b4a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5d9801bc7f8404734cee7f505d768e463ff42b4a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May 24 13:43:00 2010 +0200

user.exe: Make sure 16-bit user and gdi never get unloaded.

---

 dlls/user.exe16/user.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c
index ba90db4..c536a6d 100644
--- a/dlls/user.exe16/user.c
+++ b/dlls/user.exe16/user.c
@@ -1763,7 +1763,7 @@ WORD WINAPI GetFreeSystemResources16( WORD resType )
     HINSTANCE16 gdi_inst;
     int userPercent, gdiPercent;
 
-    if ((gdi_inst = LoadLibrary16( "GDI" )) < 32) return 0;
+    if ((gdi_inst = GetModuleHandle16( "gdi" )) < 32) return 0;
 
     switch(resType)
     {
@@ -1793,7 +1793,6 @@ WORD WINAPI GetFreeSystemResources16( WORD resType )
         userPercent = gdiPercent = 0;
         break;
     }
-    FreeLibrary16( gdi_inst );
     TRACE("<- userPercent %d, gdiPercent %d\n", userPercent, gdiPercent);
     return (WORD)min( userPercent, gdiPercent );
 }
@@ -2061,9 +2060,11 @@ BOOL WINAPI DllEntryPoint( DWORD reason, HINSTANCE16 inst, WORD ds,
 
     USER_HeapSel = ds;
     register_wow_handlers();
+    LoadLibrary16( "gdi.exe" );
     LoadLibrary16( "display.drv" );
     LoadLibrary16( "keyboard.drv" );
     LoadLibrary16( "mouse.drv" );
+    LoadLibrary16( "user.exe" );  /* make sure it never gets unloaded */
     return TRUE;
 }
 




More information about the wine-cvs mailing list