예제 #1
0
파일: Rdp.cs 프로젝트: najachai/RDPUploader
        internal static void processUpdate(RdpPacket data)
        {
            switch (data.ReadLittleEndian16())
            {
            case 0:
                data.Position += 2L;
                int num2 = data.ReadLittleEndian16();
                data.Position += 2L;
                Orders.processOrders(data, ISO.next_packet, num2);
                return;

            case 1:
                Bitmaps.processBitmapUpdates(data);
                return;

            case 2:
                Palette.processPalette(data);
                break;

            case 3:
                break;

            default:
                return;
            }
        }
예제 #2
0
        public static void ProcessFastPathUpdate(RdpPacket packet)
        {
            while (packet.Length - packet.Position > 3L)
            {
                int num = packet.ReadByte();
                FastPathUpdate.UpdateCode    updateCode    = (FastPathUpdate.UpdateCode)(num & 15);
                FastPathUpdate.Fragmentation fragmentation = (FastPathUpdate.Fragmentation)(num >> 4 & 3);
                bool flag = (num & 128) != 0;

                if (flag)
                {
                    packet.ReadByte();
                }

                if (fragmentation != FastPathUpdate.Fragmentation.FASTPATH_FRAGMENT_SINGLE)
                {
                    throw new RDFatalException("Invalid fragmentation!");
                }

                int littleEndian = packet.ReadLittleEndian16();

                switch (updateCode)
                {
                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_ORDERS:
                {
                    int littleEndian2 = packet.ReadLittleEndian16();
                    Orders.processOrders(packet, (int)packet.Position + littleEndian - 2, littleEndian2);
                    break;
                }

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_BITMAP:
                {
                    int littleEndian3 = packet.ReadLittleEndian16();
                    if (littleEndian3 != 1)
                    {
                        throw new RDFatalException("Invalid fastpath bitmap update!");
                    }
                    Bitmaps.processBitmapUpdates(packet);
                    break;
                }

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_PALETTE:
                {
                    int littleEndian3 = packet.ReadLittleEndian16();

                    if (littleEndian3 != 2)
                    {
                        throw new RDFatalException("Invalid fastpath palette update!");
                    }

                    Palette.processPalette(packet);
                    break;
                }

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_SYNCHRONIZE:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_SURFCMDS:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_PTR_NULL:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_PTR_DEFAULT:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_PTR_POSITION:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_COLOR:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_CACHED:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;

                case FastPathUpdate.UpdateCode.FASTPATH_UPDATETYPE_POINTER:
                    packet.Position = packet.Position + (long)littleEndian;
                    break;
                }
            }
        }