summaryrefslogtreecommitdiffstats
path: root/WhisperNet/Internal/sCaptureCallbacks.cs
blob: 35b00dff74415e05817362c4f45dc83b437918a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Runtime.InteropServices;

namespace Whisper.Internal
{
	/// <summary>Unmanaged code calls this to check for cancellation</summary>
	/// <remarks>Return 0 to proceed, or 1 to stop the process and return from Context.runCapture method</remarks>
	[UnmanagedFunctionPointer( CallingConvention.StdCall )]
	public delegate int pfnShouldCancel( IntPtr pv );

	/// <summary>Unmanaged code calls this to notify about the status</summary>
	[UnmanagedFunctionPointer( CallingConvention.StdCall )]
	public delegate int pfnCaptureStatus( IntPtr pv, eCaptureStatus status );

	/// <summary>Capture callbacks for unmanaged code</summary>
	public struct sCaptureCallbacks
	{
		/// <summary>Cancellation function pointer</summary>
		public pfnShouldCancel shouldCancel;
		/// <summary>Capture status function pointer</summary>
		public pfnCaptureStatus captureStatus;
		/// <summary>Context pointer, only needed for C++ compatibility</summary>
		public IntPtr pv;
	}
}