From 6781e2ce0d304859a4cfce0dbffbf5e3c705aeed Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Wed, 2 Oct 2024 12:26:12 +0300 Subject: [PATCH] extract service names for svchost.exe processes --- src/collectors/apps.plugin/apps_os_windows.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/collectors/apps.plugin/apps_os_windows.c b/src/collectors/apps.plugin/apps_os_windows.c index a71bb696375630..32b838a3a42ea2 100644 --- a/src/collectors/apps.plugin/apps_os_windows.c +++ b/src/collectors/apps.plugin/apps_os_windows.c @@ -688,8 +688,11 @@ void GetAllProcessesInfo(void) { fix_windows_comm(p, comm); update_pid_comm(p, comm); // will sanitize p->comm - if(!p->name) - p->name = GetNameFromCmdlineSanitized(p); + STRING *better_name = GetNameFromCmdlineSanitized(p); + if(better_name) { + string_freez(p->name); + p->name = better_name; + } } while (Process32NextW(hSnapshot, &pe32));