System.Runtime.InteropServices.GCHandle.InternalAddrOfPinnedObject C# (CSharp) Method

InternalAddrOfPinnedObject() private method

private InternalAddrOfPinnedObject ( IntPtr handle ) : IntPtr
handle System.IntPtr
return System.IntPtr
        internal static extern IntPtr InternalAddrOfPinnedObject(IntPtr handle);
        [MethodImplAttribute(MethodImplOptions.InternalCall)]

Usage Example

Example #1
0
 public IntPtr AddrOfPinnedObject()
 {
     if (this.IsPinned())
     {
         return(GCHandle.InternalAddrOfPinnedObject(this.GetHandleValue()));
     }
     if (this.m_handle == IntPtr.Zero)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HandleIsNotInitialized"));
     }
     throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HandleIsNotPinned"));
 }