Esempio n. 1
0
 internal NdrBogusArrayTypeReference(NdrParseContext context, BinaryReader reader)
     : base(context, NdrFormatCharacter.FC_BOGUS_ARRAY, reader)
 {
     NumberofElements      = reader.ReadInt16();
     ConformanceDescriptor = new NdrCorrelationDescriptor(context, reader);
     VarianceDescriptor    = new NdrCorrelationDescriptor(context, reader);
     ReadElementType(context, reader);
 }
        internal NdrConformantStringTypeReference(NdrParseContext context,
                                                  NdrFormatCharacter format, BinaryReader reader) : base(format)
        {
            NdrFormatCharacter padding = (NdrFormatCharacter)reader.ReadByte();

            if (padding == NdrFormatCharacter.FC_STRING_SIZED)
            {
                ConformanceDescriptor = new NdrCorrelationDescriptor(context, reader);
            }
            else
            {
                ConformanceDescriptor = new NdrCorrelationDescriptor();
            }
        }
 internal NdrConformantStructureStringTypeReference(NdrParseContext context, BinaryReader reader) : base(NdrFormatCharacter.FC_C_SSTRING)
 {
     ElementSize = reader.ReadByte();
     if (NdrFormatCharacter.FC_STRING_SIZED == (NdrFormatCharacter)reader.ReadByte())
     {
         // Padding.
         reader.ReadByte();
         ConformanceDescriptor = new NdrCorrelationDescriptor(context, reader);
     }
     else
     {
         ConformanceDescriptor = new NdrCorrelationDescriptor();
     }
 }
        internal NdrInterfacePointerTypeReference(NdrParseContext context, BinaryReader reader) : base(NdrFormatCharacter.FC_IP)
        {
            NdrFormatCharacter type = ReadFormat(reader);

            if (type == NdrFormatCharacter.FC_CONSTANT_IID)
            {
                Iid        = new Guid(reader.ReadAll(16));
                IsConstant = true;
            }
            else
            {
                Iid             = NdrNativeUtils.IID_IUnknown;
                IidIsDescriptor = new NdrCorrelationDescriptor(context, reader);
            }
        }
        internal NdrByteCountPointerReferenceType(NdrParseContext context, BinaryReader reader) : base(NdrFormatCharacter.FC_BYTE_COUNT_POINTER)
        {
            NdrFormatCharacter format = (NdrFormatCharacter)reader.ReadByte();

            if (format != NdrFormatCharacter.FC_PAD)
            {
                Type        = new NdrSimpleTypeReference(format);
                Description = new NdrCorrelationDescriptor();
            }
            else
            {
                Description = new NdrCorrelationDescriptor(context, reader);
                Type        = Read(context, ReadTypeOffset(reader));
            }
        }
Esempio n. 6
0
 internal NdrConformantArrayTypeReference(NdrFormatCharacter format, NdrParseContext context,
                                          BinaryReader reader) : base(context, format, reader)
 {
     _element_size         = reader.ReadInt16();
     ConformanceDescriptor = new NdrCorrelationDescriptor(context, reader);
     if (format == NdrFormatCharacter.FC_CVARRAY)
     {
         VarianceDescriptor = new NdrCorrelationDescriptor(context, reader);
     }
     else
     {
         VarianceDescriptor = new NdrCorrelationDescriptor();
     }
     ReadElementType(context, reader);
 }
Esempio n. 7
0
        internal NdrVaryingArrayTypeReference(NdrParseContext context, NdrFormatCharacter format, BinaryReader reader)
            : base(context, format, reader)
        {
            if (format == NdrFormatCharacter.FC_SMVARRAY)
            {
                TotalSize        = reader.ReadUInt16();
                NumberofElements = reader.ReadUInt16();
            }
            else
            {
                TotalSize        = reader.ReadInt32();
                NumberofElements = reader.ReadInt32();
            }

            _element_size      = reader.ReadUInt16();
            VarianceDescriptor = new NdrCorrelationDescriptor(context, reader);
            ReadElementType(context, reader);
        }
Esempio n. 8
0
        internal NdrUnionTypeReference(NdrFormatCharacter format, NdrParseContext context, BinaryReader reader)
            : base($"Union_{context.TypeCache.GetNextComplexId()}", format)
        {
            int switch_type = reader.ReadByte();

            if (NonEncapsulated)
            {
                SwitchType  = (NdrFormatCharacter)switch_type;
                Correlation = new NdrCorrelationDescriptor(context, reader);
                Arms        = new NdrUnionArms(context, ReadTypeOffset(reader));
            }
            else
            {
                SwitchIncrement = (switch_type >> 4) & 0xF;
                SwitchType      = (NdrFormatCharacter)(switch_type & 0xF);
                Correlation     = new NdrCorrelationDescriptor();
                Arms            = new NdrUnionArms(context, reader);
            }
        }