Ignore:
Timestamp:
Apr 17, 2001, 2:26:28 AM (24 years ago)
Author:
bird
Message:

Second iteration of the kFile* classes and interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kInterfaces.h

    r4751 r5531  
    1 /* $Id: kInterfaces.h,v 1.1 2000-12-04 08:49:00 bird Exp $
     1/* $Id: kInterfaces.h,v 1.2 2001-04-17 00:26:12 bird Exp $
    22 *
    33 * This headerfile contains interfaces for the common tools classes.
     
    1212#ifndef _kInterfaces_h_
    1313#define _kInterfaces_h_
     14
     15
     16class kPageI;
     17class kExportI;
     18class kExportEntry;
     19class kModuleI;
     20
    1421
    1522/**
     
    3138     * @param   ulAddress   Page address. This will be page aligned.
    3239     */
    33     virtual BOOL    getPage(char *pachPage, ULONG ulAddress) = 0;
     40    virtual BOOL    pageGet(char *pachPage, ULONG ulAddress) = 0;
    3441
    3542    /**
     
    4249     * @remark  Object = Section.
    4350     */
    44     virtual BOOL    getPage(char *pachPage, int iObject, int offObject) = 0;
     51    virtual BOOL    pageGet(char *pachPage, int iObject, int offObject) = 0;
    4552
    4653    /**
     
    5158     * @param   ulAddress   Page address. This will be page aligned.
    5259     */
    53     virtual BOOL    putPage(const char *pachPage, ULONG ulAddress) = 0;
     60    virtual BOOL    pagePut(const char *pachPage, ULONG ulAddress) = 0;
    5461
    5562    /**
     
    6168     * @param   offObject   Offset into the object.
    6269     */
    63     virtual BOOL    putPage(const char *pachPage, int iObject, int offObject) = 0;
     70    virtual BOOL    pagePut(const char *pachPage, int iObject, int offObject) = 0;
    6471
    6572    /**
     
    6774     * @returns Pagesize in bytes.
    6875     */
    69     virtual int     getPageSize() = 0;
     76    virtual int     pageGetPageSize() = 0;
     77};
     78
     79
     80/**
     81 * ExportEntry used by the findFirstExport/findNextExport functions
     82 */
     83class kExportEntry
     84{
     85#define MAXEXPORTNAME 256
     86public:
     87    unsigned long   ulOrdinal;                  /* Ordinal of export. 0 if invalid. */
     88    char            achName[MAXEXPORTNAME];     /* Public or exported name. */
     89    char            achIntName[MAXEXPORTNAME];  /* Optional. not used by PEFile */
     90
     91    unsigned long   ulOffset;                   /* Offset. -1 if invalid. */
     92    unsigned long   iObject;                    /* Object number. -1 if invalid. */
     93    unsigned long   ulAddress;                  /* Address of symbol. -1 if invalid. */
     94
     95public:
     96    /** @cat Internal use - don't mess! */
     97    void *          pv;                          /* Internal pointer. */
     98};
     99
     100/**
     101 * Interface class (ie. virtual) which defines the interface for executables
     102 * (objects and libraries to perhaps) files used to enumerate exports and
     103 * public exported names.
     104 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     105 */
     106class kExportI
     107{
     108public:
     109    /** @cat Export enumeration methods. */
     110
     111    /**
     112     * Find the first export/public name.
     113     * @returns Success indicator.
     114     * @param   pExport     Communication area.
     115     */
     116    virtual BOOL    exportFindFirst(kExportEntry * pExport) = 0;
     117
     118    /**
     119     * Find the next export/public name.
     120     * @returns Success indicator.
     121     *          FALSE when no more exports (exportFindClose has been processed then).
     122     * @param   pExport     Communication area which has been successfully
     123     *                      processed by findFirstExport.
     124     */
     125    virtual BOOL    exportFindNext(kExportEntry * pExport) = 0;
     126
     127    /**
     128     * Frees resources associated with the communicatin area.
     129     * It's not necessary to call this when exportFindNext has return FALSE.
     130     * @param   pExport     Communication area which has been successfully
     131     *                      processed by findFirstExport.
     132     */
     133    virtual void    exportFindClose(kExportEntry * pExport) = 0;
     134
     135
     136    /** @cat Export Search methods */
     137
     138    /**
     139     * Lookup information on a spesific export given by ordinal number.
     140     * @returns Success indicator.
     141     * @param   pExport     Communication area containing export information
     142     *                      on successful return.
     143     */
     144    virtual BOOL    exportLookup(unsigned long ulOrdinal, kExportEntry *pExport) = 0;
     145
     146    /**
     147     * Lookup information on a spesific export given by name.
     148     * @returns Success indicator.
     149     * @param   pExport     Communication area containing export information
     150     *                      on successful return.
     151     */
     152    virtual BOOL    exportLookup(const char *  pszName, kExportEntry *pExport) = 0;
     153};
     154
     155
     156/**
     157 * Interface class (ie. virtual) which defines the interface for executables
     158 * (objects and libraries to perhaps) files used to enumerate exports and
     159 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     160 */
     161class kModuleI
     162{
     163public:
     164    /** @cat Module information methods. */
     165    virtual BOOL    moduleGetName(char *pszBuffer, int cbBuffer = 260) = 0;
     166};
     167
     168
     169/**
     170 * Interface class (ie. virtual) which defines the interface for
     171 * executables files.
     172 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     173 */
     174class kExecutableI : public kModuleI, public kExportI
     175{
     176public:
     177    /** @cat Executable information methods. */
     178    #if 0
     179    virtual BOOL execIsDLL(void) = 0;
     180    virtual BOOL execIsProgram(void) = 0;
     181    virtual BOOL execIsDriver(void) = 0;
     182    #endif
    70183};
    71184
Note: See TracChangeset for help on using the changeset viewer.