patch to MZ_Exec() PE executables

Jukka Heinonen jhei at
Sun Sep 29 05:07:54 CDT 2002

> Look reasonable?

No. Command tail is not null terminated so you
cannot use strlen. DOS exec function "load and exec"
is synchronous so you should return to caller only
after created process has finished. In addition
to hFile lead found by Ove Kaaven, you are leaking 
handles in PROCESS_INFORMATION. Using fixed size
buffer for full command line without sanity checks
is a bad idea and will cause problems sooner or later.

And, finally, you are ignoring long command lines
from DOS program stored in CMDLINE environment
variable. (I have already exchanged private email with 
Chris Morgan about this; DOS programs can be passed
command tails longer than 126 characters using CMDLINE
environment variable. Similarly, DOS programs may pass
long command lines to programs they execute.)

Jukka Heinonen <>

More information about the wine-devel mailing list