Changeset 56 in dev for BasicCompiler32/MakePeHdr.cpp
- Timestamp:
- Feb 15, 2007, 3:39:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/MakePeHdr.cpp
r51 r56 77 77 78 78 79 int AddDataTable(char *buffer,int length){80 extern HANDLE hHeap;81 extern char *DataTable;82 extern int DataTableSize;83 int RetNum;84 85 DataTable=(char *)HeapReAlloc(hHeap,0,DataTable,DataTableSize+length+1);86 memcpy(DataTable+DataTableSize,buffer,length);87 DataTable[DataTableSize+length]=0;88 89 RetNum=DataTableSize; //ImageBase+MemPos_DataSectionが後に足される90 91 DataTableSize+=length+1;92 93 return RetNum;94 }95 96 79 void DebugVariable(void){ 97 80 char temporary[255]; … … 136 119 ////////////////// 137 120 // データテーブル 138 extern char *DataTable; 139 extern int DataTableSize; 121 dataTable.Init(); 140 122 if(bDebugCompile){ 141 DataTable=(char *)HeapAlloc(hHeap,0,2); 142 DataTable[0]=2; 143 DataTable[1]=0; 144 DataTableSize=2; 145 } 146 else{ 147 DataTable=(char *)HeapAlloc(hHeap,0,1); 148 DataTableSize=0; 123 dataTable.Add( (long)0x00000002 ); 149 124 } 150 125 … … 828 803 829 804 //データセクションのファイル上のサイズ 830 if( DataTableSize%FILE_ALIGNMENT) FileSize_DataSection=DataTableSize+(FILE_ALIGNMENT-DataTableSize%FILE_ALIGNMENT);831 else FileSize_DataSection= DataTableSize;805 if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT); 806 else FileSize_DataSection=dataTable.GetSize(); 832 807 if(FileSize_DataSection) bUse_DataSection=1; 833 808 else bUse_DataSection=0; … … 1556 1531 if(bUse_DataSection){ 1557 1532 //データ テーブル 1558 WriteFile(hFile, DataTable,DataTableSize,(DWORD *)&i2,NULL);1533 WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL); 1559 1534 i+=i2; 1560 1535 } … … 1648 1623 HeapDefaultFree(pHintTable); 1649 1624 1650 //データテーブルに関する情報を解放1651 HeapDefaultFree(DataTable);1652 1653 1625 //グローバル変数の初期バッファを解放 1654 1626 HeapDefaultFree(initGlobalBuf);
Note:
See TracChangeset
for help on using the changeset viewer.