Ignore:
Timestamp:
Oct 9, 2001, 10:25:21 PM (24 years ago)
Author:
sandervl
Message:

Image header page must be readonly + disabled high memory usage for heap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/winimagepeldr.cpp

    r6145 r6975  
    1 /* $Id: winimagepeldr.cpp,v 1.89 2001-07-03 06:53:39 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.90 2001-10-09 20:25:21 sandervl Exp $ */
    22
    33/*
     
    293293            for (i=0; i<nSections; i++)
    294294            {
     295                dprintf((LOG, "Section:              %-8s", psh[i].Name ));
    295296                dprintf((LOG, "Raw data size:        %x", psh[i].SizeOfRawData ));
    296297                dprintf((LOG, "Virtual Address:      %x", psh[i].VirtualAddress ));
     
    749750        size        = 4096;
    750751        sectionsize = 4096;
    751         protflags   = PAG_READ|PAG_WRITE; //readonly?
     752        //Header page must be readonly (same as in NT)
     753        protflags   = PAG_READ;
    752754        section = findPreviousSectionByOS2Addr(virtAddress);
    753755        if(section == NULL) {//access to header
     
    779781        }
    780782    }
    781     if(fPageCmd == COMPLETE_SECTION && section->type == SECTION_DEBUG) {//ignore
     783    if(fPageCmd == COMPLETE_SECTION && (section && section->type == SECTION_DEBUG)) {//ignore
    782784        return TRUE;
    783785    }
     
    970972{
    971973 ULONG lowestAddr = 0xffffffff;
    972  ULONG index = -1;
     974 LONG index = -1;
    973975
    974976    for(int i=0;i<nrsections;i++) {
    975         if(section[i].realvirtaddr > addr) {
     977        if(section[i].realvirtaddr <= addr) {
    976978            if(section[i].realvirtaddr < lowestAddr) {
    977979                lowestAddr = section[i].realvirtaddr;
     
    10521054{
    10531055 int i;
    1054  WINIMAGE_LOOKUP *imgLookup;
    1055 
    1056   imgLookup = WINIMAGE_LOOKUPADDR(realBaseAddress);
    1057   imgLookup->magic1 = MAGIC_WINIMAGE;
    1058   imgLookup->image  = this;
    1059   imgLookup->magic2 = MAGIC_WINIMAGE;
    10601056
    10611057  // Process all the image sections
Note: See TracChangeset for help on using the changeset viewer.