Changeset 56 in dev for BasicCompiler64/MakePeHdr.cpp
- Timestamp:
- Feb 15, 2007, 3:39:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/MakePeHdr.cpp
r51 r56 65 65 bUse_DebugSection; 66 66 67 int AddDataTable(char *buffer,int length){68 extern HANDLE hHeap;69 extern char *DataTable;70 extern int DataTableSize;71 int RetNum;72 73 DataTable=(char *)HeapReAlloc(hHeap,0,DataTable,DataTableSize+length+1);74 memcpy(DataTable+DataTableSize,buffer,length);75 DataTable[DataTableSize+length]=0;76 77 RetNum=DataTableSize; //ImageBase+MemPos_DataSectionが後に足される78 79 DataTableSize+=length+1;80 81 return RetNum;82 }83 84 67 85 68 void DebugVariable(void){ … … 124 107 ////////////////// 125 108 // データテーブル 126 extern char *DataTable; 127 extern int DataTableSize; 109 dataTable.Init(); 128 110 if(bDebugCompile){ 129 DataTable=(char *)HeapAlloc(hHeap,0,2); 130 DataTable[0]=2; 131 DataTable[1]=0; 132 DataTableSize=2; 133 } 134 else{ 135 DataTable=(char *)HeapAlloc(hHeap,0,1); 136 DataTableSize=0; 111 dataTable.Add( (long)0x00000002 ); 137 112 } 138 113 … … 841 816 842 817 //データセクションのファイル上のサイズ 843 if( DataTableSize%FILE_ALIGNMENT) FileSize_DataSection=DataTableSize+(FILE_ALIGNMENT-DataTableSize%FILE_ALIGNMENT);844 else FileSize_DataSection= DataTableSize;818 if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT); 819 else FileSize_DataSection=dataTable.GetSize(); 845 820 if(FileSize_DataSection) bUse_DataSection=1; 846 821 else bUse_DataSection=0; … … 1577 1552 if(bUse_DataSection){ 1578 1553 //データ テーブル 1579 WriteFile(hFile, DataTable,DataTableSize,(DWORD *)&i2,NULL);1554 WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL); 1580 1555 i+=i2; 1581 1556 } … … 1669 1644 HeapDefaultFree(pHintTable); 1670 1645 1671 //データテーブルに関する情報を解放1672 HeapDefaultFree(DataTable);1673 1674 1646 //グローバル変数の初期バッファを解放 1675 1647 HeapDefaultFree(initGlobalBuf);
Note:
See TracChangeset
for help on using the changeset viewer.