/// <summary> /// Allocates a pointer for a WAVEHDR structure /// </summary> /// <param name="wAVEHDR"></param> /// <returns></returns> public static IntPtr AllocWAVEHDR(WAVEHDR wAVEHDR) { var result = Marshal.AllocHGlobal(Marshal.SizeOf(wAVEHDR)); Marshal.StructureToPtr(wAVEHDR, result, true); return(result); }
/// <summary> /// Writes a WAVEHDR structure to the given pointer without destroying the pointer or structure /// </summary> /// <param name="intPtr"></param> /// <param name="wAVEHDR"></param> public static void WriteWAVEHDR(IntPtr intPtr, WAVEHDR wAVEHDR) => Marshal.StructureToPtr(wAVEHDR, intPtr, true);