示例#1
0
        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);
        }
示例#2
0
 private string Func(TunerServer.Api api)
 {
     return(this.Func(api, null, true));
 }
示例#3
0
 private void Call(TunerServer.Api api)
 {
     this.Func(api, null, false);
 }
示例#4
0
 private string Func(TunerServer.Api api, string arg)
 {
     return(this.Func(api, arg, true));
 }
示例#5
0
 private void Call(TunerServer.Api api, string arg)
 {
     this.Func(api, arg, false);
 }