1 | /* $Id: winres.h,v 1.6 1999-08-19 19:51:18 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 resource class
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 | #ifndef __WINRES_H__
|
---|
13 | #define __WINRES_H__
|
---|
14 |
|
---|
15 | class Win32Image;
|
---|
16 |
|
---|
17 | //Use to distinguish between converted OS/2 resources in an image (pe2lx'ed) or
|
---|
18 | //resources that are loaded from the original win32 image (pe loader)
|
---|
19 | #define RSRC_PELOADER 0
|
---|
20 | #define RSRC_PE2LX 1
|
---|
21 |
|
---|
22 | class Win32Resource
|
---|
23 | {
|
---|
24 | public:
|
---|
25 | // Constructors and destructors
|
---|
26 | Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type);
|
---|
27 | Win32Resource(Win32Image *module, ULONG id, ULONG type,
|
---|
28 | ULONG size, char *resdata);
|
---|
29 | virtual ~Win32Resource();
|
---|
30 |
|
---|
31 | virtual PVOID lockResource(); //get original win32 resource
|
---|
32 | virtual PVOID lockOS2Resource(); //get converted OS/2 resource
|
---|
33 |
|
---|
34 | ULONG getSize() { return ressize; };
|
---|
35 |
|
---|
36 | ULONG getOS2Handle() { return OS2ResHandle; };
|
---|
37 | void setOS2Handle(ULONG handle) { OS2ResHandle = handle; };
|
---|
38 |
|
---|
39 | static void destroyAll(Win32Image *module);
|
---|
40 |
|
---|
41 | protected:
|
---|
42 |
|
---|
43 | private:
|
---|
44 | PVOID convertOS2Bitmap(void *bmpdata);
|
---|
45 |
|
---|
46 | PVOID convertResource(void *win32res);
|
---|
47 |
|
---|
48 | Win32Image *module;
|
---|
49 |
|
---|
50 | HRSRC hres;
|
---|
51 | ULONG type;
|
---|
52 | ULONG orgos2type;
|
---|
53 | ULONG id;
|
---|
54 |
|
---|
55 | PVOID os2resdata;
|
---|
56 | PVOID winresdata;
|
---|
57 |
|
---|
58 | ULONG OS2ResHandle;
|
---|
59 |
|
---|
60 | ULONG ressize;
|
---|
61 | int resType;
|
---|
62 |
|
---|
63 | // Linked list management
|
---|
64 | Win32Resource* next; // Next Resource in module
|
---|
65 |
|
---|
66 | friend class Win32Image;
|
---|
67 | };
|
---|
68 |
|
---|
69 |
|
---|
70 | #define NTRT_NEWRESOURCE 0x2000
|
---|
71 | #define NTRT_ERROR 0x7fff
|
---|
72 | #define NTRT_CURSOR 1
|
---|
73 | #define NTRT_BITMAP 2
|
---|
74 | #define NTRT_ICON 3
|
---|
75 | #define NTRT_MENU 4
|
---|
76 | #define NTRT_DIALOG 5
|
---|
77 | #define NTRT_STRING 6
|
---|
78 | #define NTRT_FONTDIR 7
|
---|
79 | #define NTRT_FONT 8
|
---|
80 | #define NTRT_ACCELERATORS 9
|
---|
81 | #define NTRT_RCDATA 10
|
---|
82 | #define NTRT_MESSAGETABLE 11
|
---|
83 | #define NTRT_GROUP_CURSOR 12
|
---|
84 | #define NTRT_GROUP_ICON 14
|
---|
85 | #define NTRT_VERSION 16
|
---|
86 | #define NTRT_NEWBITMAP (NTRT_BITMAP|NTRT_NEWRESOURCE)
|
---|
87 | #define NTRT_NEWMENU (NTRT_MENU|NTRT_NEWRESOURCE)
|
---|
88 | #define NTRT_NEWDIALOG (NTRT_DIALOG|NTRT_NEWRESOURCE)
|
---|
89 |
|
---|
90 |
|
---|
91 | #endif
|
---|