- Timestamp:
- Sep 18, 1999, 7:47:10 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/makefile
r956 r978 1 # $Id: makefile,v 1.4 1 1999-09-15 23:38:01sandervl Exp $1 # $Id: makefile,v 1.42 1999-09-18 17:47:10 sandervl Exp $ 2 2 3 3 # … … 319 319 pefile.OBJ: pefile.cpp $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winres.h 320 320 321 winimagebase.obj: winimagebase.cpp $(PDWIN32_INCLUDE)\winimagebase.h 321 winimagebase.obj: winimagebase.cpp $(PDWIN32_INCLUDE)\winimagebase.h 322 322 winimagepe2lx.obj: winimagepe2lx.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepe2lx.h 323 323 winimagepeldr.obj: winimagepeldr.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepeldr.h 324 324 winimagelx.obj: winimagelx.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagelx.h 325 325 windllbase.obj: windllbase.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\winimagebase.h 326 windllpe2lx.obj: windllpe2lx.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windllpe2lx.h $(PDWIN32_INCLUDE)\winimagepe2lx.h 327 windlllx.obj: windlllx.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windlllx.h $(PDWIN32_INCLUDE)\winimagelx.h $(PDWIN32_INCLUDE)\odinlx.h 328 windllpeldr.obj: windllpeldr.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windllpeldr.h $(PDWIN32_INCLUDE)\winimagepeldr.h 326 windllpe2lx.obj: windllpe2lx.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windllpe2lx.h \ 327 $(PDWIN32_INCLUDE)\winimagepe2lx.h $(PDWIN32_INCLUDE)\winimagebase.h 328 windlllx.obj: windlllx.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windlllx.h \ 329 $(PDWIN32_INCLUDE)\winimagelx.h $(PDWIN32_INCLUDE)\odinlx.h \ 330 $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagelx.h 331 windllpeldr.obj: windllpeldr.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windllpeldr.h $(PDWIN32_INCLUDE)\winimagepeldr.h $(PDWIN32_INCLUDE)\winimagebase.h 329 332 winexebase.obj: winexebase.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winimagebase.h 330 winexepe2lx.obj: winexepe2lx.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexepe2lx.h $(PDWIN32_INCLUDE)\winimagepe2lx.h 331 winexelx.obj: winexelx.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexelx.h $(PDWIN32_INCLUDE)\winimagelx.h $(PDWIN32_INCLUDE)\odinlx.h 332 winexepeldr.obj: winexepeldr.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexepeldr.h $(PDWIN32_INCLUDE)\winimagepeldr.h 333 winexepe2lx.obj: winexepe2lx.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexepe2lx.h $(PDWIN32_INCLUDE)\winimagepe2lx.h $(PDWIN32_INCLUDE)\winimagebase.h 334 winexelx.obj: winexelx.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexelx.h \ 335 $(PDWIN32_INCLUDE)\winimagelx.h $(PDWIN32_INCLUDE)\odinlx.h $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagelx.h 336 winexepeldr.obj: winexepeldr.cpp $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\winexepeldr.h $(PDWIN32_INCLUDE)\winimagepeldr.h $(PDWIN32_INCLUDE)\winimagebase.h 333 337 334 338 winimgres.OBJ: winimgres.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winimagepe2lx.h $(PDWIN32_INCLUDE)\winimagepeldr.h $(PDWIN32_INCLUDE)\winimagelx.h $(PDWIN32_INCLUDE)\winres.h -
trunk/src/kernel32/windlllx.cpp
r956 r978 1 /* $Id: windlllx.cpp,v 1. 1 1999-09-15 23:39:07sandervl Exp $ */1 /* $Id: windlllx.cpp,v 1.2 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 36 36 //System dlls set EntryPoint to 0 37 37 //****************************************************************************** 38 BOOL WIN32API RegisterLxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint, PVOID unused) 38 BOOL WIN32API RegisterLxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint, 39 PVOID pResData) 39 40 { 40 41 Win32LxDll *windll; … … 46 47 return FALSE; 47 48 } 48 windll = new Win32LxDll(hInstance, EntryPoint );49 windll = new Win32LxDll(hInstance, EntryPoint, pResData); 49 50 if(windll == NULL) { 50 51 dprintf(("RegisterLxDll: windll == NULL!!!")); … … 58 59 BOOL WIN32API UnregisterLxDll(HINSTANCE hInstance) 59 60 { 61 #if 1 62 return TRUE; 63 #else 60 64 Win32LxDll *windll; 61 65 … … 68 72 delete windll; 69 73 return TRUE; 74 #endif 70 75 } 71 76 //****************************************************************************** 72 77 //****************************************************************************** 73 Win32LxDll::Win32LxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint )78 Win32LxDll::Win32LxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint, PVOID pResData) 74 79 : Win32ImageBase(hInstance), 75 Win32LxImage(hInstance ),80 Win32LxImage(hInstance, pResData), 76 81 Win32DllBase(hInstance, EntryPoint) 77 82 { -
trunk/src/kernel32/winexelx.cpp
r956 r978 1 /* $Id: winexelx.cpp,v 1. 1 1999-09-15 23:39:07sandervl Exp $ */1 /* $Id: winexelx.cpp,v 1.2 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 36 36 //System dlls set EntryPoint to 0 37 37 //****************************************************************************** 38 BOOL WIN32API RegisterLxExe(WINMAIN EntryPoint, PVOID unused)38 BOOL WIN32API RegisterLxExe(WINMAIN EntryPoint, PVOID pResData) 39 39 { 40 40 APIRET rc; … … 56 56 Win32LxExe *winexe; 57 57 58 winexe = new Win32LxExe(ppib->pib_hmte );58 winexe = new Win32LxExe(ppib->pib_hmte, pResData); 59 59 60 60 if(winexe) { … … 72 72 //****************************************************************************** 73 73 //****************************************************************************** 74 Win32LxExe::Win32LxExe(HINSTANCE hInstance )74 Win32LxExe::Win32LxExe(HINSTANCE hInstance, PVOID pResData) 75 75 : Win32ImageBase(hInstance), 76 Win32LxImage(hInstance ),76 Win32LxImage(hInstance, pResData), 77 77 Win32ExeBase(hInstance) 78 78 { -
trunk/src/kernel32/winimagebase.cpp
r956 r978 1 /* $Id: winimagebase.cpp,v 1. 1 1999-09-15 23:39:07sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.2 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 43 43 errorState(NO_ERROR), entryPoint(0), fullpath(NULL), 44 44 tlsAddress(0), tlsIndexAddr(0), tlsInitSize(0), tlsTotalSize(0), 45 tlsCallBackAddr(0), tlsIndex(-1), winres(NULL) 45 tlsCallBackAddr(0), tlsIndex(-1), winres(NULL), pResDir(NULL), 46 pResourceSectionStart(0) 46 47 { 47 48 #ifdef DEBUG -
trunk/src/kernel32/winimagelx.cpp
r956 r978 1 /* $Id: winimagelx.cpp,v 1. 1 1999-09-15 23:39:07sandervl Exp $ */1 /* $Id: winimagelx.cpp,v 1.2 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 40 40 //****************************************************************************** 41 41 //****************************************************************************** 42 Win32LxImage::Win32LxImage(HINSTANCE hInstance )42 Win32LxImage::Win32LxImage(HINSTANCE hInstance, PVOID pResData) 43 43 : Win32ImageBase(hInstance) 44 44 { … … 50 50 strcpy(szFileName, name); 51 51 strupr(szFileName); 52 53 //Pointer to PE resource tree generates by wrc (or NULL for system dlls) 54 pResDir = (PIMAGE_RESOURCE_DIRECTORY)pResData; 55 56 //pResourceSectionStart contains the virtual address of the imagebase in the PE header 57 //for the resource section (images loaded by the pe.exe) 58 //For LX images, this is 0 as OffsetToData contains a relative offset 59 pResourceSectionStart = 0; 52 60 } 53 61 //****************************************************************************** -
trunk/src/kernel32/winimagepeldr.cpp
r956 r978 1 /* $Id: winimagepeldr.cpp,v 1. 1 1999-09-15 23:39:08sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.2 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 64 64 imageVirtBase(-1), realBaseAddress(0), imageVirtEnd(0), 65 65 nrNameExports(0), nrOrdExports(0), nameexports(NULL), ordexports(NULL), 66 pResSection(NULL) , pResDir(NULL)66 pResSection(NULL) 67 67 { 68 68 strcpy(this->szFileName, szFileName); … … 359 359 if(GetSectionHdrByName (win32file, &sh, ".rsrc")) { 360 360 //get offset in resource object of directory entry 361 // pResDir = (PIMAGE_RESOURCE_DIRECTORY)ImageDirectoryOffset(win32file, IMAGE_DIRECTORY_ENTRY_RESOURCE);362 361 pResDir = (PIMAGE_RESOURCE_DIRECTORY)(sh.VirtualAddress + realBaseAddress); 362 pResourceSectionStart = (ULONG)pResSection->virtaddr - oh.ImageBase; 363 363 } 364 364 -
trunk/src/kernel32/winimgres.cpp
r956 r978 1 /* $Id: winimgres.cpp,v 1.1 4 1999-09-15 23:38:02sandervl Exp $ */1 /* $Id: winimgres.cpp,v 1.15 1999-09-18 17:47:10 sandervl Exp $ */ 2 2 3 3 /* … … 37 37 //****************************************************************************** 38 38 PIMAGE_RESOURCE_DATA_ENTRY 39 Win32 PeLdrImage::getPEResourceEntry(ULONG id, ULONG type, ULONG lang)39 Win32ImageBase::getPEResourceEntry(ULONG id, ULONG type, ULONG lang) 40 40 { 41 41 PIMAGE_RESOURCE_DIRECTORY prdType; … … 124 124 //****************************************************************************** 125 125 PIMAGE_RESOURCE_DATA_ENTRY 126 Win32 PeLdrImage::ProcessResSubDir(PIMAGE_RESOURCE_DIRECTORY prdType,127 ULONG *nodeData, int level)126 Win32ImageBase::ProcessResSubDir(PIMAGE_RESOURCE_DIRECTORY prdType, 127 ULONG *nodeData, int level) 128 128 { 129 129 PIMAGE_RESOURCE_DIRECTORY prdType2; … … 201 201 //****************************************************************************** 202 202 //****************************************************************************** 203 ULONG Win32 PeLdrImage::getPEResourceSize(ULONG id, ULONG type, ULONG lang)203 ULONG Win32ImageBase::getPEResourceSize(ULONG id, ULONG type, ULONG lang) 204 204 { 205 205 PIMAGE_RESOURCE_DATA_ENTRY pData = NULL; … … 214 214 //****************************************************************************** 215 215 //****************************************************************************** 216 HRSRC Win32 PeLdrImage::findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang)216 HRSRC Win32ImageBase::findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang) 217 217 { 218 218 PIMAGE_RESOURCE_DATA_ENTRY pData = NULL; … … 263 263 return 0; 264 264 } 265 266 char *resdata = (char *)((char *)pResDir + pData->OffsetToData - (pResSection->virtaddr - oh.ImageBase)); 265 //pResourceSectionStart contains the virtual address of the imagebase in the PE header 266 //for the resource section (images loaded by the pe.exe) 267 //For LX images, this is 0 as OffsetToData contains a relative offset 268 char *resdata = (char *)((char *)pResDir + pData->OffsetToData - pResourceSectionStart); 267 269 if(stringid != -1) {//search for string in table 268 270 USHORT *unicodestr = (USHORT *)resdata; … … 375 377 } 376 378 //****************************************************************************** 377 //TODO:378 //******************************************************************************379 HRSRC Win32LxImage::findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang)380 {381 return 0;382 }383 //******************************************************************************384 379 //****************************************************************************** 385 380 HRSRC Win32ImageBase::findResourceW(LPWSTR lpszName, LPWSTR lpszType, ULONG lang) … … 413 408 } 414 409 //****************************************************************************** 415 //TODO: 416 //****************************************************************************** 417 ULONG Win32LxImage::getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang) 418 { 419 DebugInt3(); 420 return 0; 421 } 422 //****************************************************************************** 423 //****************************************************************************** 424 ULONG Win32PeLdrImage::getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang) 410 //****************************************************************************** 411 ULONG Win32ImageBase::getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang) 425 412 { 426 413 return getPEResourceSize((ULONG)lpszName, (ULONG)lpszType, lang); … … 471 458 //****************************************************************************** 472 459 //****************************************************************************** 473 ULONG Win32 PeLdrImage::getVersionSize()460 ULONG Win32ImageBase::getVersionSize() 474 461 { 475 462 return getResourceSizeA((LPCSTR)1, (LPSTR)NTRT_VERSION); … … 477 464 //****************************************************************************** 478 465 //****************************************************************************** 479 BOOL Win32 PeLdrImage::getVersionStruct(char *verstruct, ULONG bufLength)466 BOOL Win32ImageBase::getVersionStruct(char *verstruct, ULONG bufLength) 480 467 { 481 468 PIMAGE_RESOURCE_DATA_ENTRY pData = NULL; … … 490 477 //****************************************************************************** 491 478 //****************************************************************************** 492 ULONG Win32LxImage::getVersionSize()493 {494 // return getResourceSizeA((LPCSTR)1, (LPSTR)NTRT_VERSION);495 return 0;496 }497 //******************************************************************************498 //******************************************************************************499 BOOL Win32LxImage::getVersionStruct(char *verstruct, ULONG bufLength)500 {501 PIMAGE_RESOURCE_DATA_ENTRY pData = NULL;502 503 // pData = getPEResourceEntry(1, NTRT_VERSION);504 if(pData == NULL) {505 dprintf(("Win32PeLdrImage::getVersionStruct: couldn't find version resource!"));506 return 0;507 }508 return pData->Size;509 }510 //******************************************************************************511 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.