69 lines
2.7 KiB
C#
69 lines
2.7 KiB
C#
using System;
|
|
|
|
namespace System.Runtime.InteropServices
|
|
{
|
|
/// <summary>Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke.</summary>
|
|
// Token: 0x02000318 RID: 792
|
|
[ComVisible(true)]
|
|
public struct HandleRef
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.HandleRef" /> class with the object to wrap and a handle to the resource used by unmanaged code.</summary>
|
|
/// <param name="wrapper">A managed object that should not be finalized until the platform invoke call returns. </param>
|
|
/// <param name="handle">An <see cref="T:System.IntPtr" /> that indicates a handle to a resource. </param>
|
|
// Token: 0x06002216 RID: 8726 RVA: 0x00079740 File Offset: 0x00077940
|
|
public HandleRef(object wrapper, IntPtr handle)
|
|
{
|
|
this.wrapper = wrapper;
|
|
this.handle = handle;
|
|
}
|
|
|
|
/// <summary>Gets the handle to a resource.</summary>
|
|
/// <returns>The handle to a resource.</returns>
|
|
// Token: 0x1700064F RID: 1615
|
|
// (get) Token: 0x06002217 RID: 8727 RVA: 0x00079750 File Offset: 0x00077950
|
|
public IntPtr Handle
|
|
{
|
|
get
|
|
{
|
|
return this.handle;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the object holding the handle to a resource.</summary>
|
|
/// <returns>The object holding the handle to a resource.</returns>
|
|
// Token: 0x17000650 RID: 1616
|
|
// (get) Token: 0x06002218 RID: 8728 RVA: 0x00079758 File Offset: 0x00077958
|
|
public object Wrapper
|
|
{
|
|
get
|
|
{
|
|
return this.wrapper;
|
|
}
|
|
}
|
|
|
|
/// <summary>Returns the internal integer representation of a <see cref="T:System.Runtime.InteropServices.HandleRef" /> object.</summary>
|
|
/// <returns>An <see cref="T:System.IntPtr" /> object that represents a <see cref="T:System.Runtime.InteropServices.HandleRef" /> object.</returns>
|
|
/// <param name="value">A <see cref="T:System.Runtime.InteropServices.HandleRef" /> object to retrieve an internal integer representation from.</param>
|
|
// Token: 0x06002219 RID: 8729 RVA: 0x00079760 File Offset: 0x00077960
|
|
public static IntPtr ToIntPtr(HandleRef value)
|
|
{
|
|
return value.Handle;
|
|
}
|
|
|
|
/// <summary>Returns the handle to a resource of the specified <see cref="T:System.Runtime.InteropServices.HandleRef" /> object.</summary>
|
|
/// <returns>The handle to a resource of the specified <see cref="T:System.Runtime.InteropServices.HandleRef" /> object.</returns>
|
|
/// <param name="value">The object that needs a handle. </param>
|
|
// Token: 0x0600221A RID: 8730 RVA: 0x0007976C File Offset: 0x0007796C
|
|
public static explicit operator IntPtr(HandleRef value)
|
|
{
|
|
return value.Handle;
|
|
}
|
|
|
|
// Token: 0x04000D41 RID: 3393
|
|
private object wrapper;
|
|
|
|
// Token: 0x04000D42 RID: 3394
|
|
private IntPtr handle;
|
|
}
|
|
}
|