* spawn.cc (spawn_guts): Detect when executing a 16-bit application and avoid
setting the process pipe since this causes conniptions in Windows 9x.
This commit is contained in:
parent
b3ba5059da
commit
2bc6be1eda
@ -1,3 +1,9 @@
|
|||||||
|
2005-06-17 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* spawn.cc (spawn_guts): Detect when executing a 16-bit application and
|
||||||
|
avoid setting the process pipe since this causes conniptions in Windows
|
||||||
|
9x.
|
||||||
|
|
||||||
2005-06-17 Corinna Vinschen <corinna@vinschen.de>
|
2005-06-17 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygwin.din (inet_pton): Export.
|
* cygwin.din (inet_pton): Export.
|
||||||
|
@ -402,6 +402,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
|||||||
|
|
||||||
av newargv (ac, argv);
|
av newargv (ac, argv);
|
||||||
|
|
||||||
|
bool msdos_exe = false;
|
||||||
int null_app_name = 0;
|
int null_app_name = 0;
|
||||||
if (ac == 3 && argv[1][0] == '/' && argv[1][1] == 'c' &&
|
if (ac == 3 && argv[1][0] == '/' && argv[1][1] == 'c' &&
|
||||||
(iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
|
(iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
|
||||||
@ -433,7 +434,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
|||||||
|
|
||||||
/* If the file name ends in either .exe, .com, .bat, or .cmd we assume
|
/* If the file name ends in either .exe, .com, .bat, or .cmd we assume
|
||||||
that it is NOT a script file */
|
that it is NOT a script file */
|
||||||
while (*ext == '\0')
|
while (*ext == '\0' || strcasematch (ext, ".exe"))
|
||||||
{
|
{
|
||||||
HANDLE hnd = CreateFile (real_path, GENERIC_READ,
|
HANDLE hnd = CreateFile (real_path, GENERIC_READ,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
@ -459,7 +460,11 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
|||||||
CloseHandle (hnd);
|
CloseHandle (hnd);
|
||||||
|
|
||||||
if (buf[0] == 'M' && buf[1] == 'Z')
|
if (buf[0] == 'M' && buf[1] == 'Z')
|
||||||
break;
|
{
|
||||||
|
unsigned off = (unsigned char) buf[0x18] | (((unsigned char) buf[0x19]) << 8);
|
||||||
|
msdos_exe = off < sizeof (IMAGE_DOS_HEADER);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
debug_printf ("%s is a script", (char *) real_path);
|
debug_printf ("%s is a script", (char *) real_path);
|
||||||
|
|
||||||
@ -617,7 +622,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
|||||||
si.hStdError = handle (2, 1); /* Get output handle */
|
si.hStdError = handle (2, 1); /* Get output handle */
|
||||||
si.cb = sizeof (si);
|
si.cb = sizeof (si);
|
||||||
|
|
||||||
int flags = CREATE_DEFAULT_ERROR_MODE | GetPriorityClass (hMainProc);
|
int flags = CREATE_DEFAULT_ERROR_MODE | GetPriorityClass (hMainProc) | CREATE_SEPARATE_WOW_VDM;
|
||||||
|
|
||||||
if (mode == _P_DETACH || !set_console_state_for_spawn ())
|
if (mode == _P_DETACH || !set_console_state_for_spawn ())
|
||||||
flags |= DETACHED_PROCESS;
|
flags |= DETACHED_PROCESS;
|
||||||
@ -807,7 +812,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
|||||||
on this fact when we exit. dup_proc_pipe will close our end of the pipe.
|
on this fact when we exit. dup_proc_pipe will close our end of the pipe.
|
||||||
Note that wr_proc_pipe may also be == INVALID_HANDLE_VALUE. That will make
|
Note that wr_proc_pipe may also be == INVALID_HANDLE_VALUE. That will make
|
||||||
dup_proc_pipe essentially a no-op. */
|
dup_proc_pipe essentially a no-op. */
|
||||||
if (myself->wr_proc_pipe)
|
if (!msdos_exe && myself->wr_proc_pipe)
|
||||||
{
|
{
|
||||||
myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe
|
myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe
|
||||||
just in case we've been previously
|
just in case we've been previously
|
||||||
|
Loading…
x
Reference in New Issue
Block a user