RuntimeInfrastructure mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.ValueType System.Runtime.InteropServices.ComVisible(true)

The structure is used with the enumeration to create a handle corresponding to any managed object. This handle can be one of four types: Weak, WeakTrackResurrection, Normal, or Pinned. When the handle has been allocated, you can use it to prevent the managed object from being collected by the garbage collector when an unmanaged client holds the only reference. Without such a handle, the object can be collected by the garbage collector before completing its work on behalf of the unmanaged client.

You can also use to create a pinned object that returns a memory address to prevent the garbage collector from moving the object in memory.

When the handle goes out of scope you must explicitly release it by calling the method; otherwise, memory leaks may occur. When you free a pinned handle, the associated object will be unpinned and will become eligible for garbage collection, if there are no other references to it.

Provides a way to access a managed object from unmanaged memory.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr The handle type is not .

  Requires permission to call unmanaged code. See .

  This method is used to get a stable pointer to the object. Pinning an object prevents the garbage collector from moving it around in memory, thereby reducing the efficiency of the garbage collector.

  Retrieves the address of an object in a handle.

  The address of the of the Pinned object as an .

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.GCHandle ``

  Requires permission to call unmanaged code. See .

  handles are opaque, which means that you cannot resolve the address of the object it contains through the handle.

  Allocates a handle for the specified object.

  A new that protects the object from garbage collection. This must be released with when it is no longer needed.

  The object that uses the . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.GCHandle `` ``

  If the parameter is , this method returns a valid . The target of the handle can be changed via the property.

  Requires permission to call unmanaged code. See .

  One of the values, indicating the type of to create.

  Allocates a handle of the specified type for the specified object.

  A new of the specified type. This must be released with when it is no longer needed.

  The object that uses the . One of the values, indicating the type of to create. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Two objects are equal if they point to the same memory handle.

  Determines whether the specified object is equal to the current object.

  true if the specified object is equal to the current object; otherwise, false.

  The object to compare with the current object.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void The handle has already been freed or was never initialized.

  Requires permission to call unmanaged code. See .

  The caller must ensure that for a given handle, is called only once.

  Releases a .

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.GCHandle `` To be added.

  Returns a new object created from a handle to a managed object.

  A new object that corresponds to the value parameter.

  An handle to a managed object to create a object from.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32

  The method returns an integer representation of the internal memory handle encapsulated by the structure.

  Returns an identifier for the current object.

  An identifier for the current object.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  if the handle is allocated; otherwise, .

  Use this property when using handles to determine if the is still available. When the garbage collector collects the object, the handle can still be resurrected in the finalizer. In that case, the handle is not allocated (it is lost when the garbage collector attempts to collect the object), even though the target object is valid.

  Gets a value indicating whether the handle is allocated.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added.

  Returns a value indicating whether two objects are equal.

  true if the and parameters are equal; otherwise, false.

  A object to compare with the parameter. A object to compare with the parameter.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.GCHandle `` The to be converted.

  Convert a to a instance.

  A .

  instances are stored using an internal integer representation. This method allows you to retrieve a from its integer representation.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr `` The to be converted.

  Converts a instance to a .

  A representation of the specified .

  instances are stored using an internal integer representation. This method allows you to retrieve that representation.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added.

  Returns a value indicating whether two objects are not equal.

  true if the and parameters are not equal; otherwise, false.

  A object to compare with the parameter. A object to compare with the parameter.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  The object this handle represents.

  To be added.

  The current instance has already been freed or was never initialized.

  Gets or sets the object this handle represents.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.IntPtr `` To be added.

  Returns the internal integer representation of a object.

  An object that represents a object.

  A object to retrieve an internal integer representation from.
0