aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 1d3c5182912..2407cb171be 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3642,6 +3642,7 @@ w32_system_process_attributes (pid)
3642 Lisp_Object cmd_str, decoded_cmd, tem; 3642 Lisp_Object cmd_str, decoded_cmd, tem;
3643 HANDLE h_snapshot, h_proc; 3643 HANDLE h_snapshot, h_proc;
3644 DWORD proc_id; 3644 DWORD proc_id;
3645 int found_proc = 0;
3645 char uname[UNLEN+1], gname[GNLEN+1], domain[1025]; 3646 char uname[UNLEN+1], gname[GNLEN+1], domain[1025];
3646 DWORD ulength = sizeof (uname), dlength = sizeof (domain), trash; 3647 DWORD ulength = sizeof (uname), dlength = sizeof (domain), trash;
3647 DWORD glength = sizeof (gname); 3648 DWORD glength = sizeof (gname);
@@ -3701,6 +3702,7 @@ w32_system_process_attributes (pid)
3701 attrs = Fcons (Fcons (Qthcount, 3702 attrs = Fcons (Fcons (Qthcount,
3702 make_fixnum_or_float (pe.cntThreads)), 3703 make_fixnum_or_float (pe.cntThreads)),
3703 attrs); 3704 attrs);
3705 found_proc = 1;
3704 break; 3706 break;
3705 } 3707 }
3706 } 3708 }
@@ -3708,6 +3710,12 @@ w32_system_process_attributes (pid)
3708 CloseHandle (h_snapshot); 3710 CloseHandle (h_snapshot);
3709 } 3711 }
3710 3712
3713 if (!found_proc)
3714 {
3715 UNGCPRO;
3716 return Qnil;
3717 }
3718
3711 h_proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 3719 h_proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
3712 FALSE, proc_id); 3720 FALSE, proc_id);
3713 /* If we were denied a handle to the process, try again after 3721 /* If we were denied a handle to the process, try again after