Commit 7a62e1a5 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Vitaly Lipatov

Hack with replacing Session Id with 0 for services.exe (eterbug #15527)

parent 5d3688e7
...@@ -2381,6 +2381,7 @@ static void read_dev_urandom( void *buf, ULONG len ) ...@@ -2381,6 +2381,7 @@ static void read_dev_urandom( void *buf, ULONG len )
static NTSTATUS get_system_process_info( SYSTEM_INFORMATION_CLASS class, void *info, ULONG size, ULONG *len ) static NTSTATUS get_system_process_info( SYSTEM_INFORMATION_CLASS class, void *info, ULONG size, ULONG *len )
{ {
static const WCHAR servicesW[] = { 's','e','r','v','i','c','e','s','.','e','x','e',0 };
unsigned int process_count, total_thread_count, total_name_len, i, j; unsigned int process_count, total_thread_count, total_name_len, i, j;
unsigned int thread_info_size; unsigned int thread_info_size;
unsigned int pos = 0; unsigned int pos = 0;
...@@ -2454,7 +2455,7 @@ C_ASSERT( sizeof(struct process_info) <= sizeof(SYSTEM_PROCESS_INFORMATION) ); ...@@ -2454,7 +2455,7 @@ C_ASSERT( sizeof(struct process_info) <= sizeof(SYSTEM_PROCESS_INFORMATION) );
nt_process->dwBasePriority = server_process->priority; nt_process->dwBasePriority = server_process->priority;
nt_process->UniqueProcessId = UlongToHandle(server_process->pid); nt_process->UniqueProcessId = UlongToHandle(server_process->pid);
nt_process->ParentProcessId = UlongToHandle(server_process->parent_pid); nt_process->ParentProcessId = UlongToHandle(server_process->parent_pid);
nt_process->SessionId = server_process->session_id; nt_process->SessionId = !wcsnicmp(file_part, servicesW, name_len) ? 0 : server_process->session_id;
nt_process->HandleCount = server_process->handle_count; nt_process->HandleCount = server_process->handle_count;
get_thread_times( server_process->unix_pid, -1, &nt_process->KernelTime, &nt_process->UserTime ); get_thread_times( server_process->unix_pid, -1, &nt_process->KernelTime, &nt_process->UserTime );
fill_vm_counters( &nt_process->vmCounters, server_process->unix_pid ); fill_vm_counters( &nt_process->vmCounters, server_process->unix_pid );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment