comparison src/ntproc.c @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents c42ec1d1cded
children c9fe270a4101
comparison
equal deleted inserted replaced
287:13a0bd77a29d 288:e11d67e05968
50 #include "systime.h" 50 #include "systime.h"
51 #include "syssignal.h" 51 #include "syssignal.h"
52 #include "syswait.h" 52 #include "syswait.h"
53 #include "process.h" 53 #include "process.h"
54 /*#include "w32term.h"*/ /* From 19.34.6: sync in ? --marcpa */ 54 /*#include "w32term.h"*/ /* From 19.34.6: sync in ? --marcpa */
55
56 /* #### I'm not going to play with shit. */
57 #pragma warning (disable:4013 4024 4090)
55 58
56 /* Control whether spawnve quotes arguments as necessary to ensure 59 /* Control whether spawnve quotes arguments as necessary to ensure
57 correct parsing by child process. Because not all uses of spawnve 60 correct parsing by child process. Because not all uses of spawnve
58 are careful about constructing argv arrays, we make this behaviour 61 are careful about constructing argv arrays, we make this behaviour
59 conditional (off by default). */ 62 conditional (off by default). */
270 } 273 }
271 274
272 /* To avoid Emacs changing directory, we just record here the directory 275 /* To avoid Emacs changing directory, we just record here the directory
273 the new process should start in. This is set just before calling 276 the new process should start in. This is set just before calling
274 sys_spawnve, and is not generally valid at any other time. */ 277 sys_spawnve, and is not generally valid at any other time. */
275 static char * process_dir; 278 static const char * process_dir;
276 279
277 static BOOL 280 static BOOL
278 create_child (char *exe, char *cmdline, char *env, 281 create_child (char *exe, char *cmdline, char *env,
279 int * pPid, child_process *cp) 282 int * pPid, child_process *cp)
280 { 283 {
1213 SetStdHandle (STD_OUTPUT_HANDLE, handles[1]); 1216 SetStdHandle (STD_OUTPUT_HANDLE, handles[1]);
1214 SetStdHandle (STD_ERROR_HANDLE, handles[2]); 1217 SetStdHandle (STD_ERROR_HANDLE, handles[2]);
1215 } 1218 }
1216 1219
1217 void 1220 void
1218 set_process_dir (char * dir) 1221 set_process_dir (const char * dir)
1219 { 1222 {
1220 process_dir = dir; 1223 process_dir = dir;
1221 } 1224 }
1222 1225
1223 /* Some miscellaneous functions that are Windows specific, but not GUI 1226 /* Some miscellaneous functions that are Windows specific, but not GUI
1236 */ 1239 */
1237 (filename)) 1240 (filename))
1238 { 1241 {
1239 char shortname[MAX_PATH]; 1242 char shortname[MAX_PATH];
1240 1243
1241 CHECK_STRING (filename, 0); 1244 CHECK_STRING (filename);
1242 1245
1243 /* first expand it. */ 1246 /* first expand it. */
1244 filename = Fexpand_file_name (filename, Qnil); 1247 filename = Fexpand_file_name (filename, Qnil);
1245 1248
1246 /* luckily, this returns the short version of each element in the path. */ 1249 /* luckily, this returns the short version of each element in the path. */
1260 */ 1263 */
1261 (filename)) 1264 (filename))
1262 { 1265 {
1263 char longname[ MAX_PATH ]; 1266 char longname[ MAX_PATH ];
1264 1267
1265 CHECK_STRING (filename, 0); 1268 CHECK_STRING (filename);
1266 1269
1267 /* first expand it. */ 1270 /* first expand it. */
1268 filename = Fexpand_file_name (filename, Qnil); 1271 filename = Fexpand_file_name (filename, Qnil);
1269 1272
1270 if (!win32_get_long_filename (XSTRING_DATA (filename), longname, MAX_PATH)) 1273 if (!win32_get_long_filename (XSTRING_DATA (filename), longname, MAX_PATH))
1288 { 1291 {
1289 HANDLE proc_handle = GetCurrentProcess (); 1292 HANDLE proc_handle = GetCurrentProcess ();
1290 DWORD priority_class = NORMAL_PRIORITY_CLASS; 1293 DWORD priority_class = NORMAL_PRIORITY_CLASS;
1291 Lisp_Object result = Qnil; 1294 Lisp_Object result = Qnil;
1292 1295
1293 CHECK_SYMBOL (priority, 0); 1296 CHECK_SYMBOL (priority);
1294 1297
1295 if (!NILP (process)) 1298 if (!NILP (process))
1296 { 1299 {
1297 DWORD pid; 1300 DWORD pid;
1298 child_process *cp; 1301 child_process *cp;
1468 1471
1469 return make_int (GetThreadLocale ()); 1472 return make_int (GetThreadLocale ());
1470 } 1473 }
1471 1474
1472 1475
1476 void
1473 syms_of_ntproc () 1477 syms_of_ntproc ()
1474 { 1478 {
1475 Qhigh = intern ("high"); 1479 Qhigh = intern ("high");
1476 Qlow = intern ("low"); 1480 Qlow = intern ("low");
1477 1481