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

ParseTsLogonInfoVersion2() private method

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

            // TS_LOGON_INFO_VERSION_2:
            info.Version = (TS_LOGON_INFO_VERSION_2_Version_Values)ParseUInt16(data, ref currentIndex, false);

            // TS_LOGON_INFO_VERSION_2: Size
            info.Size = ParseUInt32(data, ref currentIndex, false);

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

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

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

            // TS_LOGON_INFO_VERSION_2: Pad
            info.Pad = GetBytes(data, ref currentIndex, ConstValue.TS_LOGON_INFO_VERSION_2_PAD_LENGTH);

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

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

            return info;
        }
RdpbcgrDecoder