Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrDecoder.ParseTsLogonInfo C# (CSharp) Method

ParseTsLogonInfo() private method

Parse TS_LOGON_INFO (parser index is updated according to parsed length)
private ParseTsLogonInfo ( byte data, int &currentIndex ) : TS_LOGON_INFO
data byte data to be parsed
currentIndex int current parser index
return TS_LOGON_INFO
        private TS_LOGON_INFO ParseTsLogonInfo(byte[] data, ref int currentIndex)
        {
            TS_LOGON_INFO info = new TS_LOGON_INFO();

            // TS_LOGON_INFO: cbDomain
            info.cbDomain = ParseUInt32(data, ref currentIndex, false);

            // TS_LOGON_INFO: Domain
            byte[] domainBytes = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_DOMAIN_LENGTH);
            info.Domain = Encoding.Unicode.GetString(domainBytes, 0, (int)info.cbDomain);

            // TS_LOGON_INFO: cbUserName
            info.cbUserName = ParseUInt32(data, ref currentIndex, false);

            // TS_LOGON_INFO: UserName
            byte[] usernameBytes = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_USER_NAME_LENGTH);
            info.UserName = Encoding.Unicode.GetString(usernameBytes, 0, (int)info.cbUserName);

            // TS_LOGON_INFO: SessionId
            info.SessionId = ParseUInt32(data, ref currentIndex, false);

            return info;
        }
RdpbcgrDecoder