winevdm: start_dos_exe(): print important failure details (e.g. mmap).

Andreas Mohr andi at lisas.de
Tue Mar 31 16:02:45 CDT 2015


For fun I tried to run a Lemmings demo downloaded from
http://www.pcgaming.ws/download.php?game=lemmings

Picture my not overly amused face when I then got the message
"
winevdm: Cannot start DOS application C:\lemmings\VGALEMMI.EXE
         because the DOS memory range is unavailable.
         You should install DOSBox.
"

After some crucial research steps
I came to the decision to extend it to a definitely more helpful

"
winevdm: Cannot start DOS application C:\lemmings\VGALEMMI.EXE
         because the DOS memory range is unavailable.
  Details: Perhaps /proc/sys/vm/mmap_min_addr disallows it?
  (warning: changing this setting will compromise system security!).
         You might prefer to install DOSBox.
"

by letting various platforms specify
a corresponding platform-specific details string.

---
 programs/winevdm/winevdm.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/programs/winevdm/winevdm.c b/programs/winevdm/winevdm.c
index 290ad25..b5ccadf 100644
--- a/programs/winevdm/winevdm.c
+++ b/programs/winevdm/winevdm.c
@@ -214,6 +214,7 @@ static void start_dos_exe( LPCSTR filename, LPCSTR cmdline )
 {
     MEMORY_BASIC_INFORMATION mem_info;
     const char *reason;
+    const char *reason_details = NULL;
 
     start_dosbox( filename, cmdline );
 
@@ -225,11 +226,23 @@ static void start_dos_exe( LPCSTR filename, LPCSTR cmdline )
         else
             reason = wine_dbg_sprintf( "It failed with error code %u", GetLastError() );
     }
-    else reason = "because the DOS memory range is unavailable";
+    else
+    {
+        reason = "because the DOS memory range is unavailable";
+#ifdef __linux__
+        reason_details = "Perhaps /proc/sys/vm/mmap_min_addr disallows it?\n" \
+        "  (warning: changing this setting will compromise system security!)";
+#endif
+    }
 
+    /* Print as multi-line (allow ample space for format specifier args) */
     WINE_MESSAGE( "winevdm: Cannot start DOS application %s\n", filename );
     WINE_MESSAGE( "         %s.\n", reason );
-    WINE_MESSAGE( "         You should install DOSBox.\n" );
+    if (reason_details)
+    {
+        WINE_MESSAGE( "  Details: %s.\n", reason_details );
+    }
+    WINE_MESSAGE( "         You might prefer to install DOSBox.\n" );
     ExitProcess(1);
 }
 
-- 
1.8.5.1




More information about the wine-patches mailing list