|
|
@@ -9,6 +9,8 @@ using System.Runtime.CompilerServices;
|
|
|
|
|
|
namespace System.Reflection.Emit {
|
|
|
public sealed class AssemblyBuilder : Assembly {
|
|
|
+ private IntPtr _impl;
|
|
|
+
|
|
|
public override string CodeBase {get {return null;}}
|
|
|
public override MethodInfo EntryPoint {get {return null;}}
|
|
|
|
|
|
@@ -167,7 +169,19 @@ namespace System.Reflection.Emit {
|
|
|
public override string ToString() {
|
|
|
return "AssemblyBuilder";
|
|
|
}
|
|
|
+
|
|
|
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
|
|
|
+ private static extern int getDataChunk (AssemblyBuilder ab, int type, byte[] buf);
|
|
|
+
|
|
|
public void Save( string assemblyFileName) {
|
|
|
+ byte[] buf = new byte[4096];
|
|
|
+ FileStream file = new FileStream (assemblyFileName, FileMode.OpenOrCreate, FileAccess.Write);
|
|
|
+ int count;
|
|
|
+
|
|
|
+ count = getDataChunk (this, 0, buf);
|
|
|
+ file.Write (buf, 0, count);
|
|
|
+
|
|
|
+ file.Close ();
|
|
|
}
|
|
|
public void SetEntryPoint( MethodInfo entryMethod) {
|
|
|
|