Table of Contents

Class HGlobalSafeHandle

Namespace
Ecng.Interop
Assembly
Ecng.Interop.dll

Represents a safe handle for unmanaged memory allocated with HGlobal.

public class HGlobalSafeHandle : SafeHandleZeroOrMinusOneIsInvalid, IDisposable
Inheritance
HGlobalSafeHandle
Implements
Inherited Members
Extension Methods

Constructors

HGlobalSafeHandle(IntPtr)

Initializes a new instance of the HGlobalSafeHandle class with the specified pointer.

public HGlobalSafeHandle(IntPtr ptr)

Parameters

ptr IntPtr

An IntPtr that represents the allocated unmanaged memory.

Methods

ReleaseHandle()

Releases the unmanaged memory by freeing the HGlobal allocation.

protected override bool ReleaseHandle()

Returns

bool

true if the handle is released successfully; otherwise, false.