2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
2
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
#include <windows.h>
|
|
27 |
#include <string.h>
|
|
28 |
#include "sys.h"
|
|
29 |
|
|
30 |
|
|
31 |
int
|
|
32 |
dbgsysExec(char *cmdLine)
|
|
33 |
{
|
|
34 |
PROCESS_INFORMATION pi;
|
|
35 |
STARTUPINFO si;
|
|
36 |
int ret;
|
|
37 |
|
|
38 |
if (cmdLine == 0) {
|
|
39 |
return SYS_ERR;
|
|
40 |
}
|
|
41 |
|
|
42 |
memset(&si, 0, sizeof(si));
|
|
43 |
si.cb = sizeof(si);
|
|
44 |
|
|
45 |
ret = CreateProcess(0, /* executable name */
|
|
46 |
cmdLine, /* command line */
|
|
47 |
0, /* process security attribute */
|
|
48 |
0, /* thread security attribute */
|
|
49 |
TRUE, /* inherits system handles */
|
|
50 |
0, /* normal attached process */
|
|
51 |
0, /* environment block */
|
|
52 |
0, /* inherits the current directory */
|
|
53 |
&si, /* (in) startup information */
|
|
54 |
&pi); /* (out) process information */
|
|
55 |
|
|
56 |
if (ret == 0) {
|
|
57 |
return SYS_ERR;
|
|
58 |
} else {
|
|
59 |
return SYS_OK;
|
|
60 |
}
|
|
61 |
}
|