Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7ec04452
Commit
7ec04452
authored
May 01, 2002
by
Jukka Heinonen
Committed by
Alexandre Julliard
May 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When DOS program executes another DOS program, command line is now
passed correctly. If DOS command line is too long, command line is now truncated instead of letting it trash memory.
parent
b7b75a86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
module.c
dlls/winedos/module.c
+28
-16
No files found.
dlls/winedos/module.c
View file @
7ec04452
...
...
@@ -112,22 +112,29 @@ static void MZ_CreatePSP( LPVOID lpPSP, WORD env, WORD par )
/* FIXME: more PSP stuff */
}
static
void
MZ_FillPSP
(
LPVOID
lpPSP
,
LP
CSTR
cmdline
)
static
void
MZ_FillPSP
(
LPVOID
lpPSP
,
LP
BYTE
cmdline
,
int
length
)
{
PDB16
*
psp
=
lpPSP
;
const
char
*
cmd
=
cmdline
?
strchr
(
cmdline
,
' '
)
:
NULL
;
PDB16
*
psp
=
lpPSP
;
/* copy parameters */
if
(
cmd
)
{
#if 0
/* command.com doesn't do this */
while (*cmd == ' ') cmd++;
#endif
psp
->
cmdLine
[
0
]
=
strlen
(
cmd
);
strcpy
(
psp
->
cmdLine
+
1
,
cmd
);
psp
->
cmdLine
[
psp
->
cmdLine
[
0
]
+
1
]
=
'\r'
;
}
else
psp
->
cmdLine
[
1
]
=
'\r'
;
/* FIXME: more PSP stuff */
while
(
length
>
0
&&
*
cmdline
!=
' '
)
{
length
--
;
cmdline
++
;
}
/* command.com does not skip over multiple spaces */
if
(
length
>
126
)
{
ERR
(
"Command line truncated! (length %d > maximum length 126)
\n
"
,
length
);
length
=
126
;
}
psp
->
cmdLine
[
0
]
=
length
;
if
(
length
>
0
)
memmove
(
psp
->
cmdLine
+
1
,
cmdline
,
length
);
psp
->
cmdLine
[
length
+
1
]
=
'\r'
;
/* FIXME: more PSP stuff */
}
/* default INT 08 handler: increases timer tick counter but not much more */
...
...
@@ -356,7 +363,11 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para
* let's work on the new values now */
LPBYTE
psp_start
=
(
LPBYTE
)((
DWORD
)
DOSVM_psp
<<
4
);
ExecBlock
*
blk
=
(
ExecBlock
*
)
paramblk
;
MZ_FillPSP
(
psp_start
,
DOSMEM_MapRealToLinear
(
blk
->
cmdline
));
LPBYTE
cmdline
=
DOSMEM_MapRealToLinear
(
blk
->
cmdline
);
/* First character contains the length of the command line. */
MZ_FillPSP
(
psp_start
,
cmdline
+
1
,
cmdline
[
0
]);
/* the lame MS-DOS engineers decided that the return address should be in int22 */
DOSVM_SetRMHandler
(
0x22
,
(
FARPROC16
)
MAKESEGPTR
(
context
->
SegCs
,
LOWORD
(
context
->
Eip
)));
if
(
func
)
{
...
...
@@ -462,8 +473,9 @@ static void MZ_Launch(void)
{
TDB
*
pTask
=
TASK_GetCurrent
();
BYTE
*
psp_start
=
PTR_REAL_TO_LIN
(
DOSVM_psp
,
0
);
LPSTR
cmdline
=
GetCommandLineA
();
MZ_FillPSP
(
psp_start
,
GetCommandLineA
()
);
MZ_FillPSP
(
psp_start
,
cmdline
,
cmdline
?
strlen
(
cmdline
)
:
0
);
pTask
->
flags
|=
TDBF_WINOLDAP
;
_LeaveWin16Lock
();
...
...
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