Michael Müller : ntdll: Return process times in NtQuerySystemInformation(SystemProcessInformation).

Alexandre Julliard julliard at winehq.org
Mon Jun 29 14:59:20 CDT 2020


Module: wine
Branch: master
Commit: ed566a87232fddde73481efe2dfcefceca5e49e4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ed566a87232fddde73481efe2dfcefceca5e49e4

Author: Michael Müller <michael at fds-team.de>
Date:   Sun Jun 28 20:43:19 2020 -0500

ntdll: Return process times in NtQuerySystemInformation(SystemProcessInformation).

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/system.c | 2 ++
 dlls/ntdll/unix/thread.c | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index fd86ab874a..7045bc1550 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2155,6 +2155,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
             {
                 int     i, j;
 
+                get_thread_times(unix_pid, -1, &spi->KernelTime, &spi->UserTime);
+
                 /* set thread info */
                 i = j = 0;
                 while (ret == STATUS_SUCCESS)
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 3655adf2db..c583a08c05 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -833,7 +833,10 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA
     FILE *f;
     int i;
 
-    sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid );
+    if (unix_tid == -1)
+        sprintf( buf, "/proc/%u/stat", unix_pid );
+    else
+        sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid );
     if (!(f = fopen( buf, "r" )))
     {
         ERR("Failed to open %s: %s\n", buf, strerror(errno));




More information about the wine-cvs mailing list