[PATCH 2/4] ntdll: Set the thread creation time in NtQuerySystemInformation(SystemProcessInformation).

Zebediah Figura z.figura12 at gmail.com
Tue Jul 7 18:58:34 CDT 2020


Process Hacker displays this information.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/ntdll/unix/system.c | 2 +-
 server/process.c         | 1 +
 server/protocol.def      | 1 +
 server/trace.c           | 3 ++-
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 051bd37fa3d..a80d3c4fd4a 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2156,7 +2156,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
 
                 if (len <= size)
                 {
-                    nt_process->ti[j].CreateTime.QuadPart = 0xdeadbeef;
+                    nt_process->ti[j].CreateTime.QuadPart = server_thread->start_time;
                     nt_process->ti[j].ClientId.UniqueProcess = UlongToHandle(server_process->pid);
                     nt_process->ti[j].ClientId.UniqueThread = UlongToHandle(server_thread->tid);
                     nt_process->ti[j].dwCurrentPriority = server_thread->current_priority;
diff --git a/server/process.c b/server/process.c
index 8d57879cc19..5e587b28cbe 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1850,6 +1850,7 @@ DECL_HANDLER(list_processes)
         {
             struct thread_info *thread_info = (struct thread_info *)(buffer + pos);
 
+            thread_info->start_time = thread->creation_time;
             thread_info->tid = thread->id;
             thread_info->base_priority = thread->priority;
             thread_info->current_priority = thread->priority; /* FIXME */
diff --git a/server/protocol.def b/server/protocol.def
index bf91637e9de..943c1ade1a4 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1862,6 +1862,7 @@ enum char_info_mode
 
 struct thread_info
 {
+    timeout_t       start_time;
     thread_id_t     tid;
     int             base_priority;
     int             current_priority;
diff --git a/server/trace.c b/server/trace.c
index 288dad718df..55d7bd85dd6 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1128,7 +1128,8 @@ static void dump_varargs_process_info( const char *prefix, data_size_t size )
             const struct thread_info *thread = (const struct thread_info *)((const char *)cur_data + pos);
             if (size - pos < sizeof(*thread)) break;
             if (i) fputc( ',', stderr );
-            fprintf( stderr, "{tid=%04x,base_priority=%d,current_priority=%d,unix_tid=%d}",
+            dump_timeout( "{start_time=", &thread->start_time );
+            fprintf( stderr, ",tid=%04x,base_priority=%d,current_priority=%d,unix_tid=%d}",
                      thread->tid, thread->base_priority, thread->current_priority, thread->unix_tid );
             pos += sizeof(*thread);
         }
-- 
2.27.0




More information about the wine-devel mailing list