コード例 #1
0
ファイル: ControlFlow.cs プロジェクト: najachai/RDPUploader
        internal static void processDemandActive(RdpPacket data)
        {
            int num3;

            rdp_shareid = data.ReadLittleEndian32();
            int num = data.ReadLittleEndian16();

            data.ReadLittleEndian16();
            data.Position += num;
            int numCaps = data.ReadLittleEndian16();

            data.ReadLittleEndian16();
            processServerCapabilities(data, numCaps);
            sendConfirmActive();
            sendSynchronize();
            sendControl(4);
            sendControl(1);
            ISO.Secure_receive(out num3);
            ISO.Secure_receive(out num3);
            ISO.Secure_receive(out num3);

            if (Options.persistentBmpCache && !m_bInitialised)
            {
                sendPersistKeyList();
            }

            List <Rdp.InputInfo> inputToSend = new List <Rdp.InputInfo>
            {
                new Rdp.InputInfo(0, Rdp.InputType.INPUT_EVENT_SYNC, 0, 0, 0)
            };

            //if (m_bInitialised)
            //{
            //    Options.OnInitialise();
            //}
            m_bInitialised = true;

            IsoLayer.FastSendInput(inputToSend);
            sendFontList();
            ISO.Secure_receive(out num3);
            resetOrderState();
        }
コード例 #2
0
ファイル: Rdp.cs プロジェクト: najachai/RDPUploader
        // Input
        internal static void inputloop()
        {
            m_bHalt = false;
            m_bExceptionReported = false;
            m_InputCache.Clear();
            m_KeepAliveTimer = DateTime.Now;

            try
            {
                List <InputInfo> inputToSend = new List <InputInfo>();
                List <InputInfo> list2       = new List <InputInfo>();

                while (!m_bHalt)
                {
                    lock (m_InputCache)
                    {
                        inputToSend.Clear();
                        DateTime now = DateTime.Now;

                        foreach (InputInfo info in m_InputCache)
                        {
                            TimeSpan span = (TimeSpan)(now - info.TimeStamp);

                            if (span.TotalMilliseconds > 80)
                            {
                                inputToSend.Add(info);
                                list2.Add(info);
                            }
                        }

                        TimeSpan span2 = (TimeSpan)(DateTime.Now - m_KeepAliveTimer);

                        if (span2.TotalSeconds > 30)
                        {
                            IsoLayer.RefreshRect(new Rectangle[] { new Rectangle(0, 0, 0x20, 0x20) });
                        }

                        foreach (InputInfo info2 in list2)
                        {
                            m_InputCache.Remove(info2);
                        }

                        list2.Clear();
                    }

                    if (inputToSend.Count > 0)
                    {
                        IsoLayer.FastSendInput(inputToSend);
                    }

                    Thread.Sleep(60);
                }
            }
            catch (EndOfTransmissionException)
            {
                Options.OnClosed();
            }
            catch (SocketAbortException)
            {
            }
            catch (ThreadAbortException)
            {
            }
            catch (Exception exception)
            {
                if (!m_bExceptionReported)
                {
                    m_bExceptionReported = true;
                    Options.OnError(exception);
                }
            }
        }