Example #1
0
        internal NdrCorrelationDescriptor(NdrParseContext context, BinaryReader reader) : this()
        {
            byte type_byte = reader.ReadByte();
            byte op_byte   = reader.ReadByte();
            int  offset    = reader.ReadInt16();
            int  flags     = 0;

            if (context.OptFlags.HasFlag(NdrInterpreterOptFlags2.HasNewCorrDesc) || context.OptFlags.HasFlag(NdrInterpreterOptFlags2.HasRangeOnConformance))
            {
                flags = reader.ReadInt16();
                // Read out the range.
                if (context.OptFlags.HasFlag(NdrInterpreterOptFlags2.HasRangeOnConformance))
                {
                    Range = new NdrCorrelationDescriptorRange(reader);
                    System.Diagnostics.Debug.Assert(((flags & 0x10) == 0x10) == Range.IsValid);
                }
            }

            if (type_byte != 0xFF || op_byte != 0xFF || offset != -1)
            {
                IsValid         = true;
                CorrelationType = (NdrCorrelationType)(type_byte & 0xF0);
                ValueType       = (NdrFormatCharacter)(type_byte & 0xF);
                Operator        = (NdrFormatCharacter)op_byte;
                Offset          = offset;
                Flags           = (NdrCorrelationFlags)flags;
                if (IsConstant)
                {
                    Offset  |= (op_byte << 16);
                    Operator = NdrFormatCharacter.FC_ZERO;
                }
                else
                {
                    if (Operator == NdrFormatCharacter.FC_EXPR)
                    {
                        Expression = NdrExpression.Read(context, offset);
                    }
                }
            }
        }
Example #2
0
 internal NdrCorrelationDescriptor()
 {
     Range      = new NdrCorrelationDescriptorRange();
     Expression = new NdrExpression();
 }