You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
599 B
C#

1 year ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace IOT.Show.Common
{
public class TypeCast
{
public static IntPtr BytesToIntptr(byte[] bytes)
{
int size = bytes.Length;
IntPtr buffer = Marshal.AllocHGlobal(size);
try
{
Marshal.Copy(bytes, 0, buffer, size);
return buffer;
}
finally
{
}
}
}
}