SafeMemoryMappedFileHandle 类

定义

提供了一个表示顺序访问的内存映射文件的安全句柄。

public ref class SafeMemoryMappedFileHandle sealed : Microsoft::Win32::SafeHandles::SafeHandleZeroOrMinusOneIsInvalid
public ref class SafeMemoryMappedFileHandle sealed : System::Runtime::InteropServices::SafeHandle
public sealed class SafeMemoryMappedFileHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
public sealed class SafeMemoryMappedFileHandle : System.Runtime.InteropServices.SafeHandle
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public sealed class SafeMemoryMappedFileHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
type SafeMemoryMappedFileHandle = class
    inherit SafeHandleZeroOrMinusOneIsInvalid
type SafeMemoryMappedFileHandle = class
    inherit SafeHandle
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type SafeMemoryMappedFileHandle = class
    inherit SafeHandleZeroOrMinusOneIsInvalid
Public NotInheritable Class SafeMemoryMappedFileHandle
Inherits SafeHandleZeroOrMinusOneIsInvalid
Public NotInheritable Class SafeMemoryMappedFileHandle
Inherits SafeHandle
继承
继承
SafeMemoryMappedFileHandle
属性

注解

MemoryMappedFile.SafeMemoryMappedFileHandle使用 属性获取安全句柄。

重要

此类型实现 IDisposable 接口。 在使用完类型后,您应直接或间接释放类型。 若要直接释放类型,请在 try/catch 块中调用其 Dispose 方法。 若要间接释放类型,请使用 using(在 C# 中)或 Using(在 Visual Basic 中)等语言构造。 有关详细信息,请参阅 IDisposable 接口主题中的“使用实现 IDisposable 的对象”一节。

构造函数

SafeMemoryMappedFileHandle()

创建一个 SafeMemoryMappedFileHandle

字段

handle

指定要包装的句柄。

(继承自 SafeHandle)

属性

IsClosed

获取一个值,该值指示句柄是否已关闭。

(继承自 SafeHandle)
IsInvalid

获取一个值,该值指示句柄是否无效。

IsInvalid

获取一个值,该值指示句柄是否无效。

(继承自 SafeHandleZeroOrMinusOneIsInvalid)

方法

Close()

标记句柄,以便释放资源。

(继承自 SafeHandle)
DangerousAddRef(Boolean)

手动递增 SafeHandle 实例中的引用计数器。

(继承自 SafeHandle)
DangerousGetHandle()

返回 handle 字段的值。

(继承自 SafeHandle)
DangerousRelease()

手动递减 SafeHandle 实例中的引用计数器。

(继承自 SafeHandle)
Dispose()

释放 SafeHandle 类使用的所有资源。

(继承自 SafeHandle)
Dispose(Boolean)

释放 SafeHandle 类所使用的非托管资源,指定是否执行常规释放操作。

(继承自 SafeHandle)
Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ReleaseHandle()

在派生类中重写时,执行释放句柄所需的代码。

(继承自 SafeHandle)
SetHandle(IntPtr)

将句柄设置为预先存在的指定句柄。

(继承自 SafeHandle)
SetHandleAsInvalid()

将句柄标记为不再使用。

(继承自 SafeHandle)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于