AddToBlobHeap() private method

private AddToBlobHeap ( byte blobBytes ) : uint
blobBytes byte
return uint
Ejemplo n.º 1
0
		internal sealed override void BuildTables(MetaData md) 
		{
			md.AddToTable(MDTable.CustomAttribute, this);
			if (byteVal == null) {
				valIx = 0;
				return;
			}

			BinaryWriter bw = new BinaryWriter(new MemoryStream());
			bw.Write(byteVal);
			MemoryStream str = (MemoryStream)bw.BaseStream;
			valIx = md.AddToBlobHeap(str.ToArray());
		}
Ejemplo n.º 2
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;

			BinaryWriter bw = new BinaryWriter (new MemoryStream ());
			md.AddToTable (MDTable.DeclSecurity, this);
			MemoryStream str = (MemoryStream)bw.BaseStream;
			WriteSig (bw);
			permissionIx = md.AddToBlobHeap(str.ToArray());

			done = true;
		}
Ejemplo n.º 3
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			nameIx = md.AddToStringsHeap(name);
			MemoryStream sig = new MemoryStream();
			sig.WriteByte(FieldSig);
			type.TypeSig(sig);
			sigIx = md.AddToBlobHeap(sig.ToArray());
			done = true;
		}
Ejemplo n.º 4
0
		internal override uint GetSigIx(MetaData md)
		{
			MemoryStream sig = new MemoryStream();
			TypeSig(sig);
			return md.AddToBlobHeap(sig.ToArray());
		}
Ejemplo n.º 5
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			nameIx = md.AddToStringsHeap(name);
			MemoryStream sig = new MemoryStream();
			byte tag = PropertyTag;
			if (instance)
				tag |= 0x20;
			sig.WriteByte(tag);
			MetaData.CompressNum(numPars,sig);
			returnType.TypeSig(sig);
			for (int i=0; i < numPars; i++) {
				parList[i].TypeSig(sig);
			}
			typeBlobIx = md.AddToBlobHeap(sig.ToArray());
			for (int i=0; i < tide; i++) {
				md.AddToTable(MDTable.MethodSemantics,methods[i]);
			}
			if (constVal != null) {
				md.AddToTable(MDTable.Constant,constVal);
				constVal.BuildTables(md);
			}
			done = true;
		}
Ejemplo n.º 6
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			nameIx = md.AddToStringsHeap(name);
			MemoryStream sig = new MemoryStream();
			sig.WriteByte(FieldSig);
			type.TypeSig(sig);
			sigIx = md.AddToBlobHeap(sig.ToArray());
			if (rva != null) {
				md.AddToTable(MDTable.FieldRVA,rva);
				rva.BuildTables(md);
			} else if (constVal != null) {
				md.AddToTable(MDTable.Constant,constVal);
				constVal.BuildTables(md);
			}
			if (layout != null) md.AddToTable(MDTable.FieldLayout,layout);
			if (marshalInfo != null) {
				md.AddToTable(MDTable.FieldMarshal,marshalInfo);
				marshalInfo.BuildTables(md);
			}
			done = true;
		}
Ejemplo n.º 7
0
		internal sealed override uint GetBlobIndex(MetaData md) 
		{
			if (!addedToBlobHeap) {
				byte [] b = Encoding.Unicode.GetBytes (val);
				blobIndex = md.AddToBlobHeap(b);
				addedToBlobHeap = true;
			}
			return blobIndex;
		}
Ejemplo n.º 8
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			MemoryStream sig = new MemoryStream();
			sig.WriteByte((byte)callConv);
			MetaData.CompressNum(numPars+numOptPars,sig);
			returnType.TypeSig(sig);
			for (int i=0; i < numPars; i++) {
				parameters[i].TypeSig(sig);
			}
			sigIx = md.AddToBlobHeap(sig.ToArray());
			if (numOptPars > 0) {
				sig.WriteByte(Sentinel);
				for (int i=0; i < numOptPars; i++) {
					optParams[i].TypeSig(sig);
				}
			}
			done = true;
		}
Ejemplo n.º 9
0
		internal sealed override uint GetBlobIndex(MetaData md) 
		{
			if (!addedToBlobHeap) {
				if (val) blobIndex = md.AddToBlobHeap((sbyte)1);
				else blobIndex = md.AddToBlobHeap((sbyte)0);
				addedToBlobHeap = true;
			}
			return blobIndex;
		}
Ejemplo n.º 10
0
		internal sealed override uint GetBlobIndex(MetaData md) 
		{
			if (!addedToBlobHeap) {
				switch (size) {
					case (1) : blobIndex = md.AddToBlobHeap((byte)val); break;
					case (2) : blobIndex = md.AddToBlobHeap((ushort)val); break;
					case (4) : blobIndex = md.AddToBlobHeap((uint)val); break;
					default : blobIndex = md.AddToBlobHeap(val); break;
				}
				addedToBlobHeap = true;
			}
			return blobIndex;
		}
Ejemplo n.º 11
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			MemoryStream sig = new MemoryStream();
			TypeSig(sig);
			sigIx = md.AddToBlobHeap(sig.ToArray());
			done = true;
		}
Ejemplo n.º 12
0
		internal uint GetSigIx (MetaData md)
		{
			if (done)
				return sigIx;

			MemoryStream sig = new MemoryStream();
			TypeSig (sig);
			sigIx = md.AddToBlobHeap (sig.ToArray());
			done = true;
			return sigIx;
		}
Ejemplo n.º 13
0
		internal TypeSpec(Type aType, MetaData md) 
		{
			MemoryStream sig = new MemoryStream();
			aType.TypeSig(sig);
			sigIx = md.AddToBlobHeap(sig.ToArray());
			tabIx = MDTable.TypeSpec;
		}
Ejemplo n.º 14
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			ntIx = md.AddToBlobHeap(nt.ToBlob());
			done = true;
		}
Ejemplo n.º 15
0
		internal sealed override uint GetBlobIndex(MetaData md) 
		{
			if (!addedToBlobHeap) {
				blobIndex = md.AddToBlobHeap((int)0);
				addedToBlobHeap = true;
			}
			return blobIndex;
		}
Ejemplo n.º 16
0
		internal FileRef(uint nameIx, byte[] hashBytes, bool metaData,
				bool entryPoint, MetaData md) {
			if (!metaData) flags = NoMetaData;
			if (entryPoint) md.SetEntryPoint(this);
			this.nameIx = nameIx;
			hashIx = md.AddToBlobHeap(hashBytes);
			tabIx = MDTable.File;
		}
Ejemplo n.º 17
0
		internal sealed override void BuildTables(MetaData md) 
		{
			if (done) return;
			MemoryStream sig = new MemoryStream();
			sig.WriteByte(LocalSigByte);
			MetaData.CompressNum((uint)locals.Length,sig);
			for (int i=0; i < locals.Length; i++) {
				((Local)locals[i]).TypeSig(sig);
			}
			sigIx = md.AddToBlobHeap(sig.ToArray());
			done = true;
		}