SafeProcessHandle 类

定义

为一个进程句柄提供托管包装器。Provides a managed wrapper for a process handle.

public ref class SafeProcessHandle sealed : Microsoft::Win32::SafeHandles::SafeHandleZeroOrMinusOneIsInvalid
[System.Security.SecurityCritical]
public sealed class SafeProcessHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
type SafeProcessHandle = class
    inherit SafeHandleZeroOrMinusOneIsInvalid
Public NotInheritable Class SafeProcessHandle
Inherits SafeHandleZeroOrMinusOneIsInvalid
继承
属性

构造函数

SafeProcessHandle(IntPtr, Boolean)

从指定句柄初始化 SafeProcessHandle 类的新实例,这指示在完成阶段是否释放句柄。Initializes a new instance of the SafeProcessHandle class from the specified handle, indicating whether to release the handle during the finalization phase.

字段

handle

指定要包装的句柄。Specifies the handle to be wrapped.

(继承自 SafeHandle)

属性

IsClosed

获取一个值,该值指示句柄是否已关闭。Gets a value indicating whether the handle is closed.

(继承自 SafeHandle)
IsInvalid

方法

Close()

标记句柄,以便释放资源。Marks the handle for releasing and freeing resources.

(继承自 SafeHandle)
DangerousAddRef(Boolean)

手动递增 SafeHandle 实例中的引用计数器。Manually increments the reference counter on SafeHandle instances.

(继承自 SafeHandle)
DangerousGetHandle()

返回 handle 字段的值。Returns the value of the handle field.

(继承自 SafeHandle)
DangerousRelease()

手动递减 SafeHandle 实例中的引用计数器。Manually decrements the reference counter on a SafeHandle instance.

(继承自 SafeHandle)
Dispose()

释放 SafeHandle 类使用的所有资源。Releases all resources used by the SafeHandle class.

(继承自 SafeHandle)
Dispose(Boolean)

释放 SafeHandle 类所使用的非托管资源,并指定是否执行常规释放 (Dispose) 操作。Releases the unmanaged resources used by the SafeHandle class specifying whether to perform a normal dispose operation.

(继承自 SafeHandle)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ReleaseHandle()

如果在派生类中重写,执行释放句柄所需的代码。When overridden in a derived class, executes the code required to free the handle.

(继承自 SafeHandle)
SetHandle(IntPtr)

将句柄设置为预先存在的指定句柄。Sets the handle to the specified pre-existing handle.

(继承自 SafeHandle)
SetHandleAsInvalid()

将句柄标记为不再使用。Marks a handle as no longer used.

(继承自 SafeHandle)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于