Ignore:
Timestamp:
Apr 15, 2000, 11:08:37 PM (25 years ago)
Author:
bird
Message:

Rewrote findDll.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/winimagebase.h

    r3375 r3391  
    1 /* $Id: winimagebase.h,v 1.2 2000-04-14 22:35:28 sandervl Exp $ */
     1/* $Id: winimagebase.h,v 1.3 2000-04-15 21:08:37 bird Exp $ */
    22
    33/*
     
    6565        char *getFullPath()           { return fullpath; };
    6666
    67         char *getModuleName()         { return szModule; };
     67    char *getModuleName()         { return szModule; };
    6868
    6969virtual HRSRC findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
     
    7373virtual BOOL  enumResourceNamesA(HMODULE hmod, LPCTSTR  lpszType, ENUMRESNAMEPROCA lpEnumFunc, LONG lParam);
    7474virtual BOOL  enumResourceNamesW(HMODULE hmod, LPCWSTR  lpszType, ENUMRESNAMEPROCW lpEnumFunc, LONG lParam);
    75 virtual BOOL  enumResourceTypesA(HMODULE hmod, ENUMRESTYPEPROCA lpEnumFunc, 
     75virtual BOOL  enumResourceTypesA(HMODULE hmod, ENUMRESTYPEPROCA lpEnumFunc,
    7676                                 LONG lParam);
    77 virtual BOOL  enumResourceTypesW(HMODULE hmod, ENUMRESTYPEPROCW lpEnumFunc, 
     77virtual BOOL  enumResourceTypesW(HMODULE hmod, ENUMRESTYPEPROCW lpEnumFunc,
    7878                                 LONG lParam);
    7979
     
    8282
    8383static  BOOL  isPEImage(char *szFileName);
    84 static  void  findDll(char *szFileName, char *szFullName, int cchFullFileName);
     84static  BOOL  findDll(const char *pszFileName, char *pszFullName, int cchFullName);
    8585
    86         void  setEntryPoint(ULONG startAddress) { entryPoint = startAddress; };
     86    void  setEntryPoint(ULONG startAddress) { entryPoint = startAddress; };
    8787
    88         void  setTLSAddress(LPVOID dwTlsAddress)        { tlsAddress = dwTlsAddress; };
    89         void  setTLSIndexAddr(LPDWORD dwTlsIndexAddr)   { tlsIndexAddr = dwTlsIndexAddr; };
    90         void  setTLSInitSize(ULONG dwTlsSize)           { tlsInitSize = dwTlsSize; };
    91         void  setTLSTotalSize(ULONG dwTlsSize)          { tlsTotalSize = dwTlsSize; };
     88        void  setTLSAddress(LPVOID dwTlsAddress)        { tlsAddress = dwTlsAddress; };
     89        void  setTLSIndexAddr(LPDWORD dwTlsIndexAddr)   { tlsIndexAddr = dwTlsIndexAddr; };
     90        void  setTLSInitSize(ULONG dwTlsSize)       { tlsInitSize = dwTlsSize; };
     91        void  setTLSTotalSize(ULONG dwTlsSize)      { tlsTotalSize = dwTlsSize; };
    9292        void  setTLSCallBackAddr(PIMAGE_TLS_CALLBACK *dwTlsCallBackAddr)
    93         {
    94            tlsCallBackAddr = dwTlsCallBackAddr;
    95         };
     93    {
     94       tlsCallBackAddr = dwTlsCallBackAddr;
     95    };
    9696
    97         void  tlsAttachThread();        //setup TLS structures for new thread
    98         void  tlsDetachThread();        //destroy TLS structures
     97    void  tlsAttachThread();    //setup TLS structures for new thread
     98    void  tlsDetachThread();    //destroy TLS structures
    9999
    100 virtual ULONG     getApi(char *name)  = 0;
     100virtual ULONG     getApi(char *name)  = 0;
    101101virtual ULONG     getApi(int ordinal) = 0;
    102102
     
    105105static Win32ImageBase * findModule(HMODULE hModule);
    106106
    107         //Add image to dependency list of this image
    108         void  addDependency(Win32DllBase *dll);
     107    //Add image to dependency list of this image
     108    void  addDependency(Win32DllBase *dll);
    109109        BOOL  dependsOn(Win32DllBase *dll);
    110110
    111111protected:
    112         void tlsAlloc();                //Allocate TLS index for this module
    113         void tlsDelete();               //Destroy TLS index for this module
     112    void tlsAlloc();        //Allocate TLS index for this module
     113    void tlsDelete();       //Destroy TLS index for this module
    114114
    115115        Win32Resource        *winres;
     
    118118
    119119        char                 *fullpath;
    120         char                  szModule[CCHMAXPATH];
    121         char                  szFileName[CCHMAXPATH];
     120    char              szModule[CCHMAXPATH];
     121    char                  szFileName[CCHMAXPATH];
    122122
    123123        HINSTANCE             hinstance;
    124124
    125         LPVOID                tlsAddress;               //address of TLS data
    126         LPDWORD               tlsIndexAddr;             //address of DWORD that receives the TLS index
    127         ULONG                 tlsInitSize;              //size of initialized TLS memory block
    128         ULONG                 tlsTotalSize;             //size of TLS memory block
    129         PIMAGE_TLS_CALLBACK  *tlsCallBackAddr;  //ptr to TLS callback array
    130         ULONG                 tlsIndex;         //module TLS index
     125    LPVOID                tlsAddress;       //address of TLS data
     126    LPDWORD           tlsIndexAddr;     //address of DWORD that receives the TLS index
     127    ULONG             tlsInitSize;      //size of initialized TLS memory block
     128    ULONG             tlsTotalSize;     //size of TLS memory block
     129    PIMAGE_TLS_CALLBACK  *tlsCallBackAddr;  //ptr to TLS callback array
     130    ULONG                 tlsIndex;     //module TLS index
    131131
    132132        ULONG getPEResourceSize(ULONG id, ULONG type, ULONG lang = LANG_GETFIRST);
     
    143143        ULONG                     ulRVAResourceSection;
    144144
    145         //linked list of dlls loaded on behalf of this executable image (dll or exe)
    146         Queue                      loadedDlls;
     145    //linked list of dlls loaded on behalf of this executable image (dll or exe)
     146        Queue                  loadedDlls;
    147147private:
    148148
     
    161161} WINIMAGE_LOOKUP;
    162162
    163 #define WINIMAGE_LOOKUPADDR(a)  (WINIMAGE_LOOKUP *)((ULONG)a + PAGE_SIZE - sizeof(WINIMAGE_LOOKUP))
     163#define WINIMAGE_LOOKUPADDR(a)  (WINIMAGE_LOOKUP *)((ULONG)a + PAGE_SIZE - sizeof(WINIMAGE_LOOKUP))
    164164
    165165#endif //__WINIMAGEBASE_H__
Note: See TracChangeset for help on using the changeset viewer.