wine-staging/patches/ntdll-ThreadTime/0004-ntdll-Set-process-start-time.patch
2020-06-29 19:03:01 -05:00

65 lines
2.6 KiB
Diff

From 72c4b3f95ad4c8a8ed31ad61c3678cf7d534fba9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 9 Mar 2017 16:32:59 +0100
Subject: [PATCH] ntdll: Set process start time.
---
dlls/ntdll/unix/system.c | 1 +
server/protocol.def | 1 +
server/snapshot.c | 15 ++++++++-------
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index f137ccf97a7..94915bd9e47 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2137,6 +2137,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
spi->UniqueProcessId = UlongToHandle(reply->pid);
spi->ParentProcessId = UlongToHandle(reply->ppid);
spi->HandleCount = reply->handles;
+ spi->CreationTime.QuadPart = reply->start_time;
/* spi->ti will be set later on */
diff --git a/server/protocol.def b/server/protocol.def
index 89a0332691c..b29e014958e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1899,6 +1899,7 @@ enum char_info_mode
int priority; /* process priority */
int handles; /* number of handles */
int unix_pid; /* Unix pid */
+ timeout_t start_time; /* start time */
VARARG(filename,unicode_str); /* file name of main exe */
@END
diff --git a/server/snapshot.c b/server/snapshot.c
index fe25e07e02a..b6b790e21bd 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -114,13 +114,14 @@ static int snapshot_next_process( struct snapshot *snapshot, struct next_process
return 0;
}
ptr = &snapshot->processes[snapshot->process_pos++];
- reply->count = ptr->count;
- reply->pid = get_process_id( ptr->process );
- reply->ppid = ptr->process->parent_id;
- reply->threads = ptr->threads;
- reply->priority = ptr->priority;
- reply->handles = ptr->handles;
- reply->unix_pid = ptr->process->unix_pid;
+ reply->count = ptr->count;
+ reply->pid = get_process_id( ptr->process );
+ reply->ppid = ptr->process->parent_id;
+ reply->threads = ptr->threads;
+ reply->priority = ptr->priority;
+ reply->handles = ptr->handles;
+ reply->unix_pid = ptr->process->unix_pid;
+ reply->start_time = ptr->process->start_time;
if ((exe_module = get_process_exe_module( ptr->process )) && exe_module->filename)
{
data_size_t len = min( exe_module->namelen, get_reply_max_size() );
--
2.27.0