annotate src/process-nt.c @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 90d73dddcdc4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
1 /* Asynchronous subprocess implemenation for Win32
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
2 Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
3 Free Software Foundation, Inc.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
5 Copyright (C) 1995, 1996 Ben Wing.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
6
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
7 This file is part of XEmacs.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
8
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
9 XEmacs is free software; you can redistribute it and/or modify it
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
11 Free Software Foundation; either version 2, or (at your option) any
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
12 later version.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
13
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
17 for more details.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
18
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
20 along with XEmacs; see the file COPYING. If not, write to
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
22 Boston, MA 02111-1307, USA. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
23
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
24 /* Written by Kirill M. Katsnelson <kkm@kis.ru>, April 1998 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
25
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
26 #include <config.h>
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
27 #include "lisp.h"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
28
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
29 #include "hash.h"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
30 #include "lstream.h"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
31 #include "process.h"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
32 #include "procimpl.h"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
33
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
34 #include <windows.h>
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
35
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
36 /* Implemenation-specific data. Pointed to by Lisp_Process->process_data */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
37 struct nt_process_data
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
38 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
39 HANDLE h_process;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
40 };
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
41
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
42 #define NT_DATA(p) ((struct nt_process_data*)((p)->process_data))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
43
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
44 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
45 /* Process helpers */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
46 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
47
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
48 /* This one breaks process abstraction. Prototype is in console-msw.h,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
49 used by select_process method in event-msw.c */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
50 HANDLE
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
51 get_nt_process_handle (struct Lisp_Process *p)
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
52 {
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
53 return (NT_DATA (p)->h_process);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
54 }
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
55
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
56 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
57 /* Process methods */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
58 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
59
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
60 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
61 * Allocate and initialize Lisp_Process->process_data
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
62 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
63
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
64 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
65 nt_alloc_process_data (struct Lisp_Process *p)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
66 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
67 p->process_data = xnew (struct nt_process_data);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
68 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
69
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
70 #if 0 /* #### Need this method? */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
71 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
72 * Mark any Lisp objects in Lisp_Process->process_data
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
73 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
74
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
75 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
76 nt_mark_process_data (struct Lisp_Process *proc,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
77 void (*markobj) (Lisp_Object))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
78 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
79 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
80 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
81
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
82 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
83 nt_finalize_process_data (struct Lisp_Process *p, int for_disksave)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
84 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
85 assert (!for_disksave);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
86 if (NT_DATA(p)->h_process)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
87 CloseHandle (NT_DATA(p)->h_process);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
88 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
89
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
90 #if 0 /* #### Need this method? */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
91 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
92 * Initialize XEmacs process implemenation once
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
93 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
94
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
95 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
96 nt_init_process (void)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
97 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
98 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
99 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
100
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
101 #if 0 /* #### Need this method? */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
102 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
103 * Initialize any process local data. This is called when newly
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
104 * created process is connected to real OS file handles. The
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
105 * handles are generally represented by void* type, but are
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
106 * of type HANDLE for Win32
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
107 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
108
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
109 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
110 nt_init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
111 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
112 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
113 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
114
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
115 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
116 * Fork off a subprocess. P is a pointer to newly created subprocess
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
117 * object. If this function signals, the caller is responsible for
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
118 * deleting (and finalizing) the process object.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
119 *
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
120 * The method must return PID of the new proces, a (positive??? ####) number
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
121 * which fits into Lisp_Int. No return value indicates an error, the method
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
122 * must signal an error instead.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
123 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
124
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
125 /* #### This function completely ignores Vprocess_environment */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
126
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
127 static int
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
128 nt_create_process (struct Lisp_Process *p,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
129 char **argv, CONST char *current_dir)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
130 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
131 HANDLE hmyshove, hmyslurp, hprocin, hprocout;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
132 LPTSTR command_line;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
133
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
134 /* Create two unidirectional named pipes */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
135 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
136 HANDLE htmp;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
137 SECURITY_ATTRIBUTES sa;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
138
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
139 sa.nLength = sizeof(sa);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
140 sa.bInheritHandle = TRUE;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
141 sa.lpSecurityDescriptor = NULL;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
142
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
143 CreatePipe (&hprocin, &hmyshove, &sa, 0);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
144 CreatePipe (&hmyslurp, &hprocout, &sa, 0);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
145
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
146 /* Stupid Win32 allows to create a pipe with *both* ends either
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
147 inheritable or not. We need process ends inheritable, and local
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
148 ends not inheritable. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
149 /* #### Perhaps even stupider me does not know how to do this better */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
150 DuplicateHandle (GetCurrentProcess(), hmyshove, GetCurrentProcess(), &htmp,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
151 0, FALSE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
152 hmyshove = htmp;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
153 DuplicateHandle (GetCurrentProcess(), hmyslurp, GetCurrentProcess(), &htmp,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
154 0, FALSE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
155 hmyslurp = htmp;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
156 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
157
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
158 /* Convert an argv vector into Win32 style command line.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
159
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
160 #### This works only for cmd, and not for cygwin bash. Perhaps,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
161 instead of ad-hoc fiddling with different methods for quoting
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
162 process arguments in ntproc.c (disgust shudder), this must call a
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
163 smart lisp routine. The code here will be a fallback, if the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
164 lisp function is not specified.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
165 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
166 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
167 char** thisarg;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
168 size_t size = 1;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
169
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
170 for (thisarg = argv; *thisarg; ++thisarg)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
171 size += strlen (*thisarg) + 1;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
172
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
173 command_line = alloca_array (char, size);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
174 *command_line = 0;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
175
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
176 for (thisarg = argv; *thisarg; ++thisarg)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
177 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
178 if (thisarg != argv)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
179 strcat (command_line, " ");
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
180 strcat (command_line, *thisarg);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
181 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
182 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
183
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
184 /* Create process */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
185 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
186 STARTUPINFO si;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
187 PROCESS_INFORMATION pi;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
188 DWORD err;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
189 BOOL windowed;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
190
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
191 xzero (si);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
192 si.hStdInput = hprocin;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
193 si.hStdOutput = hprocout;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
194 si.hStdError = hprocout;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
195 si.wShowWindow = SW_HIDE;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
196 si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
197
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
198 err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
199 CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP | CREATE_SUSPENDED,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
200 NULL, current_dir, &si, &pi)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
201 ? 0 : GetLastError ());
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
202
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
203 CloseHandle (hprocin);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
204 CloseHandle (hprocout);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
205
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
206 /* See if we succeeded with process creation */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
207 if (err)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
208 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
209 process_error__One_of_those_nasty_uses_for_goto_statement:
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
210 CloseHandle (hmyshove);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
211 CloseHandle (hmyslurp);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
212 error ("Cannot start \"%s\": error code was %lu", argv[0], err);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
213 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
214
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
215 /* Determine if the new process is a windowed one */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
216 windowed = WaitForInputIdle (pi.hProcess, 100) == WAIT_TIMEOUT;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
217 if (windowed)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
218 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
219 /* We restart windowed process fire-and forget style, and
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
220 indicate successful process creation, just as if the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
221 process ended instantly upon launching */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
222 CloseHandle (hmyshove);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
223 CloseHandle (hmyslurp);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
224 /* TerminateProcess is safe becuase the process is not yet
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
225 running */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
226 TerminateProcess (pi.hProcess, 0);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
227 si.dwFlags = STARTF_USESHOWWINDOW;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
228 si.wShowWindow = SW_SHOWNORMAL;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
229 if (!CreateProcess (NULL, command_line, NULL, NULL, FALSE,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
230 DETACHED_PROCESS , NULL, current_dir, &si, &pi))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
231 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
232 err = GetLastError ();
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
233 goto process_error__One_of_those_nasty_uses_for_goto_statement;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
234 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
235
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
236 /* We just launched a windowed process. Fake it as if a
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
237 process launched has already ended */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
238 p->status_symbol = Qexit;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
239
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
240 /* Get rid of process and thread handles */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
241 CloseHandle (pi.hThread);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
242 CloseHandle (pi.hProcess);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
243 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
244 else
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
245 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
246 /* Just started a console subprocess */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
247
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
248 NT_DATA(p)->h_process = pi.hProcess;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
249
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
250 init_process_io_handles (p, (void*)hmyslurp, (void*)hmyshove, 0);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
251
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
252 /* We created it suspended. Resume the only thread */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
253 ResumeThread (pi.hThread);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
254 CloseHandle (pi.hThread);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
255 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
256
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
257 return ((int)pi.dwProcessId < 0
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
258 ? -(int)pi.dwProcessId : (int)pi.dwProcessId);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
259 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
260 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
261
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
262 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
263 * This method is called to update status fields of the process
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
264 * structure. If the process has not existed, this method is expected
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
265 * to do nothing.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
266 *
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
267 * The method is called only for real child processes.
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
268 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
269
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
270 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
271 nt_update_status_if_terminated (struct Lisp_Process* p)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
272 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
273 DWORD exit_code;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
274 if (GetExitCodeProcess (NT_DATA(p)->h_process, &exit_code)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
275 && exit_code != STILL_ACTIVE)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
276 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
277 p->tick++;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
278 p->core_dumped = 0;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
279 /* The exit code can be a code returned by process, or an
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
280 NTSTATUS value. We cannot accurately handle the latter since
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
281 it is a full 32 bit integer */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
282 if (exit_code & 0xC0000000)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
283 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
284 p->status_symbol = Qsignal;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
285 p->exit_code = exit_code & 0x1FFFFFFF;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
286 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
287 else
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
288 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
289 p->status_symbol = Qexit;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
290 p->exit_code = exit_code;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
291 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
292 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
293 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
294
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
295 /*
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
296 * Stuff the entire contents of LSTREAM to the process ouptut pipe
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
297 */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
298
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
299 /* #### If only this function could be somehow merged with
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
300 unix_send_process... */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
301
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
302 static void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
303 nt_send_process (Lisp_Object proc, struct lstream* lstream)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
304 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
305 struct Lisp_Process *p = XPROCESS (proc);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
306
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
307 /* use a reasonable-sized buffer (somewhere around the size of the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
308 stream buffer) so as to avoid inundating the stream with blocked
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
309 data. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
310 Bufbyte chunkbuf[512];
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
311 Bytecount chunklen;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
312
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
313 while (1)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
314 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
315 int writeret;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
316
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
317 chunklen = Lstream_read (lstream, chunkbuf, 512);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
318 if (chunklen <= 0)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
319 break; /* perhaps should abort() if < 0?
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
320 This should never happen. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
321
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
322 /* Lstream_write() will never successfully write less than the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
323 amount sent in. In the worst case, it just buffers the
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
324 unwritten data. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
325 writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
326 chunklen);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
327 if (writeret < 0)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
328 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
329 p->status_symbol = Qexit;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
330 p->exit_code = ERROR_BROKEN_PIPE;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
331 p->core_dumped = 0;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
332 p->tick++;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
333 process_tick++;
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
334 deactivate_process (proc);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
335 error ("Broken pipe error sending to process %s; closed it",
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
336 XSTRING_DATA (p->name));
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
337 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
338
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
339 while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream)))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
340 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
341 /* Buffer is full. Wait, accepting input; that may allow
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
342 the program to finish doing output and read more. */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
343 Faccept_process_output (Qnil, make_int (1), Qnil);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
344 Lstream_flush (XLSTREAM (p->pipe_outstream));
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
345 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
346 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
347 Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p)));
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
348 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
349
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
350 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
351 /* Initialization */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
352 /*-----------------------------------------------------------------------*/
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
353
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
354 void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
355 process_type_create_nt (void)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
356 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
357 PROCESS_HAS_METHOD (nt, alloc_process_data);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
358 PROCESS_HAS_METHOD (nt, finalize_process_data);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
359 /* PROCESS_HAS_METHOD (nt, mark_process_data); */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
360 /* PROCESS_HAS_METHOD (nt, init_process); */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
361 /* PROCESS_HAS_METHOD (nt, init_process_io_handles); */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
362 PROCESS_HAS_METHOD (nt, create_process);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
363 PROCESS_HAS_METHOD (nt, update_status_if_terminated);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
364 PROCESS_HAS_METHOD (nt, send_process);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
365 /* PROCESS_HAS_METHOD (nt, kill_child_process); */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
366 /* PROCESS_HAS_METHOD (nt, kill_process_by_pid); */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
367 #if 0 /* Yet todo */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
368 #ifdef HAVE_SOCKETS
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
369 PROCESS_HAS_METHOD (nt, canonicalize_host_name);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
370 PROCESS_HAS_METHOD (nt, open_network_stream);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
371 #ifdef HAVE_MULTICAST
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
372 PROCESS_HAS_METHOD (nt, open_multicast_group);
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
373 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
374 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
375 #endif
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
376 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
377
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
378 void
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
379 vars_of_process_nt (void)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
380 {
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
381 }
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents:
diff changeset
382