示例#1
0
        /// <summary>
        /// Decode specified buffer from specified index, with specified count
        /// of bytes, into the instance of current class.
        /// </summary>
        /// <param name="buffer">The specified buffer.</param>
        /// <param name="index">The specified index from beginning of buffer.</param>
        /// <param name="count">The specified count of bytes to be decoded.</param>
        internal override void DecodeBuffer(byte[] buffer, int index, int count)
        {
            NativeUpnDnsInfo =
                PacUtility.MemoryToObject <UPN_DNS_INFO>(buffer, index, count);

            upn = ReadUtf16String(
                buffer,
                index + NativeUpnDnsInfo.UpnOffset,
                NativeUpnDnsInfo.UpnLength);

            dnsDomain = ReadUtf16String(
                buffer,
                index + NativeUpnDnsInfo.DnsDomainNameOffset,
                NativeUpnDnsInfo.DnsDomainNameLength);

            UpdateOffsetLength();
        }
        /// <summary>
        /// Decode specified buffer from specified index, with specified count
        /// of bytes, into the instance of current class.
        /// </summary>
        /// <param name="buffer">The specified buffer.</param>
        /// <param name="index">The specified index from beginning of buffer.</param>
        /// <param name="count">The specified count of bytes to be decoded.</param>
        internal override void DecodeBuffer(byte[] buffer, int index, int count)
        {
            NativeUpnDnsInfo =
                PacUtility.MemoryToObject<UPN_DNS_INFO>(buffer, index, count);

            upn = ReadUtf16String(
                buffer,
                index + NativeUpnDnsInfo.UpnOffset,
                NativeUpnDnsInfo.UpnLength);

            dnsDomain = ReadUtf16String(
                buffer,
                index + NativeUpnDnsInfo.DnsDomainNameOffset,
                NativeUpnDnsInfo.DnsDomainNameLength);

            UpdateOffsetLength();
        }