本文整理汇总了C++中InStream::get_offset方法的典型用法代码示例。如果您正苦于以下问题:C++ InStream::get_offset方法的具体用法?C++ InStream::get_offset怎么用?C++ InStream::get_offset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InStream
的用法示例。
在下文中一共展示了InStream::get_offset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: peekFlowPDU
// Return True if flowMarker is detected
// In these case we have FlowTestPDU, FlowResponsePDU or FlowStopPDU
// and not ShareControl header.
inline bool peekFlowPDU(const InStream & stream) {
if (!stream.in_check_rem(2)) {
throw Error(ERR_SEC);
}
return (stream.get_data()[stream.get_offset()] == 0)
&& (stream.get_data()[stream.get_offset()+1] == 0x80);
}
示例2: ShareData_Recv
explicit ShareData_Recv(InStream & stream, rdp_mppc_dec * dec = nullptr)
//==============================================================================
: CheckShareData_Recv(stream)
, share_id(stream.in_uint32_le())
, pad1(stream.in_uint8())
, streamid(stream.in_uint8())
, len(stream.in_uint16_le())
, pdutype2(stream.in_uint8())
, compressedType(stream.in_uint8())
, compressedLen(stream.in_uint16_le())
, payload([&stream, dec, this]() {
if (this->compressedType & PACKET_COMPRESSED) {
if (!dec) {
LOG(LOG_INFO, "ShareData_Recv: got unexpected compressed share data");
throw Error(ERR_SEC);
}
const uint8_t * rdata;
uint32_t rlen;
dec->decompress(stream.get_data()+stream.get_offset(), stream.in_remain(),
this->compressedType, rdata, rlen);
return InStream(rdata, 0, rlen);
}
else {
return InStream(stream.get_current(), stream.in_remain());
}
}())
// BEGIN CONSTRUCTOR
{
//LOG( LOG_INFO, "ShareData_Recv: pdutype2=%u len=%u compressedLen=%u payload_size=%u"
// , this->pdutype2, this->len, this->compressedLen, this->payload.size());
stream.in_skip_bytes(stream.in_remain());
} // END CONSTRUCTOR
示例3: ShareFlow_Recv
explicit ShareFlow_Recv(InStream & stream)
: flowMarker([&stream]{
if (!stream.in_check_rem(2+1+1+1+1+2)){
LOG(LOG_ERR,
"Truncated "
"[2: ShareFlow PDU packet]"
"[1: ShareFlow pad]"
"[1: ShareFlow PDU type]"
"[1: flow Identifier]"
"[1: flow number]"
"[2: ShareFlow PDU packet] , remains=%zu", stream.in_remain());
throw Error(ERR_SEC);
}
return stream.in_uint16_le();
}())
, pad(stream.in_uint8())
, pduTypeFlow(stream.in_uint8())
, flowIdentifier(stream.in_uint8())
, flowNumber(stream.in_uint8())
, mcs_channel(stream.in_uint16_le())
{
LOG(LOG_INFO, "Flow control packet %.4x (offset=%zu)", this->flowMarker, stream.get_offset());
if (this->flowMarker != 0x8000) {
LOG(LOG_ERR, "Expected flow control packet, got %.4x", this->flowMarker);
throw Error(ERR_SEC);
}
LOG(LOG_INFO, "PDUTypeFlow=%u", this->pduTypeFlow);
if (stream.in_remain()) {
LOG(LOG_INFO, "trailing bytes in FlowPDU, remains %zu bytes", stream.in_remain());
}
}