[PTRun][WindowWalker]Fix analyzer errors (#16887)

This commit is contained in:
Jaime Bernardo
2022-03-08 18:23:45 +00:00
committed by GitHub
parent 0a5bdf6734
commit eb961ee052
3 changed files with 5 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
// Hide menu if Explorer.exe is the shell process or the process name is ApplicationFrameHost.exe // Hide menu if Explorer.exe is the shell process or the process name is ApplicationFrameHost.exe
// In the first case we would crash the windows ui and in the second case we would kill the generic process for uwp apps. // In the first case we would crash the windows ui and in the second case we would kill the generic process for uwp apps.
if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower() == "applicationframehost.exe") if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "applicationframehost.exe")
&& !(windowData.Process.IsFullAccessDenied & WindowWalkerSettings.Instance.HideKillProcessOnElevatedProcesses)) && !(windowData.Process.IsFullAccessDenied & WindowWalkerSettings.Instance.HideKillProcessOnElevatedProcesses))
{ {
contextMenu.Add(new ContextMenuResult contextMenu.Add(new ContextMenuResult
@@ -78,7 +78,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
private static bool KillProcessCommand(Window window) private static bool KillProcessCommand(Window window)
{ {
// Validate process // Validate process
if (!window.IsWindow || !window.Process.DoesExist || !window.Process.Name.Equals(WindowProcess.GetProcessNameFromProcessID(window.Process.ProcessID)) ) if (!window.IsWindow || !window.Process.DoesExist || !window.Process.Name.Equals(WindowProcess.GetProcessNameFromProcessID(window.Process.ProcessID), StringComparison.Ordinal) )
{ {
Log.Debug($"Can not kill process '{window.Process.Name}' ({window.Process.ProcessID}) of the window '{window.Title}' ({window.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper)); Log.Debug($"Can not kill process '{window.Process.Name}' ({window.Process.ProcessID}) of the window '{window.Title}' ({window.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
return false; return false;

View File

@@ -26,7 +26,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
foreach (SearchResult x in searchControllerResults) foreach (SearchResult x in searchControllerResults)
{ {
if (x.Result.Process.Name.ToLower() == "explorer.exe" && x.Result.Process.IsShellProcess) if (x.Result.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "explorer.exe" && x.Result.Process.IsShellProcess)
{ {
addExplorerInfo = true; addExplorerInfo = true;
} }

View File

@@ -241,9 +241,9 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper
} }
// If the desktop name was not changed by the user, it isn't saved to the registry. Then we need the default name for the desktop. // If the desktop name was not changed by the user, it isn't saved to the registry. Then we need the default name for the desktop.
var defaultName = string.Format(Resources.VirtualDesktopHelper_Desktop, GetDesktopNumber(desktop)); var defaultName = string.Format(System.Globalization.CultureInfo.InvariantCulture, Resources.VirtualDesktopHelper_Desktop, GetDesktopNumber(desktop));
string registryPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VirtualDesktops\\Desktops\\{" + desktop.ToString().ToUpper() + "}"; string registryPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VirtualDesktops\\Desktops\\{" + desktop.ToString().ToUpper(System.Globalization.CultureInfo.InvariantCulture) + "}";
RegistryKey deskSubKey = Registry.CurrentUser.OpenSubKey(registryPath, false); RegistryKey deskSubKey = Registry.CurrentUser.OpenSubKey(registryPath, false);
var desktopName = deskSubKey?.GetValue("Name"); var desktopName = deskSubKey?.GetValue("Name");