Changeset 3757 for trunk/src/kernel32/winimagepeldr.cpp
- Timestamp:
- Jun 26, 2000, 2:23:54 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagepeldr.cpp
r3678 r3757 1 /* $Id: winimagepeldr.cpp,v 1.4 7 2000-06-08 18:08:57sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.48 2000-06-26 12:23:54 sandervl Exp $ */ 2 2 3 3 /* … … 105 105 imageVirtBase(-1), realBaseAddress(0), imageVirtEnd(0), 106 106 nrNameExports(0), nrOrdExports(0), nameexports(NULL), ordexports(NULL), 107 memmap(NULL), pFixups(NULL) 107 memmap(NULL), pFixups(NULL), dwFixupSize(0) 108 108 { 109 109 HFILE dllfile; … … 464 464 465 465 if(realBaseAddress != oh.ImageBase) { 466 pFixups = (PIMAGE_BASE_RELOCATION)ImageDirectoryOffset(win32file, IMAGE_DIRECTORY_ENTRY_BASERELOC); 466 pFixups = (PIMAGE_BASE_RELOCATION)ImageDirectoryOffset(win32file, IMAGE_DIRECTORY_ENTRY_BASERELOC); 467 dwFixupSize = ImageDirectorySize(win32file, IMAGE_DIRECTORY_ENTRY_BASERELOC); 467 468 commitPage((ULONG)pFixups, FALSE); 468 469 } … … 621 622 return FALSE; 622 623 } 623 if(realBaseAddress != oh.ImageBase) { 624 setFixups(virtAddress, sectionsize); 625 } 624 setFixups(virtAddress, sectionsize); 626 625 627 626 rc = DosSetMem((PVOID)virtAddress, sectionsize, protflags); … … 637 636 return FALSE; 638 637 } 639 if(realBaseAddress != oh.ImageBase) { 640 setFixups(virtAddress, sectionsize); 641 } 638 setFixups(virtAddress, sectionsize); 639 642 640 rc = DosSetMem((PVOID)virtAddress, sectionsize, protflags); 643 641 if(rc) { … … 872 870 PIMAGE_BASE_RELOCATION prel = pFixups; 873 871 874 if( fh.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) {872 if(realBaseAddress == oh.ImageBase || fh.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) { 875 873 return(TRUE); 876 874 } … … 883 881 if(prel) { 884 882 j = 1; 885 while(prel->VirtualAddress && prel->VirtualAddress < virtAddress) { 883 while(((ULONG)prel < (ULONG)pFixups+dwFixupSize) && 884 prel->VirtualAddress && prel->VirtualAddress < virtAddress) 885 { 886 886 prel = (PIMAGE_BASE_RELOCATION)((char*)prel + prel->SizeOfBlock); 887 887 } 888 while(prel->VirtualAddress && prel->VirtualAddress < virtAddress + size) { 888 while(((ULONG)prel < (ULONG)pFixups+dwFixupSize) && 889 prel->VirtualAddress && prel->VirtualAddress < virtAddress + size) 890 { 889 891 page = (char *)((char *)prel + (ULONG)prel->VirtualAddress); 890 892 count = (prel->SizeOfBlock - 8)/2;
Note:
See TracChangeset
for help on using the changeset viewer.