mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
b02427417c
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5614 21ef857c-d57f-4fe0-8362-d861dc6d29cd
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using System.Windows.Forms;
|
|
using ProcessHacker.Native;
|
|
using ProcessHacker.Native.Objects;
|
|
|
|
namespace ProcessHacker.Components
|
|
{
|
|
public partial class MutantProperties : UserControl
|
|
{
|
|
private MutantHandle _mutantHandle;
|
|
|
|
public MutantProperties(MutantHandle mutantHandle)
|
|
{
|
|
InitializeComponent();
|
|
|
|
_mutantHandle = mutantHandle;
|
|
_mutantHandle.Reference();
|
|
|
|
this.UpdateInfo();
|
|
}
|
|
|
|
private void UpdateInfo()
|
|
{
|
|
var basicInfo = _mutantHandle.GetBasicInformation();
|
|
|
|
labelCurrentCount.Text = basicInfo.CurrentCount.ToString();
|
|
labelAbandoned.Text = basicInfo.AbandonedState.ToString();
|
|
|
|
// Windows Vista and above have owner information.
|
|
if (OSVersion.IsAboveOrEqual(WindowsVersion.Vista))
|
|
{
|
|
var ownerInfo = _mutantHandle.GetOwnerInformation();
|
|
|
|
if (ownerInfo.ClientId.ProcessId != 0)
|
|
{
|
|
labelOwner.Text = ownerInfo.ClientId.GetName(true);
|
|
}
|
|
else
|
|
{
|
|
labelOwner.Text = "N/A";
|
|
}
|
|
|
|
labelLabelOwner.Visible = true;
|
|
labelOwner.Visible = true;
|
|
}
|
|
else
|
|
{
|
|
labelLabelOwner.Visible = false;
|
|
labelOwner.Visible = false;
|
|
}
|
|
}
|
|
}
|
|
}
|