aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/process.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c
index 37496db7b..b29780be8 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -457,6 +457,7 @@ UNUSED_PARAM
457) 457)
458{ 458{
459 PROCESSENTRY32 pe; 459 PROCESSENTRY32 pe;
460 HANDLE proc;
460 const char *comm, *name; 461 const char *comm, *name;
461 BOOL ret; 462 BOOL ret;
462 463
@@ -484,7 +485,6 @@ UNUSED_PARAM
484 485
485#if ENABLE_FEATURE_PS_TIME || ENABLE_FEATURE_PS_LONG 486#if ENABLE_FEATURE_PS_TIME || ENABLE_FEATURE_PS_LONG
486 if (flags & (PSSCAN_STIME|PSSCAN_UTIME|PSSCAN_START_TIME)) { 487 if (flags & (PSSCAN_STIME|PSSCAN_UTIME|PSSCAN_START_TIME)) {
487 HANDLE proc;
488 FILETIME crTime, exTime, keTime, usTime; 488 FILETIME crTime, exTime, keTime, usTime;
489 489
490 if ((proc=OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, 490 if ((proc=OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,
@@ -507,6 +507,15 @@ UNUSED_PARAM
507 } 507 }
508#endif 508#endif
509 509
510 if (flags & PSSCAN_UIDGID) {
511 /* if we can open the process it belongs to us */
512 if ((proc=OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe.th32ProcessID))) {
513 sp->uid = DEFAULT_UID;
514 sp->gid = DEFAULT_GID;
515 CloseHandle(proc);
516 }
517 }
518
510 sp->pid = pe.th32ProcessID; 519 sp->pid = pe.th32ProcessID;
511 sp->ppid = pe.th32ParentProcessID; 520 sp->ppid = pe.th32ParentProcessID;
512 521