internal MetadataMethodInfo(CorApi.Portable.IMetaDataImport importer, int methodToken, Instantiation instantiation) { unsafe { if (!importer.IsValidToken(methodToken)) { throw new ArgumentException(); } m_importer = importer; m_methodToken = methodToken; int size; int pdwAttr; IntPtr ppvSigBlob; int pulCodeRVA, pdwImplFlags; int pcbSigBlob; m_importer.GetMethodProps(methodToken, out m_classToken, IntPtr.Zero, 0, out size, out pdwAttr, out ppvSigBlob, out pcbSigBlob, out pulCodeRVA, out pdwImplFlags); var szMethodName = stackalloc char[size]; m_importer.GetMethodProps(methodToken, out m_classToken, (IntPtr)szMethodName, size, out size, out pdwAttr, out ppvSigBlob, out pcbSigBlob, out pulCodeRVA, out pdwImplFlags); // [Xamarin] Expression evaluator. CorCallingConvention callingConv; MetadataHelperFunctionsExtensions.ReadMethodSignature(importer, instantiation, ref ppvSigBlob, out callingConv, out m_retType, out m_argTypes, out m_sentinelIndex); m_name = new string(szMethodName, 0, size - 1); m_methodAttributes = (MethodAttributes)pdwAttr; } }
internal MetadataMethodInfo(IMetadataImport importer, int methodToken) { if (!importer.IsValidToken((uint)methodToken)) { throw new ArgumentException(); } m_importer = importer; m_methodToken = methodToken; int size; uint pdwAttr; IntPtr ppvSigBlob; uint pulCodeRVA, pdwImplFlags; uint pcbSigBlob; m_importer.GetMethodProps((uint)methodToken, out m_classToken, null, 0, out size, out pdwAttr, out ppvSigBlob, out pcbSigBlob, out pulCodeRVA, out pdwImplFlags); StringBuilder szMethodName = new StringBuilder(size); m_importer.GetMethodProps((uint)methodToken, out m_classToken, szMethodName, szMethodName.Capacity, out size, out pdwAttr, out ppvSigBlob, out pcbSigBlob, out pulCodeRVA, out pdwImplFlags); // [Xamarin] Expression evaluator. CorCallingConvention callingConv; MetadataHelperFunctionsExtensions.ReadMethodSignature(importer, ref ppvSigBlob, out callingConv, out m_retType, out m_argTypes); m_name = szMethodName.ToString(); m_methodAttributes = (MethodAttributes)pdwAttr; }