winevdm: Require DOSBox for running DOS executables.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-01-31 17:14:13 +01:00
parent ed317f76c7
commit 1d732b4751

View File

@ -35,8 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(winevdm); WINE_DEFAULT_DEBUG_CHANNEL(winevdm);
extern void __wine_load_dos_exe( LPCSTR filename, LPCSTR cmdline );
/*** PIF file structures ***/ /*** PIF file structures ***/
#include "pshpack1.h" #include "pshpack1.h"
@ -213,24 +211,8 @@ static void start_dosbox( const char *appname, const char *args )
*/ */
static void start_dos_exe( LPCSTR filename, LPCSTR cmdline ) static void start_dos_exe( LPCSTR filename, LPCSTR cmdline )
{ {
MEMORY_BASIC_INFORMATION mem_info;
const char *reason;
start_dosbox( filename, cmdline ); start_dosbox( filename, cmdline );
WINE_MESSAGE( "winevdm: %s is a DOS application, you need to install DOSBox.\n", filename );
if (VirtualQuery( NULL, &mem_info, sizeof(mem_info) ) && mem_info.State != MEM_FREE)
{
__wine_load_dos_exe( filename, cmdline );
if (GetLastError() == ERROR_NOT_SUPPORTED)
reason = "because vm86 mode is not supported on this platform";
else
reason = wine_dbg_sprintf( "It failed with error code %u", GetLastError() );
}
else reason = "because the DOS memory range is unavailable";
WINE_MESSAGE( "winevdm: Cannot start DOS application %s\n", filename );
WINE_MESSAGE( " %s.\n", reason );
WINE_MESSAGE( " You should install DOSBox.\n" );
ExitProcess(1); ExitProcess(1);
} }