/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <assert.h>
#include "java_lang_ProcessImpl.h"
#include "jni.h"
#include "jvm.h"
#include "jni_util.h"
#include "io_util.h"
#include <windows.h>
#include <io.h>
/* We try to make sure that we can read and write 4095 bytes (the
* fixed limit on Linux) to the pipe on all operating systems without
* deadlock. Windows 2000 inexplicably appears to need an extra 24
* bytes of slop to avoid deadlock.
*/
char *
{
char *p, *r;
/* If no spaces, then use entire thing */
return source;
/* If no quotes, or quotes after space, return up to space */
*p = 0;
return source;
}
/* Quotes before space, return up to space after next quotes */
p = strchr(r, '"');
return source;
*p = 0;
return source;
}
{
long headerLoc = 0;
int fd = 0;
} else {
*p = 0;
p++;
}
}
if (fd > 0) {
}
}
}
return newFlag;
}
static void
{
if (n > 0)
else
}
static void
{
if (handle != INVALID_HANDLE_VALUE)
}
{
GetVersionEx(&ver);
if (dir != 0) {
}
}
sa.lpSecurityDescriptor = 0;
} else {
goto Catch;
}
}
} else {
goto Catch;
}
}
if (redirectErrorStream) {
} else {
goto Catch;
}
}
if (onNT)
else
0, /* process security attribute */
0, /* thread security attribute */
TRUE, /* inherits system handles */
processFlag, /* selected based on exe type */
&si, /* (in) startup information */
&pi); /* (out) process information */
if (!ret) {
goto Catch;
}
/* Always clean up the child's side of the pipes */
return ret;
/* Clean up the parent's side of the pipes in case of failure only */
goto Finally;
}
{
return exit_code;
}
{
return STILL_ACTIVE;
}
{
FALSE, /* Wait for ANY event */
INFINITE) /* Wait forever */
== WAIT_FAILED)
}
{
}
{
}
/**
* Returns a copy of the Unicode characters of a string. Fow now this
* function doesn't handle long path names and other issues.
*/
} else {
}
}
return pathbuf;
}
{
HANDLE h;
/* Exception already pending */
return -1;
}
h = CreateFileW(
pathbuf, /* Wide char path name */
sharing, /* File sharing flags */
NULL, /* Security attributes */
disposition, /* creation disposition */
flagsAndAttributes, /* flags and attributes */
NULL);
if (h == INVALID_HANDLE_VALUE) {
}
return ptr_to_jlong(h);
}