* disabling "Warn about dangerous actions" now disables all process-related prompts

* sorted the WTS functions

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1381 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2009-06-06 23:53:59 +00:00
parent 2339135a86
commit d4e7794583
4 changed files with 64 additions and 51 deletions
+2
View File
@@ -18,6 +18,8 @@ Process Hacker
* Windows 7 RC BSOD (Windows 7 Beta is no longer supported) at
startup; support is STILL EXPERIMENTAL
* Memory search addresses being in decimal
* Disabling "Warn about dangerous actions" now disables all
process-related prompts
1.3.8.0
* NEW/IMPROVED:
+47 -39
View File
@@ -1466,29 +1466,10 @@ namespace ProcessHacker.Native.Api
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSQuerySessionInformation(
[In] IntPtr ServerHandle,
[In] int SessionID,
[In] WtsInformationClass InfoClass,
[Out] out IntPtr Buffer,
[Out] out int BytesReturned
);
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSQuerySessionInformation(
[In] IntPtr ServerHandle,
[In] int SessionID,
[In] WtsInformationClass InfoClass,
[Out] out string Buffer,
[Out] out int BytesReturned
);
[DllImport("wtsapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSLogoffSession(
[In] IntPtr ServerHandle,
[In] int SessionID,
public static extern bool WTSConnectSession(
[In] int LogonId,
[In] int TargetLogonId,
[In] string Password,
[In] bool Wait
);
@@ -1496,16 +1477,18 @@ namespace ProcessHacker.Native.Api
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSDisconnectSession(
[In] IntPtr ServerHandle,
[In] int SessionID,
[In] int SessionId,
[In] bool Wait
);
[DllImport("wtsapi32.dll", SetLastError = true)]
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSTerminateProcess(
public static extern bool WTSEnumerateProcesses(
[In] IntPtr ServerHandle,
[In] int ProcessID,
[In] int ExitCode
[In] int Reserved,
[In] int Version,
[Out] out IntPtr ProcessInfo,
[Out] out int Count
);
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
@@ -1518,25 +1501,50 @@ namespace ProcessHacker.Native.Api
[Out] out int Count
);
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSEnumerateProcesses(
[In] IntPtr ServerHandle,
[In] int Reserved,
[In] int Version,
[Out] out IntPtr ProcessInfo,
[Out] out int Count
);
[DllImport("wtsapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSFreeMemory(
[In] IntPtr Memory
);
[DllImport("wtsapi32.dll", SetLastError = true)]
public static extern int WTSGetActiveConsoleSessionId();
[DllImport("wtsapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSFreeMemory([In] string Memory);
public static extern bool WTSLogoffSession(
[In] IntPtr ServerHandle,
[In] int SessionId,
[In] bool Wait
);
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSQuerySessionInformation(
[In] IntPtr ServerHandle,
[In] int SessionId,
[In] WtsInformationClass InfoClass,
[Out] out IntPtr Buffer,
[Out] out int BytesReturned
);
[DllImport("wtsapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSQuerySessionInformation(
[In] IntPtr ServerHandle,
[In] int SessionId,
[In] WtsInformationClass InfoClass,
[Out] out string Buffer,
[Out] out int BytesReturned
);
[DllImport("wtsapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool WTSTerminateProcess(
[In] IntPtr ServerHandle,
[In] int ProcessId,
[In] int ExitCode
);
#endregion
+12 -12
View File
@@ -60,6 +60,7 @@
this.checkHideHandlesWithNoName = new System.Windows.Forms.CheckBox();
this.checkVerifySignatures = new System.Windows.Forms.CheckBox();
this.tabHighlighting = new System.Windows.Forms.TabPage();
this.label11 = new System.Windows.Forms.Label();
this.buttonDisableAll = new System.Windows.Forms.Button();
this.buttonEnableAll = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
@@ -97,7 +98,6 @@
this.toolTipProvider = new System.Windows.Forms.ToolTip(this.components);
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonApply = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.textUpdateInterval)).BeginInit();
this.tabControl.SuspendLayout();
this.tabGeneral.SuspendLayout();
@@ -184,8 +184,8 @@
this.checkWarnDangerous.Size = new System.Drawing.Size(228, 18);
this.checkWarnDangerous.TabIndex = 4;
this.checkWarnDangerous.Text = "Warn about potentially dangerous actions";
this.toolTipProvider.SetToolTip(this.checkWarnDangerous, "Warns about any attempts to suspend a system process or inspect a system process\'" +
" thread.");
this.toolTipProvider.SetToolTip(this.checkWarnDangerous, "Warns about any attempts to terminate a process, suspend a system process, and si" +
"milar actions.");
this.checkWarnDangerous.UseVisualStyleBackColor = true;
//
// label2
@@ -546,6 +546,15 @@
this.tabHighlighting.Text = "Highlighting";
this.tabHighlighting.UseVisualStyleBackColor = true;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 295);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(165, 13);
this.label11.TabIndex = 13;
this.label11.Text = "Double-click an item to change it.";
//
// buttonDisableAll
//
this.buttonDisableAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -960,15 +969,6 @@
this.buttonApply.UseVisualStyleBackColor = true;
this.buttonApply.Click += new System.EventHandler(this.buttonApply_Click);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 295);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(165, 13);
this.label11.TabIndex = 13;
this.label11.Text = "Double-click an item to change it.";
//
// OptionsWindow
//
this.AcceptButton = this.buttonOK;
@@ -36,6 +36,9 @@ namespace ProcessHacker.UI.Actions
private static bool Prompt(IWin32Window window, int[] pids, string[] names,
string action, string content, bool promptOnlyIfDangerous)
{
if (!Properties.Settings.Default.WarnDangerous)
return true;
string name = "the selected process(es)";
if (pids.Length == 1)