private string Func(TunerServer.Api api, string arg, bool isRet) { IntPtr intPtr = TunerServer.FindWindow("/tvmaid/win", this.driverId); if (intPtr == IntPtr.Zero) { throw new Exception("TVTest呼び出しに失敗しました(TVTestが終了されました)。"); } Ticket ticket = new Ticket("/tvmaid/mutex/call/" + this.driverId); Shared shared = null; Shared shared2 = null; string result; try { if (!ticket.GetOwner(60000)) { throw new Exception("TVTest呼び出しに失敗しました(タイムアウト)。"); } if (arg != null) { shared = new Shared("/tvmaid/map/in/" + this.driverId); shared.Write(arg); } if (isRet) { shared2 = new Shared("/tvmaid/map/out/" + this.driverId); } UIntPtr uIntPtr; if (TunerServer.SendMessageTimeout(intPtr, (uint)api, UIntPtr.Zero, IntPtr.Zero, 0u, 60000u, out uIntPtr).ToInt32() == 0) { throw new Exception("TVTest呼び出しに失敗しました(タイムアウト)。"); } uint num = uIntPtr.ToUInt32(); if (num != 0u) { throw new TunerServerExceotion(num); } result = (isRet ? shared2.Read() : null); } finally { if (shared != null) { shared.Dispose(); } if (shared2 != null) { shared2.Dispose(); } ticket.Dispose(); } return(result); }
private string Func(TunerServer.Api api) { return(this.Func(api, null, true)); }
private void Call(TunerServer.Api api) { this.Func(api, null, false); }
private string Func(TunerServer.Api api, string arg) { return(this.Func(api, arg, true)); }
private void Call(TunerServer.Api api, string arg) { this.Func(api, arg, false); }