From 55561073017f720e7e313841cb31c836e106f690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Sto=C5=A1i=C4=87?= Date: Wed, 5 Oct 2022 15:26:40 +0200 Subject: [PATCH] Show User name --- .../FileLocksmith/FileLocksmithLibInterop/interop.cpp | 6 ++++++ .../FileLocksmith/FileLocksmithUI/ProcessEntry.xaml.cs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp b/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp index 70a3a7fe13..3358ba5454 100644 --- a/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp +++ b/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp @@ -92,5 +92,11 @@ namespace FileLocksmith::Interop return wait_result == WAIT_OBJECT_0; } + + static System::String^ PidToUser(System::UInt32 pid) + { + auto user_cpp = pid_to_user(pid); + return from_wstring_view(user_cpp); + } }; } diff --git a/src/modules/FileLocksmith/FileLocksmithUI/ProcessEntry.xaml.cs b/src/modules/FileLocksmith/FileLocksmithUI/ProcessEntry.xaml.cs index 285729e82b..de34d71696 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/ProcessEntry.xaml.cs +++ b/src/modules/FileLocksmith/FileLocksmithUI/ProcessEntry.xaml.cs @@ -34,7 +34,8 @@ namespace FileLocksmithUI processPid.Text = PowerToys.FileLocksmithUI.Properties.Resources.ProcessId + ": " + pid; processFileCount.Text = PowerToys.FileLocksmithUI.Properties.Resources.FilesUsed + ": " + numFiles; - processUser.Text = PowerToys.FileLocksmithUI.Properties.Resources.User + ": " + ""; + processUser.Text = PowerToys.FileLocksmithUI.Properties.Resources.User + ": " + + FileLocksmith.Interop.NativeMethods.PidToUser(pid); } public void AddPath(string path)