internal void serverFileContentsRequest(RdpPacket data) { if (!((MsgFlags)data.ReadLittleEndian16()).HasFlag(MsgFlags.NOT_SET)) { throw new Exception("Error NOT_SET message flag!"); } data.ReadLittleEndian32(); // length StreamID = data.ReadLittleEndianU32(); // Stream ID data.ReadLittleEndianU32(); // lindex var flag = (FILECONTENTS_SIZE)data.ReadLittleEndianU32(); if (flag.HasFlag(FILECONTENTS_SIZE.FILECONTENTS_SIZE)) { Debug.WriteLine("FILECONTENTS_SIZE!"); data.ReadLittleEndian32(); // 0x00000000 data.ReadLittleEndian32(); // 0x00000000 if (data.ReadLittleEndian32() != 0x00000008) { Debug.WriteLine("The cbRequested field MUST be set to 0x00000008!"); } data.ReadLittleEndian32(); // clipDataId FileCanLoad = false; Debug.WriteLine("FILECONTENTS_SIZE!"); } else if (flag.HasFlag(FILECONTENTS_SIZE.FILECONTENTS_RANGE)) { FileCanLoad = true; Debug.WriteLine("FILECONTENTS_RANGE!"); data.ReadLittleEndian32(); data.ReadLittleEndian32(); BufferNextPart = data.ReadLittleEndian32(); // cbRequested } }