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 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.ValueType System.Runtime.InteropServices.ComVisible(true)

If you use platform invoke to call a managed object, and the object is not referenced elsewhere after the platform invoke call, it is possible for the garbage collector to finalize the managed object. This action releases the resource and invalidates the handle, causing the platform invoke call to fail. Wrapping a handle with guarantees that the managed object is not garbage collected until the platform invoke call completes. For a description of platform invoke services, see [<topic://cpconconsumingunmanageddllfunctions>].

The value type, like , is a special type recognized by the interop marshaler. A normal, nonpinned also prevents untimely garbage collection, yet provides better performance. Although using to keep an object alive for the duration of a platform invoke call is preferred, you can also use the method for the same purpose.

The constructor takes two parameters: an representing the wrapper, and an representing the unmanaged handle. The interop marshaler passes only the handle to unmanaged code, and guarantees that the wrapper (passed as the first parameter to the constructor of the HandleRef) remains alive for the duration of the call.

Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class with the object to wrap and a handle to the resource used by unmanaged code.

  A managed object that should not be finalized until the platform invoke call returns.
  An that indicates a handle to a resource.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr To be added: an object of type 'IntPtr' To be added

  Gets the handle to a resource.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr `` To be added. To be added. To be added. To be added.
- 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.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object To be added: an object of type 'object' To be added

  Gets the object holding the handle to a resource.