예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <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);