/** * Copyright Epic Games, Inc. All Rights Reserved. */ using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace MobileDeviceInterface { /// /// This is a simple generic to provide a limited form of type safety for IntPtr arguments to /// structs of unknown contents (so we can't just marshal them as unique types) /// public struct TypedPtr { public IntPtr Handle; public TypedPtr(IntPtr Ptr) { Handle = Ptr; } public static implicit operator TypedPtr(IntPtr Ptr) { return new TypedPtr(Ptr); } public static explicit operator IntPtr(TypedPtr Ptr) { return Ptr.Handle; } } }