예제 #1
0
        public override Void AppendName(StringBuilder sb, ByRefType type, FormatOptions options)
        {
            AppendName(sb, type.ParameterType, options);
            sb.Append('&');

            return(Void.Value);
        }
예제 #2
0
 private void InitializeByRef(Cts.ByRefType entity, TypeSpecification record)
 {
     record.Signature = new ByReferenceSignature
     {
         Type = HandleType(entity.ParameterType)
     };
 }
예제 #3
0
        public string FormatName(ByRefType type)
        {
            StringBuilder sb = new StringBuilder();

            AppendName(sb, type);
            return(sb.ToString());
        }
예제 #4
0
        public override IAssemblyDesc AppendName(StringBuilder sb, ByRefType type, bool assemblyQualify)
        {
            IAssemblyDesc homeAssembly = AppendName(sb, type.ParameterType, false);

            sb.Append('&');

            if (assemblyQualify)
            {
                AppendAssemblyName(sb, homeAssembly);
            }

            return(homeAssembly);
        }
        /// <summary>
        /// Marshals a ByRef. Expects the ByRef on the stack. Pushes a pinned
        /// unmanaged pointer to the stack.
        /// </summary>
        /// <returns>Type the ByRef was marshalled into.</returns>
        private TypeDesc EmitByRefMarshalling(ByRefType byRefType)
        {
            ILLocalVariable vPinnedByRef = _emitter.NewLocal(byRefType, true);
            _marshallingCodeStream.EmitStLoc(vPinnedByRef);
            _marshallingCodeStream.EmitLdLoc(vPinnedByRef);
            _marshallingCodeStream.Emit(ILOpcode.conv_i);

            return _context.GetWellKnownType(WellKnownType.IntPtr);
        }
예제 #6
0
 public abstract void AppendName(StringBuilder sb, ByRefType type);
예제 #7
0
 public override void AppendName(StringBuilder sb, ByRefType type)
 {
     FormatName(type.ParameterType);
     sb.Append(" ByRef");
 }
예제 #8
0
 public override void AppendName(StringBuilder sb, ByRefType type)
 {
     FormatName(type.ParameterType);
     sb.Append(" ByRef");
 }
예제 #9
0
 public override void AppendName(StringBuilder sb, ByRefType type)
 {
     AppendNameWithValueClassPrefix(sb, type.ParameterType);
     sb.Append('&');
 }
예제 #10
0
        /// <summary>
        /// Marshals a ByRef. Expects the ByRef on the stack. Pushes a pinned
        /// unmanaged pointer to the stack.
        /// </summary>
        /// <returns>Type the ByRef was marshalled into.</returns>
        private TypeDesc EmitByRefMarshalling(ByRefType byRefType)
        {
            if (!IsBlittableType(byRefType.ParameterType))
                throw new NotSupportedException();

            ILLocalVariable vPinnedByRef = _emitter.NewLocal(byRefType, true);
            _marshallingCodeStream.EmitStLoc(vPinnedByRef);
            _marshallingCodeStream.EmitLdLoc(vPinnedByRef);
            _marshallingCodeStream.Emit(ILOpcode.conv_i);

            return byRefType.Context.GetWellKnownType(WellKnownType.IntPtr);
        }
예제 #11
0
 public string FormatName(ByRefType type)
 {
     StringBuilder sb = new StringBuilder();
     AppendName(sb, type);
     return sb.ToString();
 }
예제 #12
0
 public abstract void AppendName(StringBuilder sb, ByRefType type);