本文整理汇总了C++中InStream::in_uni_to_ascii_str方法的典型用法代码示例。如果您正苦于以下问题:C++ InStream::in_uni_to_ascii_str方法的具体用法?C++ InStream::in_uni_to_ascii_str怎么用?C++ InStream::in_uni_to_ascii_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InStream
的用法示例。
在下文中一共展示了InStream::in_uni_to_ascii_str方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
explicit LogonInfoVersion1_Recv(InStream & stream) :
cbDomain(0),
cbUserName(0),
SessionId(0) {
memset(Domain, 0, sizeof(Domain));
memset(UserName, 0, sizeof(UserName));
unsigned expected = 4; // cbDomain(4)
if (!stream.in_check_rem(expected)) {
LOG(LOG_ERR,
"Truncated Logon Info Version 1 (data): expected=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_RDP_DATA_TRUNCATED);
}
this->cbDomain = stream.in_uint32_le();
expected = 52 + // Domain(52)
4; // cbUserName(4)
if (!stream.in_check_rem(expected)) {
LOG(LOG_ERR,
"Truncated Logon Info Version 1 (data): expected=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_RDP_DATA_TRUNCATED);
}
stream.in_uni_to_ascii_str(this->Domain, this->cbDomain,
sizeof(this->Domain));
stream.in_skip_bytes(52 - // Domain(52)
this->cbDomain);
this->cbUserName = stream.in_uint32_le();
expected = 512 + // UserName(512)
4; // SessionId(4)
if (!stream.in_check_rem(expected)) {
LOG(LOG_ERR,
"Truncated Logon Info Version 1 (data): expected=%u remains=%zu",
expected, stream.in_remain());
throw Error(ERR_RDP_DATA_TRUNCATED);
}
stream.in_uni_to_ascii_str(this->UserName, this->cbUserName,
sizeof(this->UserName));
stream.in_skip_bytes(512 - // UserName(512)
this->cbUserName);
this->SessionId = stream.in_uint32_le();
LOG(LOG_INFO,
"Logon Info Version 1 (data): Domain=\"%s\" UserName=\"%s\" SessionId=%d",
this->Domain, this->UserName, this->SessionId);
} // LogonInfoVersion1_Recv(InStream & stream)