Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
173957d2
Commit
173957d2
authored
Nov 11, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386.exe: Propagate DOS startup errors up to winevdm.
parent
44a17d27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
34 deletions
+39
-34
dosexe.c
dlls/krnl386.exe16/dosexe.c
+13
-24
winevdm.c
programs/winevdm/winevdm.c
+26
-10
No files found.
dlls/krnl386.exe16/dosexe.c
View file @
173957d2
...
...
@@ -114,7 +114,7 @@ static WORD init_cs,init_ip,init_ss,init_sp;
static
HANDLE
dosvm_thread
,
loop_thread
;
static
DWORD
dosvm_tid
,
loop_tid
;
static
void
MZ_Launch
(
LPCSTR
cmdtail
,
int
length
);
static
DWORD
MZ_Launch
(
LPCSTR
cmdtail
,
int
length
);
static
BOOL
MZ_InitTask
(
void
);
static
void
MZ_CreatePSP
(
LPVOID
lpPSP
,
WORD
env
,
WORD
par
)
...
...
@@ -433,8 +433,12 @@ void __wine_load_dos_exe( LPCSTR filename, LPCSTR cmdline )
}
}
if
(
MZ_DoLoadImage
(
hFile
,
filename
,
NULL
,
0
))
MZ_Launch
(
dos_cmdtail
,
dos_length
);
if
(
MZ_DoLoadImage
(
hFile
,
filename
,
NULL
,
0
))
{
DWORD
err
=
MZ_Launch
(
dos_cmdtail
,
dos_length
);
/* if we get back here it failed */
SetLastError
(
err
);
}
}
/***********************************************************************
...
...
@@ -633,24 +637,9 @@ static DWORD WINAPI MZ_DOSVM( LPVOID lpExtra )
context
.
EFlags
=
V86_FLAG
|
VIF_MASK
;
DOSVM_SetTimer
(
0x10000
);
ret
=
DOSVM_Enter
(
&
context
);
if
(
ret
==
-
1
)
{
/* fetch the app name from the environment */
PDB16
*
psp
=
PTR_REAL_TO_LIN
(
DOSVM_psp
,
0
);
char
*
env
=
PTR_REAL_TO_LIN
(
psp
->
environment
,
0
);
while
(
*
env
)
env
+=
strlen
(
env
)
+
1
;
env
+=
1
+
sizeof
(
WORD
);
if
(
GetLastError
()
==
ERROR_NOT_SUPPORTED
)
MESSAGE
(
"wine: Cannot start DOS application %s
\n
"
" because vm86 mode is not supported on this platform.
\n
"
" Try running the application with DOSBox.
\n
"
,
debugstr_a
(
env
)
);
else
FIXME
(
"vm86 mode failed error %u
\n
"
,
GetLastError
()
);
}
if
(
ret
==
-
1
)
ret
=
GetLastError
();
dosvm_pid
=
0
;
return
ret
!=
0
;
return
ret
;
}
static
BOOL
MZ_InitTask
(
void
)
...
...
@@ -669,7 +658,7 @@ static BOOL MZ_InitTask(void)
return
TRUE
;
}
static
void
MZ_Launch
(
LPCSTR
cmdtail
,
int
length
)
static
DWORD
MZ_Launch
(
LPCSTR
cmdtail
,
int
length
)
{
TDB
*
pTask
=
GlobalLock16
(
GetCurrentTask
()
);
BYTE
*
psp_start
=
PTR_REAL_TO_LIN
(
DOSVM_psp
,
0
);
...
...
@@ -696,9 +685,10 @@ static void MZ_Launch( LPCSTR cmdtail, int length )
dosvm_thread
=
0
;
dosvm_tid
=
0
;
CloseHandle
(
loop_thread
);
loop_thread
=
0
;
loop_tid
=
0
;
if
(
rv
)
return
rv
;
VGA_Clean
();
ExitProcess
(
rv
);
ExitProcess
(
0
);
}
/***********************************************************************
...
...
@@ -756,8 +746,7 @@ BOOL MZ_Current( void )
*/
void
__wine_load_dos_exe
(
LPCSTR
filename
,
LPCSTR
cmdline
)
{
FIXME
(
"DOS executables not supported on this platform
\n
"
);
SetLastError
(
ERROR_BAD_FORMAT
);
SetLastError
(
ERROR_NOT_SUPPORTED
);
}
/***********************************************************************
...
...
programs/winevdm/winevdm.c
View file @
173957d2
...
...
@@ -102,6 +102,30 @@ typedef struct {
#include "poppack.h"
/***********************************************************************
* start_dos_exe
*/
static
void
start_dos_exe
(
LPCSTR
filename
,
LPCSTR
cmdline
)
{
MEMORY_BASIC_INFORMATION
mem_info
;
const
char
*
reason
;
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
(
" Try running this application with DOSBox.
\n
"
);
ExitProcess
(
1
);
}
/***********************************************************************
* read_pif_file
*pif386rec_tu
* Read a pif file and return the header and possibly the 286 (real mode)
...
...
@@ -244,8 +268,7 @@ static VOID pif_cmd( char *filename, char *cmdline)
* - hot key's
* - etc.
*/
__wine_load_dos_exe
(
progpath
,
cmdline
);
return
;
start_dos_exe
(
progpath
,
cmdline
);
}
/***********************************************************************
...
...
@@ -382,7 +405,6 @@ int main( int argc, char *argv[] )
STARTUPINFOA
info
;
char
*
cmdline
,
*
appname
,
**
first_arg
;
char
*
p
;
MEMORY_BASIC_INFORMATION
mem_info
;
if
(
!
argv
[
1
])
usage
();
...
...
@@ -439,15 +461,9 @@ int main( int argc, char *argv[] )
pif_cmd
(
appname
,
cmdline
+
1
);
else
{
if
(
!
VirtualQuery
(
NULL
,
&
mem_info
,
sizeof
(
mem_info
)
)
||
mem_info
.
State
==
MEM_FREE
)
{
WINE_MESSAGE
(
"winevdm: unable to exec '%s': DOS memory range unavailable
\n
"
,
appname
);
ExitProcess
(
1
);
}
/* try DOS format */
/* loader expects arguments to be regular C strings */
__wine_load
_dos_exe
(
appname
,
cmdline
+
1
);
start
_dos_exe
(
appname
,
cmdline
+
1
);
}
/* if we get back here it failed */
instance
=
GetLastError
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment