DCOM: More user-friendly behaviour on missing stdole32.tlb

Mike Hearn mh at codeweavers.com
Tue Jun 29 12:40:11 CDT 2004


This patch makes Wine terminate if stdole32.tlb is requested and not present. 
Why? Because I've never seen any app recover from this error, mostly we plough
on regardless and end up inside the debugger often keeping other processes hanging
around. Normal policy would be to never terminate the app on an error and that makes
sense, but as the lack of this file is normally impossible to recover from (especially
when it's used during marshalling) we may as well fail cleanly here.

Mike Hearn <mh at codeweavers.com>
Display message box instead of console output on missing stdole32.tlb 
and terminate the process.

Index: typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.114
diff -u -p -r1.114 typelib.c
--- typelib.c   29 May 2004 00:22:38 -0000      1.114
+++ typelib.c   29 Jun 2004 17:32:39 -0000
@@ -316,13 +316,18 @@ HRESULT WINAPI LoadTypeLibEx(
            for (i=0;i<strlenW(tstpath);i++) {
                if (tstpath[i] == 's') {
                    if (!strcmpW(tstpath+i,stdole32tlb)) {
-                       MESSAGE("\n");
-                       MESSAGE("**************************************************************************\n");
-                       MESSAGE("You must copy a 'stdole32.tlb' file to your Windows\\System directory!\n");
-                       MESSAGE("You can get one from a Windows installation, or look for the DCOM95 package\n");
-                       MESSAGE("on the Microsoft Download Pages.\n");
-                       MESSAGE("**************************************************************************\n");
-                       break;
+
+                        /* If a program cannot find this typelibrary it will almost
+                           certainly crash messily later on, so we try and abort cleanly now. */
+                       MessageBoxA(NULL,
+                                    "This application is requesting a file Wine does not currently provide."
+                                    "You must copy a 'stdole32.tlb' file to your Windows\\System directory\n\n"
+                                    "You can get one from a Windows installation, or look for the DCOM95 package"
+                                    "on the Microsoft Download Pages. Wine will now terminate.\n",
+                                    "Wine",
+                                    MB_OK | MB_ICONERROR);
+                       ExitProcess(1);
+
                    }
                }
            }





More information about the wine-patches mailing list