Ignore:
Timestamp:
Nov 22, 1999, 9:36:53 PM (26 years ago)
Author:
sandervl
Message:

PE loader rewrite changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/winimagepeldr.h

    r1706 r1812  
    1 /* $Id: winimagepeldr.h,v 1.4 1999-11-11 19:08:50 sandervl Exp $ */
     1/* $Id: winimagepeldr.h,v 1.5 1999-11-22 20:36:53 sandervl Exp $ */
    22
    33/*
     
    1414
    1515#include <winimagebase.h>
     16
     17#define SINGLE_PAGE             0  //commit single page
     18#define COMPLETE_SECTION        1  //commit entire section
     19#define SECTION_PAGES           2  //commit default nr of pages
     20
     21#define DEFAULT_NR_PAGES        16 //default nr of pages to commit during exception
    1622
    1723//SvL: To load a dll/exe for i.e. getting a single resource (GetVersionSize/Resource)
     
    4147
    4248typedef struct {
    43   char  *rawdata;
     49  ULONG  rawoffset;
    4450  ULONG  rawsize;
    4551  ULONG  virtaddr;
     
    4753  ULONG  virtualsize;
    4854  ULONG  type;
     55  ULONG  pageflags;
    4956} Section;
    5057
     
    6269
    6370class Win32DllBase;
     71class Win32MemMap;
    6472
    6573class Win32PeLdrImage : public virtual Win32ImageBase
     
    7482virtual BOOL  init(ULONG reservedMem);
    7583
     84        //commits image page(s) when an access violation exception is dispatched
     85        BOOL  commitPage(ULONG virtAddress, BOOL fWriteAccess, int fPageCmd = SECTION_PAGES);
     86
    7687protected:
    77         void StoreImportByOrd(Win32DllBase *WinDll, ULONG ordinal, ULONG impaddr);
    78         void StoreImportByName(Win32DllBase *WinDll, char *impname, ULONG impaddr);
     88        void  StoreImportByOrd(Win32DllBase *WinDll, ULONG ordinal, ULONG impaddr);
     89        void  StoreImportByName(Win32DllBase *WinDll, char *impname, ULONG impaddr);
    7990
    80         void  addSection(ULONG type, char *rawdata, ULONG rawsize, ULONG virtaddress, ULONG virtsize);
     91        void  addSection(ULONG type, ULONG rawoffset, ULONG rawsize, ULONG virtaddress, ULONG virtsize);
    8192        BOOL  allocSections(ULONG reservedMem);
    8293        BOOL  allocFixedMem(ULONG reservedMem);
    8394     Section *findSection(ULONG type);
    8495     Section *findSectionByAddr(ULONG addr);
     96     Section *findSectionByOS2Addr(ULONG addr);
     97     Section *findPreviousSectionByOS2Addr(ULONG addr);
    8598
    86         BOOL  storeSections(char *win32file);
    8799        BOOL  setMemFlags();
    88100        BOOL  setFixups(PIMAGE_BASE_RELOCATION prel);
     101        BOOL  setFixups(ULONG virtAddress, ULONG size);
    89102        void  AddOff32Fixup(ULONG fixupaddr);
    90103        void  AddOff16Fixup(ULONG fixupaddr, BOOL fHighFixup);
     
    110123
    111124        ULONG                 loadType;
    112         HANDLE                fImgMapping;
    113125
     126        HFILE                 hFile;
     127
     128        PIMAGE_BASE_RELOCATION pFixups;
     129
     130        Win32MemMap          *memmap;
    114131private:
    115132};
Note: See TracChangeset for help on using the changeset viewer.