mmsystem should be loaded at startup

Joshua Thielen thielen at netprince.net
Sat Nov 24 13:04:42 CST 2001


Note: I'm not sure if I should have called ExitProcess if mmsystem.dll 
can't be loaded and if I needed to call FreeLibrary. I just took the 
LoadLibrary("user32") as an example.

Modified Files
wine/miscemu/main.c

Change Log
mmsystem.dll should be automatically loaded for 16-bit apps.
-------------- next part --------------
Index: wine/miscemu/main.c
===================================================================
RCS file: /home/wine/wine/miscemu/main.c,v
retrieving revision 1.55
diff -u -r1.55 main.c
--- wine/miscemu/main.c	2001/03/28 18:47:05	1.55
+++ wine/miscemu/main.c	2001/11/24 17:21:53
@@ -33,7 +33,14 @@
     MSG msg;
     HINSTANCE16 instance;
     HMODULE user32;
+    HMODULE16 mmsystem;
 
+    if(!(mmsystem = LoadLibrary16("mmsystem.dll")))
+    {
+	MESSAGE("Cannot load mmsystem.dll\n");
+	ExitProcess( GetLastError() );
+    }
+
     if ((instance = NE_StartMain( main_exe_name, main_exe_file )) < 32)
     {
         if (instance == 11)  /* try DOS format */
@@ -62,6 +69,7 @@
         MESSAGE( "Cannot load user32.dll\n" );
         ExitProcess( GetLastError() );
     }
+
     pGetMessageA      = (void *)GetProcAddress( user32, "GetMessageA" );
     pTranslateMessage = (void *)GetProcAddress( user32, "TranslateMessage" );
     pDispatchMessageA = (void *)GetProcAddress( user32, "DispatchMessageA" );


More information about the wine-patches mailing list