Index: /trunk/abdev/BasicCompiler32/MakePeHdr.cpp
===================================================================
--- /trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 257)
+++ /trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 258)
@@ -551,4 +551,8 @@
 
 	trace( "コード生成が終了しました。" );
+
+	vector<ObjectModule *> masterObjectModules;
+	masterObjectModules.push_back( &compiler.objectModule );
+	//compiler.linker.Link( masterObjectModules );
 
 
@@ -1221,4 +1225,11 @@
 	delete pobj_GlobalVarSchedule;
 
+/*
+	compiler.linker.SetImageBase( ImageBase );
+	compiler.linker.ResolveDataTableSchedules( MemPos_DataSection );
+	compiler.linker.ResolveDllProcSchedules( MemPos_CodeSection, MemPos_ImportSection, LookupSize, HintSize );
+	compiler.linker.ResolveUserProcSchedules( MemPos_CodeSection );
+	compiler.linker.ResolveDataTableSchedules( MemPos_RWSection );
+*/
 
 
Index: /trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
===================================================================
--- /trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h	(revision 257)
+++ /trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h	(revision 258)
@@ -459,5 +459,5 @@
 	void PutOld( const NativeCode &nativeCode )
 	{
-		pNativeCode->Put( nativeCode );
+		pNativeCode->Put( nativeCode, true );
 	}
 	void PutOld( char c )
Index: /trunk/abdev/BasicCompiler_Common/include/Linker.h
===================================================================
--- /trunk/abdev/BasicCompiler_Common/include/Linker.h	(revision 257)
+++ /trunk/abdev/BasicCompiler_Common/include/Linker.h	(revision 258)
@@ -32,21 +32,9 @@
 class Linker
 {
-	// データテーブルスケジュール
-	void ResolveDataTableSchedules( long dataSectionBaseOffset );
-
-	// DLL関数スケジュール
-	void ResolveDllProcSchedules( long codeSectionBaseOffset, long importSectionBaseOffset );
-
-	// ユーザ定義関数スケジュール
-	void ResolveUserProcSchedules( long codeSectionBaseOffset );
-
-	// グローバル変数スケジュール
-	void ResolveGlobalVarSchedules( long rwSectionBaseOffset );
-
 	NativeCode nativeCode;
-
 	DWORD imageBase;
 
 public:
+
 	Linker()
 	{
@@ -58,4 +46,16 @@
 	}
 
+	// データテーブルスケジュール
+	void ResolveDataTableSchedules( long dataSectionBaseOffset );
+
+	// DLL関数スケジュール
+	void ResolveDllProcSchedules( long codeSectionBaseOffset, long importSectionBaseOffset, long lookupSize, long hintSize );
+
+	// ユーザ定義関数スケジュール
+	void ResolveUserProcSchedules( long codeSectionBaseOffset );
+
+	// グローバル変数スケジュール
+	void ResolveGlobalVarSchedules( long rwSectionBaseOffset );
+
 	// リンク
 	void Link( vector<ObjectModule *> &objectModules );
Index: /trunk/abdev/BasicCompiler_Common/include/NativeCode.h
===================================================================
--- /trunk/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 257)
+++ /trunk/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 258)
@@ -50,11 +50,11 @@
 	{
 	}
-	Schedule( Type type, long offset )
+	Schedule( Type type, long offset, LONG_PTR lpValue = 0 )
 		: type( type )
 		, offset( offset )
-		, lpValue( 0 )
-	{
-	}
-	Schedule( const ::UserProc *pUserProc, long offest )
+		, lpValue( lpValue )
+	{
+	}
+	Schedule( const ::UserProc *pUserProc, long offset )
 		: type( Schedule::UserProc )
 		, offset( offset )
@@ -62,5 +62,5 @@
 	{
 	}
-	Schedule( const ::DllProc *pDllProc, long offest )
+	Schedule( const ::DllProc *pDllProc, long offset )
 		: type( Schedule::DllProc )
 		, offset( offset )
@@ -80,4 +80,8 @@
 		return offset;
 	}
