InternalAddrOfPinnedObject() private method

private InternalAddrOfPinnedObject ( IntPtr handle ) : IntPtr
handle System.IntPtr
return System.IntPtr
コード例 #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"));
 }