Ejemplo n.º 1
0
int main(){
	TestHeap();
	//Test5();
	//Test4();
	//Test3();
	//Test2();
	//Test1();
	return 0;
}
Ejemplo n.º 2
0
void main()
{
	TestHeap();
	TestSort();
	TestList();
	TestString();
	//
	printf("End.");
	char c; scanf_s("%c", &c);
}
Ejemplo n.º 3
0
Archivo: Linker.cpp Proyecto: Madzi/POW
int LinkProgram(LPSTR oFilLst[], LPSTR lFilLst[], LPSTR rFil, LPSTR eFil, LPSTR stUpSym,
                LPSTR eFncLst[], WORD sSys, BOOL bExeFil, BOOL bWinNtFil, DWORD iDbgInf, FARPROC msg, 
																DWORD basAdr, DWORD stackSize)
{																	
	CObj2Exe	*newExe;
	UINT					startTime, endTime, firstTime;
	BOOL					lnkOK= TRUE;
	
	memset(chrBufCC, 0xCC, 0x200);
	memset(chrBuf00, 0x00, 0x200);

	logOn= FALSE;
	oneLibLst= TRUE;
	libFilInMem= FALSE;
	heapMsg= FALSE;
	shwDRCMsg= FALSE;
	ErrMsgPrc= msg;

	if (logOn)
	{
		logFil = fopen(logFilNam,"w");
		fclose(logFil);
	}

	newExe= new CObj2Exe();
	newExe-> objFilLst= oFilLst;

 newExe-> libFilLst= lFilLst;
 newExe-> resFil= rFil;
 newExe-> exeFil= eFil;
 newExe-> startUpSym= stUpSym;
 newExe-> expFncLst= eFncLst;
 newExe-> bldExeFil= bExeFil;
 newExe-> incDbgInf= iDbgInf;
 newExe-> bldWinNtFil= bWinNtFil;
 newExe-> subSystem= sSys;
	newExe-> basAdr= basAdr;
 newExe-> stackSize= stackSize;

	WriteMessageToPow(INF_MSG_INI, NULL, NULL);
	startTime= GetTickCount();
	lnkOK= newExe-> InitLinker();
	endTime= GetTickCount();
 firstTime= startTime;                          
 printf("\nInitialisieren: % 7.3f\n", (endTime - startTime) * 0.001);
 TestHeap();
                                
	if (lnkOK)
	{
		WriteMessageToPow(INF_MSG_RES_SYM, NULL, NULL);
		startTime= endTime;
		lnkOK= newExe-> ResolveSymbols();
		endTime= GetTickCount();
		printf("\nSymbole auflösen: % 7.3f\n", (endTime - startTime) * 0.001);
		TestHeap();
	}
	
	if (lnkOK)
	{
		WriteMessageToPow(INF_MSG_FRE_LIB, NULL, NULL);
		startTime= endTime;
		lnkOK= newExe-> FreeLibFiles();
	 endTime= GetTickCount();
		printf("\nFreigeben der Libfiles: % 7.3f\n", (endTime - startTime) * 0.001);
		TestHeap();
	}

	if (lnkOK) 
	{
		WriteMessageToPow(INF_MSG_CON_SEC_FRG, NULL, NULL);
		startTime= endTime;
		lnkOK= newExe-> ConnectSectionFragments();
		endTime= GetTickCount();
		printf("\nZusammensetzen der Sectionfragmente: % 7.3f\n", (endTime - startTime) * 0.001);
		TestHeap();
	}
 
	if (lnkOK)
	{
		WriteMessageToPow(INF_MSG_RES_REL, NULL, NULL);
		startTime= endTime;
		lnkOK= newExe-> ResolveRelocations();
		endTime= GetTickCount();
		printf("\nRelocationen auflösen: % 7.3f\n", (endTime - startTime) * 0.001);
		TestHeap();
	}
 
	if (lnkOK)
	{
		if (iDbgInf)
		{	
			WriteMessageToPow(INF_MSG_BLD_DBG, NULL, NULL);
			startTime= endTime;
			lnkOK= newExe-> BuildDebugInformation();
			endTime= GetTickCount();
 		printf("\nDebuginformation erstellen: % 7.3f\n", (endTime - startTime) * 0.001);
		}
		TestHeap();
	}

	if (lnkOK)
	{ 
		WriteMessageToPow(INF_MSG_WRT_PE, NULL, NULL);
		startTime= endTime;
		lnkOK= newExe-> BuildExeFile();
		endTime= GetTickCount();
		if (lnkOK)
			printf("\nExefile erstellen: % 7.3f\n", (endTime - startTime) * 0.001);
		TestHeap();
	}

	WriteMessageToPow(INF_MSG_FRE_MEM, NULL, NULL); 
	startTime= endTime;
	FreeCObj2Exe(newExe);
	delete newExe;
	endTime= GetTickCount();
	printf("\nSpeicher freigeben: % 7.3f\n", (endTime - startTime) * 0.001);
	TestHeap();
	endTime= GetTickCount();
	printf("\nGesamtlinkzeit: % 7.3f\n", (endTime - firstTime) * 0.001);

	return lnkOK;
}