本文整理汇总了C#中ProcessHandle.IsWow64方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessHandle.IsWow64方法的具体用法?C# ProcessHandle.IsWow64怎么用?C# ProcessHandle.IsWow64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessHandle
的用法示例。
在下文中一共展示了ProcessHandle.IsWow64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateProcessProperties
private void UpdateProcessProperties()
{
try
{
string fileName;
if (_pid == 4)
fileName = Windows.KernelFileName;
else
fileName = _processItem.FileName;
if (fileName == null)
{
pictureIcon.Image = _processImage = ProcessHacker.Properties.Resources.Process.ToBitmap();
return;
}
FileVersionInfo info = _processItem.VersionInfo;
textFileDescription.Text = info.FileDescription;
textFileCompany.Text = info.CompanyName;
textFileVersion.Text = info.FileVersion;
fileImage.Text = info.FileName;
try
{
pictureIcon.Image = _processImage = _processItem.LargeIcon.ToBitmap();
}
catch
{
pictureIcon.Image = _processImage = ProcessHacker.Properties.Resources.Process.ToBitmap();
}
var verifyResult = _processItem.VerifyResult;
if (verifyResult == VerifyResult.Unknown)
textFileCompany.Text += "";
else if (verifyResult == VerifyResult.Trusted)
textFileCompany.Text += " (verified)";
else if (verifyResult == VerifyResult.TrustedInstaller)
textFileCompany.Text += " (verified, Windows component)";
else if (verifyResult == VerifyResult.NoSignature)
textFileCompany.Text += " (not verified, no signature)";
else if (verifyResult == VerifyResult.Distrust)
textFileCompany.Text += " (not verified, distrusted)";
else if (verifyResult == VerifyResult.Expired)
textFileCompany.Text += " (not verified, expired)";
else if (verifyResult == VerifyResult.Revoked)
textFileCompany.Text += " (not verified, revoked)";
else if (verifyResult == VerifyResult.SecuritySettings)
textFileCompany.Text += " (not verified, security settings)";
else
textFileCompany.Text += " (not verified)";
}
catch
{
fileImage.Text = _processItem.FileName;
textFileDescription.Text = "";
textFileCompany.Text = "";
}
if (IntPtr.Size == 4)
{
labelProcessType.Visible = false;
labelProcessTypeValue.Visible = false;
}
else
{
labelProcessType.Visible = true;
labelProcessTypeValue.Visible = true;
try
{
using (ProcessHandle phandle = new ProcessHandle(_pid, Program.MinProcessQueryRights))
{
labelProcessTypeValue.Text = phandle.IsWow64() ? "32-bit" : "64-bit";
}
}
catch (Exception ex)
{
labelProcessTypeValue.Text = "(" + ex.Message + ")";
}
}
if (_pid <= 0)
return;
if (_processItem.CmdLine != null)
textCmdLine.Text = _processItem.CmdLine.Replace("\0", "");
try
{
DateTime startTime = DateTime.FromFileTime(_processItem.Process.CreateTime);
textStartTime.Text = Utils.FormatRelativeDateTime(startTime) +
" (" + startTime.ToString() + ")";
}
catch (Exception ex)
//.........这里部分代码省略.........
示例2: UpdateProcessProperties
private void UpdateProcessProperties()
{
try
{
string fileName;
if (_pid == 4)
fileName = Windows.KernelFileName;
else
fileName = _processItem.FileName;
if (fileName == null)
{
pictureIcon.Image = _processImage = ProcessHacker.Properties.Resources.Process.ToBitmap();
return;
}
var info = _processItem.VersionInfo;
textFileDescription.Text = info.FileDescription;
textFileCompany.Text = info.CompanyName;
textFileVersion.Text = info.FileVersion;
fileImage.Text = info.FileName;
try
{
pictureIcon.Image = _processImage = _processItem.LargeIcon.ToBitmap();
}
catch
{
pictureIcon.Image = _processImage = ProcessHacker.Properties.Resources.Process.ToBitmap();
}
var verifyResult = _processItem.VerifyResult;
if (verifyResult == VerifyResult.Trusted && !string.IsNullOrEmpty(_processItem.VerifySignerName))
textFileCompany.Text = _processItem.VerifySignerName;
if (verifyResult == VerifyResult.Unknown)
textFileCompany.Text += "";
else if (verifyResult == VerifyResult.Trusted)
textFileCompany.Text += " (verified)";
else if (verifyResult == VerifyResult.NoSignature)
textFileCompany.Text += " (not verified, no signature)";
else if (verifyResult == VerifyResult.Distrust)
textFileCompany.Text += " (not verified, distrusted)";
else if (verifyResult == VerifyResult.Expired)
textFileCompany.Text += " (not verified, expired)";
else if (verifyResult == VerifyResult.Revoked)
textFileCompany.Text += " (not verified, revoked)";
else if (verifyResult == VerifyResult.SecuritySettings)
textFileCompany.Text += " (not verified, security settings)";
else
textFileCompany.Text += " (not verified)";
}
catch
{
fileImage.Text = _processItem.FileName;
textFileDescription.Text = "";
textFileCompany.Text = "";
}
// Update WOW64 info.
if (OSVersion.Architecture == OSArch.I386)
{
// 32-bit. Hide the labels.
labelProcessType.Visible = false;
labelProcessTypeValue.Visible = false;
}
else
{
// 64-bit. Show the label.
labelProcessType.Visible = true;
labelProcessTypeValue.Visible = true;
try
{
using (ProcessHandle phandle = new ProcessHandle(_pid, Program.MinProcessQueryRights))
{
labelProcessTypeValue.Text = phandle.IsWow64() ? "32-bit" : "64-bit";
}
}
catch (Exception ex)
{
labelProcessTypeValue.Text = "(" + ex.Message + ")";
}
}
if (_pid <= 0)
return;
if (_processItem.CmdLine != null)
textCmdLine.Text = _processItem.CmdLine.Replace("\0", "");
try
{
DateTime startTime = DateTime.FromFileTime(_processItem.Process.CreateTime);
textStartTime.Text = Utils.FormatRelativeDateTime(startTime) +
" (" + startTime.ToString() + ")";
//.........这里部分代码省略.........