/// <summary> /// Un-marshal a byte array to PDU struct. /// </summary> /// <param name="binaryReader">BinaryReader</param> internal override void FromBytes(BinaryReader binaryReader) { base.FromBytes(binaryReader); provider_reject_reason = (p_reject_reason_t)binaryReader.ReadUInt16(); versions = new p_rt_versions_supported_t(); versions.n_protocols = binaryReader.ReadByte(); versions.p_protocols = new version_t[versions.n_protocols]; for (int i = 0; i < versions.n_protocols; i++) { versions.p_protocols[i].major = binaryReader.ReadByte(); versions.p_protocols[i].minor = binaryReader.ReadByte(); } //Assume that the client calculates the length of the PDU //until the Signature field as L. //If the frag_length field is greater than or equal to L //plus the size of the Signature field, //the client SHOULD assume that the Signature field is present. //Otherwise, the client SHOULD assume that the Signature field is not present. //TD shows the signature is aligned at 4. int L = RpceUtility.Align((int)binaryReader.BaseStream.Position, 4); if (frag_length >= (L + RpceUtility.GUID_SIZE)) { pad = binaryReader.ReadBytes(L - (int)binaryReader.BaseStream.Position); signature = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE)); extended_error_info = binaryReader.ReadBytes(frag_length - L - RpceUtility.GUID_SIZE); } }