{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/189059066","pull_request_review_id":121165064,"id":189059066,"diff_hunk":"@@ -109,6 +109,975 @@ internal static unsafe int IndexOf(byte[] peImage, byte[] toFind, int start)\n \n         #endregion\n \n+        [Fact]\n+        public unsafe void IsWindowsAttributeUsageAttributeTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int parentIndex = IndexOf(peImage, new byte[] { 0x25, 0x00, 0xA3, 0x00, 0xA5, 0x01, 0x2E, 0x00, 0x1B, 0x00, 0xD8, 0x00, 0x2E }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentIndex);\n+\n+            peImage[headers.MetadataStartOffset + parentIndex + 6] = 35;\n+\n+            int attributeTypeIndex = IndexOf(peImage, new byte[] { 0x09, 0x00, 0xE2, 0x02, 0x01, 0x00, 0x19, 0x00, 0x9E, 0x02, 0x05, 0x00, 0x21 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, attributeTypeIndex);\n+\n+            peImage[headers.MetadataStartOffset + attributeTypeIndex + 12] = 34;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+\n+            int attributeCtorIndex = IndexOf(peImage, new byte[] { 0x25, 0x00, 0xA3, 0x00, 0xA5, 0x01, 0x23, 0x00, 0x1B, 0x00, 0xD8, 0x00, 0x2E, 0x00, 0x23 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, attributeCtorIndex);\n+\n+            peImage[headers.MetadataStartOffset + attributeCtorIndex + 8] = 26;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetAttributeTypeNameRawTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int resolutionScopeIndex = IndexOf(peImage, new byte[] { 0x06, 0x00, 0x7C, 0x03, 0xB6, 0x02, 0x0A, 0x00, 0x7C, 0x03, 0xB6, 0x02, 0x0E, 0x00, 0x4B }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, resolutionScopeIndex);\n+\n+            peImage[headers.MetadataStartOffset + resolutionScopeIndex + 102] = 35;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)2684354566, reader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)).Name.RawValue);\n+\n+            int typeDefOrRefIndex = IndexOf(peImage, new byte[] { 0x25, 0x00, 0xA3, 0x00, 0xA5, 0x01, 0x2E, 0x00, 0x1B, 0x00, 0xD8, 0x00, 0x2E, 0x00, 0x23, 0x00, 0xE1 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, typeDefOrRefIndex);\n+\n+            peImage[headers.MetadataStartOffset + typeDefOrRefIndex + 116] = 34;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)2684354566, reader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)).Name.RawValue);\n+\n+            int flagsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, flagsIndex);\n+                        \n+            int clrIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"CLR\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, clrIndex);\n+            peImage[headers.MetadataStartOffset + clrIndex] = 0x00;\n+            Array.Copy(BitConverter.GetBytes((uint)(TypeAttributes.WindowsRuntime & ~TypeAttributes.Interface)), 0, peImage, headers.MetadataStartOffset + flagsIndex, sizeof(uint));\n+            Array.Copy(BitConverter.GetBytes((uint)(TypeAttributes.WindowsRuntime | TypeAttributes.NestedAssembly)), 0, peImage, headers.MetadataStartOffset + flagsIndex + 28, sizeof(uint));\n+\n+            //MarshalingBehaviorAttribute needs to be changed.\n+            int marshalingIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"MarshalingBehaviorAttribute\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, marshalingIndex);\n+            //Windows.Foundation.Metadata needs to be changed\n+            int windowsIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, windowsIndex);\n+            //Class needs to be changed\n+            int classIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"Class\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, classIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\"), 0, peImage, headers.MetadataStartOffset + windowsIndex, Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length);\n+            peImage[headers.MetadataStartOffset + windowsIndex + Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length] = (byte)0;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\"), 0, peImage, headers.MetadataStartOffset + marshalingIndex, Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + marshalingIndex + Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\").Length] = (byte)0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)16777219, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+\n+            peImage[headers.MetadataStartOffset + typeDefOrRefIndex + 116] = 11;\n+\n+            int parenetTypeDefOrRefIndex = IndexOf(peImage, new byte[] { 0x09, 0x00, 0xE2, 0x02, 0x01, 0x00, 0x19, 0x00, 0x9E, 0x02, 0x05, 0x00, 0x21, 0x00, 0xE2, 0x02, 0x09, 0x00, 0x29 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parenetTypeDefOrRefIndex);\n+\n+            peImage[headers.MetadataStartOffset + parenetTypeDefOrRefIndex] = 10;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)6, reader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)).Name.RawValue);\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateCustomAttributeValueTreatmentTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int parentIndex = IndexOf(peImage, new byte[] { 0x25, 0x00, 0xA3, 0x00, 0xA5, 0x01, 0x2E, 0x00, 0x1B, 0x00, 0xD8, 0x00, 0x2E }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentIndex);\n+\n+            peImage[headers.MetadataStartOffset + parentIndex + 6] = 35;\n+\n+            int attributeUsageAttributeIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73, 0x73, 0x31, 0x00, 0x3C, 0x4D }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, attributeUsageAttributeIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"AttributeUsageAttribute\"), 0, peImage, headers.MetadataStartOffset + attributeUsageAttributeIndex + 451, Encoding.ASCII.GetBytes(\"AttributeUsageAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + attributeUsageAttributeIndex + 451 + 23] = 0;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\"), 0, peImage, headers.MetadataStartOffset + attributeUsageAttributeIndex + 794, Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\").Length);\n+            peImage[headers.MetadataStartOffset + attributeUsageAttributeIndex + 794 + 27] = 0;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\"), 0, peImage, headers.MetadataStartOffset + attributeUsageAttributeIndex, Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\").Length);\n+            peImage[headers.MetadataStartOffset + attributeUsageAttributeIndex + 27] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+\n+            int offsetIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, offsetIndex);\n+\n+            peImage[headers.MetadataStartOffset + offsetIndex + 4] = 28;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"DeprecatedAttribute\"), 0, peImage, headers.MetadataStartOffset + attributeUsageAttributeIndex + 28, Encoding.ASCII.GetBytes(\"DeprecatedAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + attributeUsageAttributeIndex + 28 + 19] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"VersionAttribute\"), 0, peImage, headers.MetadataStartOffset + attributeUsageAttributeIndex + 28, Encoding.ASCII.GetBytes(\"VersionAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + attributeUsageAttributeIndex + 28 + 16] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.False(reader.CalculateCustomAttributeValueTreatment(CustomAttributeHandle.FromRowId(2)).GetType().IsAbstract);\n+        }\n+\n+        [Fact]\n+        public unsafe void ImplementsRedirectedInterfaceTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            \n+            int parentIndex = IndexOf(peImage, new byte[] { 0x09, 0x00, 0xE2, 0x02, 0x01, 0x00, 0x19, 0x00, 0x9E, 0x02, 0x05, 0x00, 0x21 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentIndex);\n+\n+            peImage[headers.MetadataStartOffset + parentIndex] = 8;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(738, reader.GetMemberReference(MemberReferenceHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            //38688266055 is the presenttable index\n+            int presentTablesIndex = IndexOf(peImage, BitConverter.GetBytes(38688266055), headers.MetadataStartOffset);\n+            Assert.NotEqual(presentTablesIndex, -1);\n+\n+            //38788929351 gives a value to the type spec table row count and removes it from the row count after it.\n+            Array.Copy(BitConverter.GetBytes((ulong)38788929351), 0, peImage, presentTablesIndex + headers.MetadataStartOffset, BitConverter.GetBytes((ulong)38788929351).Length);\n+\n+            peImage[headers.MetadataStartOffset + parentIndex] = 12;\n+\n+            int mscorlibIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73, 0x73, 0x31, 0x00, 0x3C, 0x4D }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, mscorlibIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"mscorlib\"), 0, peImage, headers.MetadataStartOffset + mscorlibIndex + 255, Encoding.ASCII.GetBytes(\"mscorlib\").Length);\n+            peImage[headers.MetadataStartOffset + mscorlibIndex + 255 + 8] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(738, reader.GetMemberReference(MemberReferenceHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            int sigIndex = IndexOf(peImage, new byte[] { 0x00, 0x01, 0x03, 0x20, 0x00, 0x0E, 0x04, 0x20, 0x01, 0x01, 0x08, 0x05, 0x20, 0x01, 0x01, 0x11, 0x1D }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, sigIndex);\n+\n+            peImage[headers.MetadataStartOffset + sigIndex] = 21;\n+            peImage[headers.MetadataStartOffset + sigIndex + 1] = 18;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(738, reader.GetMemberReference(MemberReferenceHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            peImage[headers.MetadataStartOffset + sigIndex + 2] = 5;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(738, reader.GetMemberReference(MemberReferenceHandle.FromRowId(1)).Name.GetHeapOffset());\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateMemberRefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            int nameIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 694, Encoding.ASCII.GetBytes(\"Windows.Foundation\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 694 + 18] = 0;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"IClosable\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"IClosable\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 9] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.True(reader.GetMemberReference(MemberReferenceHandle.FromRowId(1)).Name.IsVirtual);\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateFieldDefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            //38688266055 is the presenttable index\n+            int presentTablesIndex = IndexOf(peImage, BitConverter.GetBytes(38688266055), headers.MetadataStartOffset);\n+            Assert.NotEqual(presentTablesIndex, -1);\n+\n+            //38654711639 gives a value to the field table row count and removes it from the row count after it.\n+            Array.Copy(BitConverter.GetBytes((ulong)38654711639), 0, peImage, presentTablesIndex + headers.MetadataStartOffset, BitConverter.GetBytes((ulong)38654711639).Length);\n+\n+            int mscorlibIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73, 0x73, 0x31, 0x00, 0x3C, 0x4D }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, mscorlibIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"mscorlib\"), 0, peImage, headers.MetadataStartOffset + mscorlibIndex + 10, Encoding.ASCII.GetBytes(\"mscorlib\").Length);\n+            peImage[headers.MetadataStartOffset + mscorlibIndex + 10 + 8] = 0;\n+\n+            int flagsIndex = IndexOf(peImage, new byte[] { 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0xE6, 0x01, 0x16, 0x00, 0x01, 0x00, 0x01, 0x00, 0x53, 0x20 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, flagsIndex);\n+\n+            ushort flags = (ushort)FieldAttributes.RTSpecialName;\n+            Array.Copy(BitConverter.GetBytes(flags), 0, peImage, headers.MetadataStartOffset + flagsIndex, sizeof(ushort));\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"value__\"), 0, peImage, headers.MetadataStartOffset + mscorlibIndex, Encoding.ASCII.GetBytes(\"value__\").Length);\n+            peImage[headers.MetadataStartOffset + mscorlibIndex + 7] = 0;\n+\n+            int baseTypeHandleIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10, 0x00, 0x01, 0x00, 0x34, 0x00, 0x05 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, baseTypeHandleIndex);\n+\n+            peImage[headers.MetadataStartOffset + baseTypeHandleIndex + 50] = 5;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Enum\"), 0, peImage, headers.MetadataStartOffset + mscorlibIndex + 892, Encoding.ASCII.GetBytes(\"Enum\").Length);\n+            peImage[headers.MetadataStartOffset + mscorlibIndex + 892 + 4] = 0;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(0, reader.GetFieldDefinition(FieldDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+        }\n+\n+        [Fact]\n+        public unsafe void GetMethodTreatmentFromCustomAttributesTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int parentFlagsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentFlagsIndex);\n+\n+            //Windows.Foundation.Metadata needs to be changed\n+            int windowsIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73, 0x73, 0x31, 0x00, 0x3C, 0x4D }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, windowsIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\"), 0, peImage, headers.MetadataStartOffset + windowsIndex + 613, Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length);\n+            peImage[headers.MetadataStartOffset + windowsIndex + 613 + Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length] = 0;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"TreatAsPublicMethodAttribute\"), 0, peImage, headers.MetadataStartOffset + windowsIndex + 288, Encoding.ASCII.GetBytes(\"TreatAsPublicMethodAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + windowsIndex + 288 + Encoding.ASCII.GetBytes(\"TreatAsPublicMethodAttribute\").Length] = 0;\n+\n+            ushort windowsFlag = (ushort)(TypeAttributes.WindowsRuntime | TypeAttributes.Public);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+\n+            int referenceIndex = IndexOf(peImage, new byte[] { 0x25, 0x00, 0xA3, 0x00, 0xA5, 0x01, 0x2E, 0x00, 0x1B, 0x00, 0xD8 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, referenceIndex);\n+            peImage[headers.MetadataStartOffset + referenceIndex + 78] = 32;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"TreatAsAbstractMethodAttribute\"), 0, peImage, headers.MetadataStartOffset + windowsIndex + 288, Encoding.ASCII.GetBytes(\"TreatAsAbstractMethodAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + windowsIndex + 288 + Encoding.ASCII.GetBytes(\"TreatAsAbstractMethodAttribute\").Length] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            peImage[headers.MetadataStartOffset + referenceIndex + 80] = 2;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateMethodDefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int parentFlagsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentFlagsIndex);\n+\n+            ushort windowsFlag = (ushort)(TypeAttributes.WindowsRuntime);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            windowsFlag = (ushort)(TypeAttributes.WindowsRuntime | TypeAttributes.SpecialName);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            windowsFlag = (ushort)(TypeAttributes.WindowsRuntime | TypeAttributes.Interface);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+            \n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            windowsFlag = (ushort)(TypeAttributes.WindowsRuntime | TypeAttributes.NestedAssembly);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            windowsFlag = (ushort)(TypeAttributes.WindowsRuntime | TypeAttributes.Public);\n+            Array.Copy(BitConverter.GetBytes(windowsFlag), 0, peImage, headers.MetadataStartOffset + parentFlagsIndex + 14, sizeof(ushort));\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            int declarationIndex = IndexOf(peImage, new byte[] { 0x02, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x03, 0x00, 0x0A, 0x00, 0x05, 0x00 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, declarationIndex);\n+            int parentKindIndex = IndexOf(peImage, new byte[] { 0x09, 0x00, 0xE2, 0x02, 0x01, 0x00, 0x19, 0x00, 0x9E, 0x02, 0x05, 0x00, 0x21 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, parentKindIndex);\n+\n+            peImage[headers.MetadataStartOffset + declarationIndex + 4] = 3;\n+            peImage[headers.MetadataStartOffset + parentKindIndex] = 17;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            int nameIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameIndex);\n+\n+            int sizeIndex = IndexOf(peImage, BitConverter.GetBytes(900), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, sizeIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"MulticastDelegate\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"MulticastDelegate\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 17] = 0;\n+            Array.Copy(BitConverter.GetBytes(910), 0, peImage, headers.MetadataStartOffset + sizeIndex, BitConverter.GetBytes(910).Length);\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Attribute\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"Attribute\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 9] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 694, Encoding.ASCII.GetBytes(\"Windows.Foundation\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 694 + 18] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"IClosable\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"IClosable\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 9] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.True(reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.IsVirtual);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Plane\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"Plane\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 5] = 0;\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation.Numerics\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 694, Encoding.ASCII.GetBytes(\"Windows.Foundation.Numerics\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 694 + 27] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(22, reader.GetMethodDefinition(MethodDefinitionHandle.FromRowId(1)).Name.GetHeapOffset());\n+        }\n+\n+        [Fact]\n+        public unsafe void NeedsWinRTPrefixTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            \n+            int nameIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameIndex);\n+            int sizeIndex = IndexOf(peImage, BitConverter.GetBytes(900), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, sizeIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"MulticastDelegate\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"MulticastDelegate\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 17] = 0;\n+            Array.Copy(BitConverter.GetBytes(910), 0, peImage, headers.MetadataStartOffset + sizeIndex, BitConverter.GetBytes(910).Length);\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)6, reader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)).Name.RawValue);\n+\n+            int extendsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x10 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, extendsIndex);\n+\n+            peImage[headers.MetadataStartOffset + extendsIndex + 36] = 2;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)6, reader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(3)).Name.RawValue);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetSpecialTypeRefTreatmentTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int nameIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameIndex);\n+            int sizeIndex = IndexOf(peImage, BitConverter.GetBytes(900), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, sizeIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"MulticastDelegate\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"MulticastDelegate\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 17] = 0;\n+            Array.Copy(BitConverter.GetBytes(910), 0, peImage, headers.MetadataStartOffset + sizeIndex, BitConverter.GetBytes(910).Length);\n+            \n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)16777217, reader.CalculateTypeRefTreatmentAndRowId(TypeReferenceHandle.FromRowId(1)));\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Attribute\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"Attribute\").Length);\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 9] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)33554433, reader.CalculateTypeRefTreatmentAndRowId(TypeReferenceHandle.FromRowId(1)));\n+        }\n+\n+        [Fact]\n+        public unsafe void CGetProjectedAssemblyRefTest()\n+        {\n+            Assert.Equal(0, MetadataReader.GetProjectedAssemblyRef(1).RowId);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetProjectedNameTest()\n+        {\n+            MetadataReader.GetProjectedTypeNames();\n+            Assert.False(MetadataReader.GetProjectedName(1).IsNil);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetProjectedNamespaceTest()\n+        {\n+            MetadataReader.GetProjectedTypeNames();\n+            Assert.False(MetadataReader.GetProjectedNamespace(1).IsNil);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetProjectedSignatureTreatmentTest()\n+        {\n+            MetadataReader.GetProjectedTypeNames();\n+            Assert.Equal(false, MetadataReader.GetProjectedSignatureTreatment(1).GetType().IsAbstract);\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateTypeRefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            \n+            int nameIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x43, 0x6C, 0x61, 0x73 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Plane\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 892, Encoding.ASCII.GetBytes(\"Plane\").Length);\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.Foundation.Numerics\"), 0, peImage, headers.MetadataStartOffset + nameIndex + 694, Encoding.ASCII.GetBytes(\"Windows.Foundation.Numerics\").Length);\n+\n+            peImage[headers.MetadataStartOffset + nameIndex + 892 + 5] = 0;\n+            peImage[headers.MetadataStartOffset + nameIndex + 694 + 27] = 0;\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            Assert.Equal((uint)50331682, reader.CalculateTypeRefTreatmentAndRowId(TypeReferenceHandle.FromRowId(1)));\n+        }\n+\n+        [Fact]\n+        public unsafe void CalculateTypeDefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)1, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(1)));\n+\n+            int flagsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, flagsIndex);\n+            Array.Copy(BitConverter.GetBytes((uint)(TypeAttributes.WindowsRuntime)), 0, peImage, headers.MetadataStartOffset + flagsIndex, sizeof(uint));\n+            Assert.Equal((uint)1, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(1)));\n+\n+            int clrIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"CLR\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, clrIndex);\n+            peImage[headers.MetadataStartOffset + clrIndex] = 0x00;\n+            Array.Copy(BitConverter.GetBytes((uint)(TypeAttributes.WindowsRuntime & ~TypeAttributes.Interface)), 0, peImage, headers.MetadataStartOffset + flagsIndex, sizeof(uint));\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            //MarshalingBehaviorAttribute needs to be changed.\n+            int marshalingIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"MarshalingBehaviorAttribute\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, marshalingIndex);\n+            //Windows.Foundation.Metadata needs to be changed\n+            int windowsIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"Windows.Foundation.Metadata\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, windowsIndex);\n+            //Class needs to be changed\n+            int classIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"Class\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, classIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\"), 0, peImage, headers.MetadataStartOffset + windowsIndex, Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length);\n+            peImage[headers.MetadataStartOffset + windowsIndex + Encoding.ASCII.GetBytes(\"Windows.UI.Xaml\").Length] = (byte)0;\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\"), 0, peImage, headers.MetadataStartOffset + marshalingIndex, Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\").Length);\n+            peImage[headers.MetadataStartOffset + marshalingIndex + Encoding.ASCII.GetBytes(\"TreatAsAbstractComposableClassAttribute\").Length] = (byte)0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)285212675, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Plane\"), 0, peImage, headers.MetadataStartOffset + classIndex, Encoding.ASCII.GetBytes(\"Plane\").Length);\n+            peImage[headers.MetadataStartOffset + classIndex + 5] = 0;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)285212675, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+\n+            //Make an attribute\n+            int attributeIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x50, 0x6C, 0x61, 0x6E, 0x65 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, attributeIndex);\n+\n+            Array.Copy(Encoding.ASCII.GetBytes(\"Attribute\"), 0, peImage, headers.MetadataStartOffset + attributeIndex + 892, Encoding.ASCII.GetBytes(\"Attribute\").Length);\n+            peImage[headers.MetadataStartOffset + attributeIndex + 892 + 9] = 0x00;\n+\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((uint)33554435, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+\n+            //NamespaceName needs to be changed\n+            int nameSpaceNameIndex = IndexOf(peImage, Encoding.ASCII.GetBytes(\"Lib\"), headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, nameSpaceNameIndex);\n+\n+            List<byte> peList = peImage.ToList();\n+\n+            peList.RemoveRange(headers.MetadataStartOffset + nameSpaceNameIndex, 3);\n+            peList.InsertRange(headers.MetadataStartOffset + nameSpaceNameIndex, Encoding.ASCII.GetBytes(\"Windows.Foundation.Numerics\"));\n+            \n+            //AssemblyRefTable needs changed after changing NamespaceName\n+            int assemblyRefTableIndex = IndexOf(peImage, new byte[] { 0x00, 0x3C, 0x43, 0x4C, 0x52, 0x3E, 0x50, 0x6C, 0x61, 0x6E, 0x65 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(-1, assemblyRefTableIndex);\n+\n+            peList.RemoveRange(headers.MetadataStartOffset + assemblyRefTableIndex + 87, 8);\n+            peList.InsertRange(headers.MetadataStartOffset + assemblyRefTableIndex + 87, Encoding.ASCII.GetBytes(\"mscorlib\"));\n+            peList[headers.MetadataStartOffset + assemblyRefTableIndex + 87 + 8] = 0x00;\n+\n+            pinned = GetPinnedPEImage(peList.ToArray());\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            Assert.Equal((uint)620756995, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+\n+            peList.RemoveRange(headers.MetadataStartOffset + nameSpaceNameIndex, 15);\n+            peList.InsertRange(headers.MetadataStartOffset + nameSpaceNameIndex, Encoding.ASCII.GetBytes(\"System.Numerics\"));\n+            peList[headers.MetadataStartOffset + nameSpaceNameIndex + 15] = 0x00;\n+\n+            pinned = GetPinnedPEImage(peList.ToArray());\n+            reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            Assert.Equal((uint)83886083, reader.CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle.FromRowId(3)));\n+        }\n+\n+        [Fact]\n+        public unsafe void GetAssemblyNameFlagsTest()\n+        {\n+            byte[] peImage = (byte[])NetModule.AppCS.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int flagsIndex = IndexOf(peImage, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(flagsIndex, -1);\n+\n+            ushort allFlags = (ushort)(AssemblyNameFlags.EnableJITcompileOptimizer | AssemblyNameFlags.EnableJITcompileTracking | AssemblyNameFlags.PublicKey | AssemblyNameFlags.Retargetable);\n+\n+            Array.Copy(BitConverter.GetBytes(allFlags), 0, peImage, headers.MetadataStartOffset + flagsIndex, sizeof(ushort));\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal((ushort)49408, (ushort)reader.GetAssemblyDefinition().GetAssemblyName().Flags);\n+        }\n+\n+        [Fact]\n+        public unsafe void PropertiesTests()\n+        {\n+            byte[] peImage = (byte[])PortablePdbs.DocumentsPdb.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject(), peImage.Length);\n+            Assert.Equal(MetadataKind.Ecma335, reader.MetadataKind);\n+            Assert.Equal(0, reader.DeclarativeSecurityAttributes.Count);\n+            Assert.Equal(2, reader.MethodDebugInformation.Count);\n+            Assert.Equal(1, reader.LocalScopes.Count);\n+            Assert.Equal(0, reader.LocalVariables.Count);\n+            Assert.Equal(0, reader.LocalConstants.Count);\n+            Assert.Equal(2, reader.ImportScopes.Count);\n+            Assert.Equal(0, reader.CustomDebugInformation.Count);\n+            Assert.Equal(0, reader.ManifestResources.Count);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetNestedTypesTest()\n+        {\n+            byte[] peImage = (byte[])PortablePdbs.DocumentsPdb.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject(), peImage.Length);\n+            Assert.Equal(0, reader.GetNestedTypes(TypeDefinitionHandle.FromRowId(1)).Length);\n+        }\n+\n+        [Fact]\n+        public unsafe void ZeroFirstFieldRowIdAndGetParameterRange()\n+        {\n+            byte[] peImage = (byte[])NetModule.AppCS.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            int firstFieldRowIdIndex = IndexOf(peImage, new byte[] { 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x00, 0x71, 0x01 }, headers.MetadataStartOffset);\n+            Assert.NotEqual(firstFieldRowIdIndex, -1);\n+            peImage[firstFieldRowIdIndex + headers.MetadataStartOffset] = 0x00;\n+\n+            int firstParamRowIdIndex = IndexOf(peImage, new byte[] { 0x01, 0x00, 0x70, 0x20, 0x00, 0x00, 0x00, 0x00, 0x86 }, headers.MetadataStartOffset + firstFieldRowIdIndex);\n+            Assert.NotEqual(firstParamRowIdIndex, -1);\n+            peImage[firstParamRowIdIndex + firstFieldRowIdIndex + headers.MetadataStartOffset] = 0x00;\n+            \n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+\n+            TypeDefinitionHandle typeDef = TypeDefinitionHandle.FromRowId(1);\n+            int firstFieldRowId = -1;\n+            int lastFieldRowId = -1;\n+            reader.GetFieldRange(typeDef, out firstFieldRowId, out lastFieldRowId);\n+\n+            Assert.Equal(firstFieldRowId, 1);\n+            Assert.Equal(lastFieldRowId, 0);\n+\n+            MethodDefinitionHandle methodDef = MethodDefinitionHandle.FromRowId(1);\n+            int firstParamRowId = -1;\n+            int lastParamRowId = -1;\n+            reader.GetParameterRange(methodDef, out firstParamRowId, out lastParamRowId);\n+\n+            Assert.Equal(firstParamRowId, 1);\n+            Assert.Equal(lastParamRowId, 0);\n+\n+            methodDef = MethodDefinitionHandle.FromRowId(2);\n+            reader.GetParameterRange(methodDef, out firstParamRowId, out lastParamRowId);\n+\n+            Assert.Equal(firstParamRowId, 1);\n+            Assert.Equal(lastParamRowId, 1);\n+\n+            methodDef = MethodDefinitionHandle.FromRowId(20);\n+            reader.GetParameterRange(methodDef, out firstParamRowId, out lastParamRowId);\n+\n+            Assert.Equal(firstParamRowId, 8);\n+            Assert.Equal(lastParamRowId, 7);\n+        }\n+\n+        [Fact]\n+        public unsafe void LocalVariableandConstantRange()\n+        {\n+            byte[] peImage = (byte[])PortablePdbs.DocumentsPdb.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+\n+            //find remainingBytes to be increased because we are adding a row\n+            int remainingBytesIndex = IndexOf(peImage, BitConverter.GetBytes(180), 0);\n+            Assert.NotEqual(remainingBytesIndex, -1);\n+\n+            //need to add a row for complete test\n+            int rowCountIndex = IndexOf(peImage, new byte[] { 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1B }, remainingBytesIndex);\n+            Assert.NotEqual(rowCountIndex, -1);\n+\n+            //Find the row to double\n+            int scopeIndex = IndexOf(peImage, new byte[] { 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63 }, rowCountIndex + remainingBytesIndex);\n+            Assert.NotEqual(scopeIndex, -1);\n+\n+            //Add the row a second time\n+            peImage.ToList().InsertRange(rowCountIndex + scopeIndex + remainingBytesIndex, new List<byte> { 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00 });\n+\n+            //add a second row\n+            peImage[rowCountIndex + remainingBytesIndex] = 0x02;\n+\n+            //increase size of metadata for second row\n+            Array.Copy(BitConverter.GetBytes(196), 0, peImage, remainingBytesIndex, sizeof(int));\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject(), peImage.Length);\n+\n+            LocalScopeHandle scope = LocalScopeHandle.FromRowId(1);\n+            int firstVariableRowId = -1;\n+            int lastVariableRowId = -1;\n+            reader.GetLocalVariableRange(scope, out firstVariableRowId, out lastVariableRowId);\n+\n+            Assert.Equal(firstVariableRowId, 1);\n+            Assert.Equal(lastVariableRowId, 0);\n+\n+            int firstConstantRowId = -1;\n+            int lastConstantRowId = -1;\n+            reader.GetLocalConstantRange(scope, out firstConstantRowId, out lastConstantRowId);\n+\n+            Assert.Equal(firstConstantRowId, 1);\n+            Assert.Equal(lastConstantRowId, 7);\n+\n+            scope = LocalScopeHandle.FromRowId(2);\n+            firstVariableRowId = -1;\n+            lastVariableRowId = -1;\n+            reader.GetLocalVariableRange(scope, out firstVariableRowId, out lastVariableRowId);\n+\n+            Assert.Equal(firstVariableRowId, 1);\n+            Assert.Equal(lastVariableRowId, 0);\n+\n+            firstConstantRowId = -1;\n+            lastConstantRowId = -1;\n+            reader.GetLocalConstantRange(scope, out firstConstantRowId, out lastConstantRowId);\n+\n+            Assert.Equal(firstConstantRowId, 8);\n+            Assert.Equal(lastConstantRowId, 0);\n+\n+            int firstVariableRowIdIndex = IndexOf(peImage, new byte[] { 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0);\n+            Assert.NotEqual(firstVariableRowIdIndex, -1);\n+            peImage[firstVariableRowIdIndex] = 0x00;\n+\n+            int firstConstantRowIdIndex = IndexOf(peImage, new byte[] { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, firstVariableRowIdIndex);\n+            Assert.NotEqual(firstConstantRowIdIndex, -1);\n+            peImage[firstConstantRowIdIndex + firstVariableRowIdIndex] = 0x00;\n+           \n+            firstVariableRowId = -1;\n+            lastVariableRowId = -1;\n+            reader.GetLocalVariableRange(scope, out firstVariableRowId, out lastVariableRowId);\n+\n+            Assert.Equal(firstVariableRowId, 1);\n+            Assert.Equal(lastVariableRowId, 0);\n+\n+            firstConstantRowId = -1;\n+            lastConstantRowId = -1;\n+            reader.GetLocalConstantRange(scope, out firstConstantRowId, out lastConstantRowId);\n+\n+            Assert.Equal(firstConstantRowId, 1);\n+            Assert.Equal(lastConstantRowId, 0);\n+            \n+        }\n+\n+        [Fact]\n+        public unsafe void InvalidModuleAndAssemblyDefinition()\n+        {\n+            byte[] peImage = (byte[])PortablePdbs.DocumentsPdb.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject(), peImage.Length);\n+            Assert.Throws<InvalidOperationException>(() => reader.GetModuleDefinition());\n+            Assert.Throws<InvalidOperationException>(() => reader.GetAssemblyDefinition());\n+        }\n+\n+        [Fact]\n+        public unsafe void GetNamespaceDefinitionRootTest()\n+        {\n+            byte[] peImage = (byte[])PortablePdbs.DocumentsPdb.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject(), peImage.Length);\n+            Assert.True(reader.GetNamespaceDefinitionRoot().Parent.IsNil);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetTypeRefTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(1, reader.GetTypeReference(TypeReferenceHandle.FromRowId(1)).ResolutionScope.RowId);\n+        }\n+\n+        [Fact]\n+        public unsafe void GetCustomAttributeTreatmentAndRowIdTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(421, reader.GetCustomAttribute(CustomAttributeHandle.FromRowId(1)).Value.GetHeapOffset());\n+        }\n+\n+        [Fact]\n+        public unsafe void GetDeclarativeSecurityAttributeTest()\n+        {\n+            byte[] peImage = (byte[])WinRT.Lib.Clone();\n+            GCHandle pinned = GetPinnedPEImage(peImage);\n+            PEHeaders headers = new PEHeaders(new MemoryStream(peImage));\n+\n+            //38688266055 is the presenttable index\n+            int presentTablesIndex = IndexOf(peImage, BitConverter.GetBytes(38688266055), headers.MetadataStartOffset);\n+            Assert.NotEqual(presentTablesIndex, -1);\n+\n+            //38654728007 gives a value to the declaritive secutity row count and removes it from the row count after it.\n+            Array.Copy(BitConverter.GetBytes((ulong)38654728007), 0, peImage, presentTablesIndex + headers.MetadataStartOffset, BitConverter.GetBytes((ulong)38654728007).Length);\n+\n+            MetadataReader reader = new MetadataReader((byte*)pinned.AddrOfPinnedObject() + headers.MetadataStartOffset, headers.MetadataSize);\n+            Assert.Equal(12, reader.GetDeclarativeSecurityAttribute(DeclarativeSecurityAttributeHandle.FromRowId(1)).PermissionSet.GetHeapOffset());\n+        }","path":"src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs","position":null,"original_position":828,"commit_id":"bff46df53b4162833955d8be6b43aea27b0b202e","original_commit_id":"d171d754001ec0af3f8c36ad351e4aa0cd74fb76","user":{"login":"tmat","id":41759,"avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"body":"The usage of MetadataBuilder in your last commit looks good.","created_at":"2018-05-17T18:33:16Z","updated_at":"2018-05-17T18:33:16Z","html_url":"https://github.com/dotnet/corefx/pull/29741#discussion_r189059066","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/29741","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/189059066"},"html":{"href":"https://github.com/dotnet/corefx/pull/29741#discussion_r189059066"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29741"}},"in_reply_to_id":188816393},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/29741","id":188498509,"html_url":"https://github.com/dotnet/corefx/pull/29741","diff_url":"https://github.com/dotnet/corefx/pull/29741.diff","patch_url":"https://github.com/dotnet/corefx/pull/29741.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/29741","number":29741,"state":"open","locked":false,"title":"Codecoverage corefx\\src\\System.Reflection.Metadata\\src\\System\\Reflection\\Metadata\\MetadataReader.cs ","user":{"login":"dajeffri","id":29665299,"avatar_url":"https://avatars3.githubusercontent.com/u/29665299?v=4","gravatar_id":"","url":"https://api.github.com/users/dajeffri","html_url":"https://github.com/dajeffri","followers_url":"https://api.github.com/users/dajeffri/followers","following_url":"https://api.github.com/users/dajeffri/following{/other_user}","gists_url":"https://api.github.com/users/dajeffri/gists{/gist_id}","starred_url":"https://api.github.com/users/dajeffri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajeffri/subscriptions","organizations_url":"https://api.github.com/users/dajeffri/orgs","repos_url":"https://api.github.com/users/dajeffri/repos","events_url":"https://api.github.com/users/dajeffri/events{/privacy}","received_events_url":"https://api.github.com/users/dajeffri/received_events","type":"User","site_admin":false},"body":"Add code coverage in reference to #931","created_at":"2018-05-16T16:58:38Z","updated_at":"2018-05-17T18:33:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edf00e9066cf7ab6dcaf40e8a063cc5d6a68887a","assignee":{"login":"tmat","id":41759,"avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"assignees":[{"login":"tmat","id":41759,"avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},{"login":"nguerrera","id":75470,"avatar_url":"https://avatars0.githubusercontent.com/u/75470?v=4","gravatar_id":"","url":"https://api.github.com/users/nguerrera","html_url":"https://github.com/nguerrera","followers_url":"https://api.github.com/users/nguerrera/followers","following_url":"https://api.github.com/users/nguerrera/following{/other_user}","gists_url":"https://api.github.com/users/nguerrera/gists{/gist_id}","starred_url":"https://api.github.com/users/nguerrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguerrera/subscriptions","organizations_url":"https://api.github.com/users/nguerrera/orgs","repos_url":"https://api.github.com/users/nguerrera/repos","events_url":"https://api.github.com/users/nguerrera/events{/privacy}","received_events_url":"https://api.github.com/users/nguerrera/received_events","type":"User","site_admin":false},{"login":"dajeffri","id":29665299,"avatar_url":"https://avatars3.githubusercontent.com/u/29665299?v=4","gravatar_id":"","url":"https://api.github.com/users/dajeffri","html_url":"https://github.com/dajeffri","followers_url":"https://api.github.com/users/dajeffri/followers","following_url":"https://api.github.com/users/dajeffri/following{/other_user}","gists_url":"https://api.github.com/users/dajeffri/gists{/gist_id}","starred_url":"https://api.github.com/users/dajeffri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajeffri/subscriptions","organizations_url":"https://api.github.com/users/dajeffri/orgs","repos_url":"https://api.github.com/users/dajeffri/repos","events_url":"https://api.github.com/users/dajeffri/events{/privacy}","received_events_url":"https://api.github.com/users/dajeffri/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":300539972,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Reflection.Metadata","name":"area-System.Reflection.Metadata","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/29741/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/29741/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/29741/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/bff46df53b4162833955d8be6b43aea27b0b202e","head":{"label":"dajeffri:codeCoverageMetadataReaderComplete","ref":"codeCoverageMetadataReaderComplete","sha":"bff46df53b4162833955d8be6b43aea27b0b202e","user":{"login":"dajeffri","id":29665299,"avatar_url":"https://avatars3.githubusercontent.com/u/29665299?v=4","gravatar_id":"","url":"https://api.github.com/users/dajeffri","html_url":"https://github.com/dajeffri","followers_url":"https://api.github.com/users/dajeffri/followers","following_url":"https://api.github.com/users/dajeffri/following{/other_user}","gists_url":"https://api.github.com/users/dajeffri/gists{/gist_id}","starred_url":"https://api.github.com/users/dajeffri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajeffri/subscriptions","organizations_url":"https://api.github.com/users/dajeffri/orgs","repos_url":"https://api.github.com/users/dajeffri/repos","events_url":"https://api.github.com/users/dajeffri/events{/privacy}","received_events_url":"https://api.github.com/users/dajeffri/received_events","type":"User","site_admin":false},"repo":{"id":109614759,"name":"corefx","full_name":"dajeffri/corefx","owner":{"login":"dajeffri","id":29665299,"avatar_url":"https://avatars3.githubusercontent.com/u/29665299?v=4","gravatar_id":"","url":"https://api.github.com/users/dajeffri","html_url":"https://github.com/dajeffri","followers_url":"https://api.github.com/users/dajeffri/followers","following_url":"https://api.github.com/users/dajeffri/following{/other_user}","gists_url":"https://api.github.com/users/dajeffri/gists{/gist_id}","starred_url":"https://api.github.com/users/dajeffri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajeffri/subscriptions","organizations_url":"https://api.github.com/users/dajeffri/orgs","repos_url":"https://api.github.com/users/dajeffri/repos","events_url":"https://api.github.com/users/dajeffri/events{/privacy}","received_events_url":"https://api.github.com/users/dajeffri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dajeffri/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":true,"url":"https://api.github.com/repos/dajeffri/corefx","forks_url":"https://api.github.com/repos/dajeffri/corefx/forks","keys_url":"https://api.github.com/repos/dajeffri/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dajeffri/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dajeffri/corefx/teams","hooks_url":"https://api.github.com/repos/dajeffri/corefx/hooks","issue_events_url":"https://api.github.com/repos/dajeffri/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dajeffri/corefx/events","assignees_url":"https://api.github.com/repos/dajeffri/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dajeffri/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dajeffri/corefx/tags","blobs_url":"https://api.github.com/repos/dajeffri/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dajeffri/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dajeffri/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dajeffri/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dajeffri/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dajeffri/corefx/languages","stargazers_url":"https://api.github.com/repos/dajeffri/corefx/stargazers","contributors_url":"https://api.github.com/repos/dajeffri/corefx/contributors","subscribers_url":"https://api.github.com/repos/dajeffri/corefx/subscribers","subscription_url":"https://api.github.com/repos/dajeffri/corefx/subscription","commits_url":"https://api.github.com/repos/dajeffri/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dajeffri/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dajeffri/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dajeffri/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dajeffri/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dajeffri/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dajeffri/corefx/merges","archive_url":"https://api.github.com/repos/dajeffri/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dajeffri/corefx/downloads","issues_url":"https://api.github.com/repos/dajeffri/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dajeffri/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dajeffri/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dajeffri/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dajeffri/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dajeffri/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dajeffri/corefx/deployments","created_at":"2017-11-05T20:42:51Z","updated_at":"2018-05-16T14:49:48Z","pushed_at":"2018-05-17T18:19:59Z","git_url":"git://github.com/dajeffri/corefx.git","ssh_url":"git@github.com:dajeffri/corefx.git","clone_url":"https://github.com/dajeffri/corefx.git","svn_url":"https://github.com/dajeffri/corefx","homepage":"https://github.com/dotnet/core","size":177653,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"d5f6e6a10b9b1a9cb42066ebceea21e929adb487","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2018-05-17T18:25:10Z","pushed_at":"2018-05-17T18:29:24Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://github.com/dotnet/core","size":178489,"stargazers_count":13970,"watchers_count":13970,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4026,"mirror_url":null,"archived":false,"open_issues_count":2245,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4026,"open_issues":2245,"watchers":13970,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29741"},"html":{"href":"https://github.com/dotnet/corefx/pull/29741"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/29741"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/29741/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29741/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29741/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/bff46df53b4162833955d8be6b43aea27b0b202e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tmat"}}