Ignore:
Timestamp:
Nov 29, 1999, 1:05:03 AM (26 years ago)
Author:
bird
Message:

Implemented EnumResourceNamesA/W.

File:
1 edited

Legend:

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

    r1853 r1872  
    1 /* $Id: winimagepeldr.cpp,v 1.18 1999-11-27 00:05:39 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.19 1999-11-29 00:04:06 bird Exp $ */
    22
    33/*
     
    279279  nSections = NR_SECTIONS(win32file);
    280280
    281   if(loadType == REAL_LOAD) 
     281  if(loadType == REAL_LOAD)
    282282  {
    283283   imageSize = 0;
     
    389389  }
    390390  else {
    391         if(GetSectionHdrByName (win32file, &sh, ".rsrc")) 
     391        if(GetSectionHdrByName (win32file, &sh, ".rsrc"))
    392392        {
    393393            addSection(SECTION_RESOURCE, sh.PointerToRawData,
     
    407407        imageSize = imageVirtEnd - oh.ImageBase;
    408408  }
    409   if(imageSize < oh.SizeOfImage) { 
     409  if(imageSize < oh.SizeOfImage) {
    410410        imageSize = oh.SizeOfImage;
    411411  }
     
    416416  }
    417417  else {
    418         fout << "EntryPoint == NULL" << endl; 
     418        fout << "EntryPoint == NULL" << endl;
    419419        entryPoint = NULL;
    420420  }
     
    426426  }
    427427
    428   if(loadType == REAL_LOAD) 
     428  if(loadType == REAL_LOAD)
    429429  {
    430430   if(tlsDir != NULL) {
     
    485485        //get offset in resource object of directory entry
    486486        pResDir = (PIMAGE_RESOURCE_DIRECTORY)(sh.VirtualAddress + realBaseAddress);
    487         pResourceSectionStart = sh.VirtualAddress;
    488   }
    489 
    490   if (loadType == REAL_LOAD) 
     487        ulRVAResourceSection = sh.VirtualAddress;
     488  }
     489
     490  if (loadType == REAL_LOAD)
    491491  {
    492492   if(processImports((char *)win32file) == FALSE) {
     
    495495   }
    496496  }
    497  
     497
    498498  return(TRUE);
    499499failure:
     
    543543                fileoffset = section->rawoffset + section->rawsize + offset;
    544544        }
    545   } 
     545  }
    546546  else {
    547547        protflags   = section->pageflags;
     
    552552                size = 0;
    553553                fileoffset = -1;
    554         } 
     554        }
    555555        else {
    556556                size = section->rawsize-offset;
     
    709709        }
    710710  }
    711   if(index == -1) 
     711  if(index == -1)
    712712        return NULL;
    713713
     
    804804
    805805  for(i=0;i<nrsections;i++) {
    806         switch(section[i].type) 
     806        switch(section[i].type)
    807807        {
    808808        case SECTION_CODE:
     
    855855                        int fixupsize = 0;
    856856
    857                         switch(type) 
     857                        switch(type)
    858858                        {
    859859                        case IMAGE_REL_BASED_HIGHLOW:
     
    864864                                fixupsize = 2;
    865865                                break;
    866                         }                       
    867                         //If the fixup crosses the final page boundary, 
    868                         //then we have to load another page 
    869                         if(prel->VirtualAddress + offset + fixupsize > virtAddress + size) 
     866                        }
     867                        //If the fixup crosses the final page boundary,
     868                        //then we have to load another page
     869                        if(prel->VirtualAddress + offset + fixupsize > virtAddress + size)
    870870                        {
    871871                                newpage  = realBaseAddress + prel->VirtualAddress + offset + fixupsize;
     
    877877                                        dprintf(("::setFixups -> section == NULL!!"));
    878878                                        return FALSE;
    879                                 }               
     879                                }
    880880                                //SvL: Read page from disk
    881881                                commitPage(newpage, TRUE, SINGLE_PAGE);
     
    885885                        }
    886886
    887                         switch(type) 
     887                        switch(type)
    888888                        {
    889889                        case IMAGE_REL_BASED_ABSOLUTE:
     
    903903                                break;
    904904                        }
    905                         if(prel->VirtualAddress + offset + fixupsize > virtAddress + size) 
     905                        if(prel->VirtualAddress + offset + fixupsize > virtAddress + size)
    906906                        {
    907907                                //SvL: Restore original page protection flags
     
    13081308    {  //not found, so load it
    13091309        char modname[CCHMAXPATH];
    1310        
     1310
    13111311        strcpy(modname, pszCurModule);
    13121312        //rename dll if necessary (i.e. OLE32 -> OLE32OS2)
     
    14411441  NameExport *curexport;
    14421442  ULONG       ulAPIOrdinal;                      /* api requested by ordinal */
    1443  
     1443
    14441444  apilen = strlen(name) + 1;
    1445   if(apilen < 4) 
     1445  if(apilen < 4)
    14461446  {
    14471447        *(ULONG *)tmp = 0;
     
    14521452
    14531453  curexport = nameexports;
    1454   for(i=0; i<nrNameExports; i++) 
     1454  for(i=0; i<nrNameExports; i++)
    14551455  {
    1456     if(apilen == curexport->nlength && 
    1457        *(ULONG *)curexport->name == *(ULONG *)name) 
     1456    if(apilen == curexport->nlength &&
     1457       *(ULONG *)curexport->name == *(ULONG *)name)
    14581458    {
    1459         if(strcmp(curexport->name, name) == 0) 
     1459        if(strcmp(curexport->name, name) == 0)
    14601460                return(curexport->virtaddr);
    14611461    }
     
    14781478        curexport++;
    14791479  }
    1480   //Name exports also contain an ordinal, so check this 
     1480  //Name exports also contain an ordinal, so check this
    14811481  nexport = nameexports;
    14821482  for(i=0;i<nrNameExports;i++) {
Note: See TracChangeset for help on using the changeset viewer.