Allocates a GCHandleType.Normal handle for the specified object.
- value
- The object for which the System.Runtime.InteropServices.GCHandle is created. Can be null .
A new System.Runtime.InteropServices.GCHandle instance that protects the object from garbage collection.
Type Reason System.Security.Permissions.SecurityPermission Requires permission to call unmanaged code. See System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode .
A GCHandleType.Normal handle ensures the object will not be collected by the garbage collector.
If the value parameter is null, this method returns a valid System.Runtime.InteropServices.GCHandle.
Note: The target of the handle can be changed via the GCHandle.Target property.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0