comparison src/w32proc.c @ 31115:42753ce203f8

(IsValidLocale): Extern missing from mingw32 headers. (compare_env): (find_child_console): Fix compile warning. (create_child): Remove reference to security descriptor, which isn't needed and doesn't compile with mingw32.
author Andrew Innes <andrewi@gnu.org>
date Tue, 22 Aug 2000 23:39:00 +0000
parents b7438760079b
children 547138676a74
comparison
equal deleted inserted replaced
31114:cd392fdf0e9f 31115:42753ce203f8
36 #undef spawnve 36 #undef spawnve
37 #undef select 37 #undef select
38 #undef kill 38 #undef kill
39 39
40 #include <windows.h> 40 #include <windows.h>
41 #ifdef __GNUC__
42 /* This definition is missing from mingw32 headers. */
43 extern BOOL WINAPI IsValidLocale(LCID, DWORD);
44 #endif
41 45
42 #include "lisp.h" 46 #include "lisp.h"
43 #include "w32.h" 47 #include "w32.h"
44 #include "w32heap.h" 48 #include "w32heap.h"
45 #include "systime.h" 49 #include "systime.h"
302 create_child (char *exe, char *cmdline, char *env, 306 create_child (char *exe, char *cmdline, char *env,
303 int * pPid, child_process *cp) 307 int * pPid, child_process *cp)
304 { 308 {
305 STARTUPINFO start; 309 STARTUPINFO start;
306 SECURITY_ATTRIBUTES sec_attrs; 310 SECURITY_ATTRIBUTES sec_attrs;
311 #if 0
307 SECURITY_DESCRIPTOR sec_desc; 312 SECURITY_DESCRIPTOR sec_desc;
313 #endif
308 DWORD flags; 314 DWORD flags;
309 char dir[ MAXPATHLEN ]; 315 char dir[ MAXPATHLEN ];
310 316
311 if (cp == NULL) abort (); 317 if (cp == NULL) abort ();
312 318
323 start.hStdInput = GetStdHandle (STD_INPUT_HANDLE); 329 start.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
324 start.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); 330 start.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
325 start.hStdError = GetStdHandle (STD_ERROR_HANDLE); 331 start.hStdError = GetStdHandle (STD_ERROR_HANDLE);
326 #endif /* HAVE_NTGUI */ 332 #endif /* HAVE_NTGUI */
327 333
334 #if 0
328 /* Explicitly specify no security */ 335 /* Explicitly specify no security */
329 if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION)) 336 if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION))
330 goto EH_Fail; 337 goto EH_Fail;
331 if (!SetSecurityDescriptorDacl (&sec_desc, TRUE, NULL, FALSE)) 338 if (!SetSecurityDescriptorDacl (&sec_desc, TRUE, NULL, FALSE))
332 goto EH_Fail; 339 goto EH_Fail;
340 #endif
333 sec_attrs.nLength = sizeof (sec_attrs); 341 sec_attrs.nLength = sizeof (sec_attrs);
334 sec_attrs.lpSecurityDescriptor = &sec_desc; 342 sec_attrs.lpSecurityDescriptor = NULL /* &sec_desc */;
335 sec_attrs.bInheritHandle = FALSE; 343 sec_attrs.bInheritHandle = FALSE;
336 344
337 strcpy (dir, process_dir); 345 strcpy (dir, process_dir);
338 unixtodos_filename (dir); 346 unixtodos_filename (dir);
339 347
648 unwind: 656 unwind:
649 close_file_data (&executable); 657 close_file_data (&executable);
650 } 658 }
651 659
652 int 660 int
653 compare_env (const char **strp1, const char **strp2) 661 compare_env (const void *strp1, const void *strp2)
654 { 662 {
655 const char *str1 = *strp1, *str2 = *strp2; 663 const char *str1 = *(const char **)strp1, *str2 = *(const char **)strp2;
656 664
657 while (*str1 && *str2 && *str1 != '=' && *str2 != '=') 665 while (*str1 && *str2 && *str1 != '=' && *str2 != '=')
658 { 666 {
659 if (tolower (*str1) > tolower (*str2)) 667 if (tolower (*str1) > tolower (*str2))
660 return 1; 668 return 1;
1300 } 1308 }
1301 1309
1302 /* Substitute for certain kill () operations */ 1310 /* Substitute for certain kill () operations */
1303 1311
1304 static BOOL CALLBACK 1312 static BOOL CALLBACK
1305 find_child_console (HWND hwnd, child_process * cp) 1313 find_child_console (HWND hwnd, LPARAM arg)
1306 { 1314 {
1315 child_process * cp = (child_process *) arg;
1307 DWORD thread_id; 1316 DWORD thread_id;
1308 DWORD process_id; 1317 DWORD process_id;
1309 1318
1310 thread_id = GetWindowThreadProcessId (hwnd, &process_id); 1319 thread_id = GetWindowThreadProcessId (hwnd, &process_id);
1311 if (process_id == cp->procinfo.dwProcessId) 1320 if (process_id == cp->procinfo.dwProcessId)