+	LONG_PTR GetLongPtrValue() const
+	{
+		return lpValue;
+	}
 	const ::DllProc &GetDllProc() const
 	{
@@ -90,5 +94,5 @@
 	const ::UserProc &GetUserProc() const
 	{
-		if( type != Schedule::UserProc )
+		if( !( type == Schedule::UserProc || type == Schedule::AddressOf ) )
 		{
 			SetError();
@@ -181,10 +185,10 @@
 	{
 	}
-	NativeCode( const NativeCode &nativeCode )
+	NativeCode( const NativeCode &nativeCode, bool isOpBuffer )
 		: allocateSize( 8192 )
 		, codeBuffer( (char *)malloc( allocateSize ) )
 		, size( 0 )
 	{
-		Put( nativeCode );
+		Put( nativeCode, isOpBuffer );
 	}
 	NativeCode( const char *codeBuffer, int size )
@@ -207,5 +211,5 @@
 	{
 		Clear();
-		Put( nativeCode );
+		Put( nativeCode, false );
 	}
 
@@ -250,5 +254,5 @@
 	}
 
-	void Put( const char *codeBuffer, int size )
+	void Put( const char *codeBuffer, int size, bool isOpBuffer = true )
 	{
 		Realloc( this->size + size );
@@ -258,10 +262,13 @@
 
 		// 未完成
-		extern char *OpBuffer;
-		extern int obp;
-		memcpy( OpBuffer + obp, codeBuffer, size );
-		ObpPlus( size );
-	}
-	void Put( const NativeCode &nativeCode );
+		if( isOpBuffer )
+		{
+			extern char *OpBuffer;
+			extern int obp;
+			memcpy( OpBuffer + obp, codeBuffer, size );
+			ObpPlus( size );
+		}
+	}
+	void Put( const NativeCode &nativeCode, bool isOpBuffer );
 	void Put( _int64 i64data )
 	{
Index: /trunk/abdev/BasicCompiler_Common/src/Linker.cpp
===================================================================
--- /trunk/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 257)
+++ /trunk/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 258)
@@ -20,5 +20,5 @@
 
 // DLL関数スケジュール
-void Linker::ResolveDllProcSchedules( long codeSectionBaseOffset, long importSectionBaseOffset )
+void Linker::ResolveDllProcSchedules( long codeSectionBaseOffset, long importSectionBaseOffset, long lookupSize, long hintSize )
 {
 	BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
@@ -33,6 +33,9 @@
 			);
 #else
-			// TODO: 未完成
-			SetError();
+			nativeCode.Overwrite(
+				schedule.GetOffset(),
+				static_cast<long>( imageBase + importSectionBaseOffset + lookupSize + hintSize
+					+ schedule.GetDllProc().GetLookupAddress() )
+			);
 #endif
 		}
@@ -106,5 +109,5 @@
 	ObjectModule &masterObjectModule = *objectModules[0];
 
-	nativeCode.Put( masterObjectModule.globalNativeCode );
+	nativeCode.Put( masterObjectModule.globalNativeCode, false );
 
 	masterObjectModule.meta.GetUserProcs().Iterator_Reset();
@@ -117,5 +120,5 @@
 			pUserProc->SetBeginOpAddress( nativeCode.GetSize() );
 
-			nativeCode.Put( pUserProc->GetNativeCode() );
+			nativeCode.Put( pUserProc->GetNativeCode(), false );
 
 			pUserProc->SetEndOpAddress( nativeCode.GetSize() );
Index: /trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp
===================================================================
--- /trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp	(revision 257)
+++ /trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp	(revision 258)
@@ -18,9 +18,9 @@
 }
 
-void NativeCode::Put( const NativeCode &nativeCode )
+void NativeCode::Put( const NativeCode &nativeCode, bool isOpBuffer )
 {
 	long baseOffset = size;
 
-	Put( nativeCode.codeBuffer, nativeCode.size );
+	Put( nativeCode.codeBuffer, nativeCode.size, isOpBuffer );
 
 	BOOST_FOREACH( const Schedule &schedule, nativeCode.schedules )
@@ -29,5 +29,6 @@
 			Schedule(
 				schedule.GetType(),
-				baseOffset + schedule.GetOffset()
+				baseOffset + schedule.GetOffset(),
+				schedule.GetLongPtrValue()
 			)
 		);
