Replace naudio.dll with code

This commit is contained in:
CroakFang
2022-09-10 16:59:44 +08:00
parent 3c17d8770d
commit 19dbe75b53
1113 changed files with 50280 additions and 182 deletions
@@ -0,0 +1,35 @@
using System;
using System.Runtime.InteropServices;
namespace NAudio.Utils
{
/// <summary>
/// Support for Marshal Methods in both UWP and .NET 3.5
/// </summary>
public static class MarshalHelpers
{
/// <summary>
/// SizeOf a structure
/// </summary>
public static int SizeOf<T>()
{
return Marshal.SizeOf(typeof (T));
}
/// <summary>
/// Offset of a field in a structure
/// </summary>
public static IntPtr OffsetOf<T>(string fieldName)
{
return Marshal.OffsetOf(typeof(T), fieldName);
}
/// <summary>
/// Pointer to Structure
/// </summary>
public static T PtrToStructure<T>(IntPtr pointer)
{
return (T)Marshal.PtrToStructure(pointer, typeof(T));
}
}
}