| 1 | /* $Id: winimagepe2lx.h,v 1.1 1999-09-15 23:29:37 sandervl Exp $ */
 | 
|---|
| 2 | 
 | 
|---|
| 3 | /*
 | 
|---|
| 4 |  * Win32 PE2LX Image base class
 | 
|---|
| 5 |  *
 | 
|---|
| 6 |  * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
 | 
|---|
| 7 |  *
 | 
|---|
| 8 |  *
 | 
|---|
| 9 |  * Project Odin Software License can be found in LICENSE.TXT
 | 
|---|
| 10 |  *
 | 
|---|
| 11 |  */
 | 
|---|
| 12 | #ifndef __WINIMAGEPE2LX_H__
 | 
|---|
| 13 | #define __WINIMAGEPE2LX_H__
 | 
|---|
| 14 | 
 | 
|---|
| 15 | #include <winimagebase.h>
 | 
|---|
| 16 | 
 | 
|---|
| 17 | #define NO_NAMETABLE            0x77777777
 | 
|---|
| 18 | #define NO_LOOKUPTABLE          0x888888
 | 
|---|
| 19 | #define GET_CONSOLE(a)          (a >> 24)
 | 
|---|
| 20 | #define SET_CONSOLE(a)          (a << 24)
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #define RESID_CONVERTEDNAMES    63*1024
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #pragma pack(1)
 | 
|---|
| 25 | typedef struct {
 | 
|---|
| 26 |   int    id;
 | 
|---|
| 27 |   char   name[1];
 | 
|---|
| 28 | } NameId;
 | 
|---|
| 29 | #pragma pack()
 | 
|---|
| 30 | 
 | 
|---|
| 31 | class Win32Pe2LxImage : public virtual Win32ImageBase
 | 
|---|
| 32 | {
 | 
|---|
| 33 | public:
 | 
|---|
| 34 |          Win32Pe2LxImage(HINSTANCE hinstance, int NameTableId, int Win32TableId);
 | 
|---|
| 35 | virtual ~Win32Pe2LxImage();
 | 
|---|
| 36 | 
 | 
|---|
| 37 | virtual HRSRC findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
 | 
|---|
| 38 | virtual ULONG getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
 | 
|---|
| 39 | 
 | 
|---|
| 40 |         void  setVersionId(int id) { VersionId = id;   };
 | 
|---|
| 41 | 
 | 
|---|
| 42 | virtual ULONG getVersionSize();
 | 
|---|
| 43 | virtual BOOL  getVersionStruct(char *verstruct, ULONG bufLength);
 | 
|---|
| 44 | 
 | 
|---|
| 45 | protected:
 | 
|---|
| 46 |         int   getWin32ResourceId(int id);
 | 
|---|
| 47 |         int   convertNameId(char *lpszName);
 | 
|---|
| 48 | 
 | 
|---|
| 49 |         int   getVersionId()       { return VersionId; };
 | 
|---|
| 50 | 
 | 
|---|
| 51 |         int                   NameTableId;
 | 
|---|
| 52 |         int                   Win32TableId;
 | 
|---|
| 53 |         int                   VersionId;
 | 
|---|
| 54 | 
 | 
|---|
| 55 |         ULONG                *Win32Table;
 | 
|---|
| 56 |         NameId               *NameTable;
 | 
|---|
| 57 | 
 | 
|---|
| 58 | private:
 | 
|---|
| 59 | };
 | 
|---|
| 60 | 
 | 
|---|
| 61 | #endif //__WINIMAGEPE2LX_H__
 | 
|---|
| 62 | 
 | 
|---|