void receive(Stream & stream, const RDPPrimaryOrderHeader & header) { // LOG(LOG_INFO, "RDPMultiDstBlt::receive: header fields=0x%02X", header.fields); header.receive_coord(stream, 0x0001, this->nLeftRect); header.receive_coord(stream, 0x0002, this->nTopRect); header.receive_coord(stream, 0x0004, this->nWidth); header.receive_coord(stream, 0x0008, this->nHeight); if (header.fields & 0x0010) { this->bRop = stream.in_uint8(); } if (header.fields & 0x0020) { this->nDeltaEntries = stream.in_uint8(); } if (header.fields & 0x0040) { uint16_t cbData = stream.in_uint16_le(); // LOG(LOG_INFO, "cbData=%d", cbData); SubStream rgbData(stream, stream.get_offset(), cbData); stream.in_skip_bytes(cbData); // hexdump_d(rgbData.p, rgbData.size()); uint8_t zeroBitsSize = ((this->nDeltaEntries + 1) / 2); // LOG(LOG_INFO, "zeroBitsSize=%d", zeroBitsSize); SubStream zeroBits(rgbData, rgbData.get_offset(), zeroBitsSize); rgbData.in_skip_bytes(zeroBitsSize); uint8_t zeroBit = 0; for (uint8_t i = 0, m2 = 0; i < this->nDeltaEntries; i++, m2++) { if (m2 == 2) { m2 = 0; } if (!m2) { zeroBit = zeroBits.in_uint8(); // LOG(LOG_INFO, "0x%02X", zeroBit); } this->deltaEncodedRectangles[i].leftDelta = (!(zeroBit & 0x80) ? rgbData.in_DEP() : 0); this->deltaEncodedRectangles[i].topDelta = (!(zeroBit & 0x40) ? rgbData.in_DEP() : 0); this->deltaEncodedRectangles[i].width = (!(zeroBit & 0x20) ? rgbData.in_DEP() : 0); this->deltaEncodedRectangles[i].height = (!(zeroBit & 0x10) ? rgbData.in_DEP() : 0); /* LOG(LOG_INFO, "RDPMultiDstBlt::receive: delta rectangle=(%d, %d, %d, %d)", this->deltaEncodedRectangles[i].leftDelta, this->deltaEncodedRectangles[i].topDelta, this->deltaEncodedRectangles[i].width, this->deltaEncodedRectangles[i].height); */ zeroBit <<= 4; } } } // void receive(Stream & stream, const RDPPrimaryOrderHeader & header)
// ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- CMStateSet( const unsigned int bitCount , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fBitCount(bitCount) , fByteArray(0) , fMemoryManager(manager) { // // See if we need to allocate the byte array or whether we can live // within the 64 bit high performance scheme. // if (fBitCount > 64) { fByteCount = fBitCount / 8; if (fBitCount % 8) fByteCount++; fByteArray = (XMLByte*) fMemoryManager->allocate(fByteCount*sizeof(XMLByte)); //new XMLByte[fByteCount]; } // Init all the bits to zero zeroBits(); }
void receive(InStream & stream, const RDPPrimaryOrderHeader & header) { // LOG(LOG_INFO, "RDPPolygonSC::receive: header fields=0x%02X", header.fields); header.receive_coord(stream, 0x0001, this->xStart); header.receive_coord(stream, 0x0002, this->yStart); if (header.fields & 0x0004) { this->bRop2 = stream.in_uint8(); } if (header.fields & 0x0008) { this->fillMode = stream.in_uint8(); } if (header.fields & 0x0010) { receive_rdp_color(stream, this->backColor); } if (header.fields & 0x0020) { receive_rdp_color(stream, this->foreColor); } header.receive_brush(stream, 0x0040, this->brush); if (header.fields & 0x0800) { this->NumDeltaEntries = stream.in_uint8(); } if (header.fields & 0x1000) { uint8_t cbData = stream.in_uint8(); // LOG(LOG_INFO, "cbData=%d", cbData); InStream rgbData(stream.get_current(), cbData); stream.in_skip_bytes(cbData); // hexdump_d(rgbData.get_current(), rgbData.get_capacity()); uint8_t zeroBitsSize = ((this->NumDeltaEntries + 3) / 4); // LOG(LOG_INFO, "zeroBitsSize=%d", zeroBitsSize); InStream zeroBits(rgbData.get_current(), zeroBitsSize); rgbData.in_skip_bytes(zeroBitsSize); uint8_t zeroBit = 0; for (uint8_t i = 0, m4 = 0; i < this->NumDeltaEntries; i++, m4++) { if (m4 == 4) { m4 = 0; } if (!m4) { zeroBit = zeroBits.in_uint8(); // LOG(LOG_INFO, "0x%02X", zeroBit); } this->deltaPoints[i].xDelta = (!(zeroBit & 0x80) ? rgbData.in_DEP() : 0); this->deltaPoints[i].yDelta = (!(zeroBit & 0x40) ? rgbData.in_DEP() : 0); /* LOG(LOG_INFO, "RDPPolygonCB::receive: delta point=%d, %d", this->deltaPoints[i].xDelta, this->deltaPoints[i].yDelta); */ zeroBit <<= 2; } } } // receive