annotate loader/pe_resource.c @ 33831:93a85875e6ae

configure: Drop obsolete addition of FF_API_MAX_STREAMS to CPPFLAGS.
author diego
date Mon, 25 Jul 2011 17:04:32 +0000
parents 0f1b5b68af32
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * PE (Portable Execute) File Resources
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 * Copyright 1995 Thomas Sandford
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 * Copyright 1996 Martin von Loewis
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 * Based on the Win16 resource handling code in loader/resource.c
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 * Copyright 1993 Robert J. Amstadt
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * Copyright 1995 Alexandre Julliard
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * Copyright 1997 Marcus Meissner
15166
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 7386
diff changeset
11 *
18783
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
12 * Modified for use with MPlayer, detailed changelog at
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
13 * http://svn.mplayerhq.hu/mplayer/trunk/
15166
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 7386
diff changeset
14 *
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 */
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
16 #include "config.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 #include <stdlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 #include <sys/types.h>
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
20 #include "wine/winestring.h"
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
21 #include "wine/windef.h"
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
22 #include "wine/pe_image.h"
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
23 #include "wine/module.h"
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
24 #include "wine/heap.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 //#include "task.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 //#include "process.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 //#include "stackframe.h"
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
28 #include "wine/debugtools.h"
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 1307
diff changeset
29 #include "ext.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 /**********************************************************************
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
32 * HMODULE32toPE_MODREF
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 * small helper function to get a PE_MODREF from a passed HMODULE32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 static PE_MODREF*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 HMODULE32toPE_MODREF(HMODULE hmod) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 WINE_MODREF *wm;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 wm = MODULE32_LookupHMODULE( hmod );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 if (!wm || wm->type!=MODULE32_PE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 return &(wm->binfmt.pe);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 * GetResDirEntryW
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 * Helper function - goes down one level of PE resource tree
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 LPCWSTR name,DWORD root,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 WIN_BOOL allowdefault)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 int entrynum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 PIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 int namelen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 if (HIWORD(name)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 if (name[0]=='#') {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 char buf[10];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 lstrcpynWtoA(buf,name+1,10);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 return GetResDirEntryW(resdirptr,(LPCWSTR)atoi(buf),root,allowdefault);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
68 (BYTE *) resdirptr +
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 namelen = lstrlenW(name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 for (entrynum = 0; entrynum < resdirptr->NumberOfNamedEntries; entrynum++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 PIMAGE_RESOURCE_DIR_STRING_U str =
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
74 (PIMAGE_RESOURCE_DIR_STRING_U) (root +
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 entryTable[entrynum].u1.s.NameOffset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 if(namelen != str->Length)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 continue;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 if(wcsnicmp(name,str->NameString,str->Length)==0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 return (PIMAGE_RESOURCE_DIRECTORY) (
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 root +
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 entryTable[entrynum].u2.s.OffsetToDirectory);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
86 (BYTE *) resdirptr +
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 sizeof(IMAGE_RESOURCE_DIRECTORY) +
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 resdirptr->NumberOfNamedEntries * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 for (entrynum = 0; entrynum < resdirptr->NumberOfIdEntries; entrynum++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 if ((DWORD)entryTable[entrynum].u1.Name == (DWORD)name)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 return (PIMAGE_RESOURCE_DIRECTORY) (
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 root +
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 entryTable[entrynum].u2.s.OffsetToDirectory);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 /* just use first entry if no default can be found */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 if (allowdefault && !name && resdirptr->NumberOfIdEntries)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 return (PIMAGE_RESOURCE_DIRECTORY) (
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 root +
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 entryTable[0].u2.s.OffsetToDirectory);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 * GetResDirEntryA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA( PIMAGE_RESOURCE_DIRECTORY resdirptr,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 LPCSTR name, DWORD root,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 WIN_BOOL allowdefault )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 PIMAGE_RESOURCE_DIRECTORY retv;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
111 LPWSTR nameW = HIWORD(name)? HEAP_strdupAtoW( GetProcessHeap(), 0, name )
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 : (LPWSTR)name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 retv = GetResDirEntryW( resdirptr, nameW, root, allowdefault );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 if ( HIWORD(name) ) HeapFree( GetProcessHeap(), 0, nameW );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 return retv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 * PE_FindResourceEx32W
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 HANDLE PE_FindResourceExW(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 WINE_MODREF *wm,LPCWSTR name,LPCWSTR type,WORD lang
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 PIMAGE_RESOURCE_DIRECTORY resdirptr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 DWORD root;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 HANDLE result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 PE_MODREF *pem = &(wm->binfmt.pe);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 resdirptr = pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 root = (DWORD) resdirptr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 if ((resdirptr = GetResDirEntryW(resdirptr, type, root, FALSE)) == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 if ((resdirptr = GetResDirEntryW(resdirptr, name, root, FALSE)) == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 result = (HANDLE)GetResDirEntryW(resdirptr, (LPCWSTR)(UINT)lang, root, FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 /* Try LANG_NEUTRAL, too */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 if(!result)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 return (HANDLE)GetResDirEntryW(resdirptr, (LPCWSTR)0, root, TRUE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 return result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 * PE_LoadResource32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 HANDLE PE_LoadResource( WINE_MODREF *wm, HANDLE hRsrc )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 if (!hRsrc || !wm || wm->type!=MODULE32_PE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 return (HANDLE) (wm->module + ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 * PE_SizeofResource32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 DWORD PE_SizeofResource( HINSTANCE hModule, HANDLE hRsrc )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 /* we don't need hModule */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 if (!hRsrc)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 * PE_EnumResourceTypes32A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 PE_EnumResourceTypesA(HMODULE hmod,ENUMRESTYPEPROCA lpfun,LONG lparam) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 WIN_BOOL ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
181 HANDLE heap = GetProcessHeap();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 LPSTR name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 if (et[i].u1.s.NameIsString)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 name = (LPSTR)(int)et[i].u1.Id;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 ret = lpfun(hmod,name,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 if (HIWORD(name))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 HeapFree(heap,0,name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 * PE_EnumResourceTypes32W
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 PE_EnumResourceTypesW(HMODULE hmod,ENUMRESTYPEPROCW lpfun,LONG lparam) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 WIN_BOOL ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 LPWSTR type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224 if (et[i].u1.s.NameIsString)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 type = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 type = (LPWSTR)(int)et[i].u1.Id;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 ret = lpfun(hmod,type,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 * PE_EnumResourceNames32A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 PE_EnumResourceNamesA(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 HMODULE hmod,LPCSTR type,ENUMRESNAMEPROCA lpfun,LONG lparam
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 WIN_BOOL ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
248 HANDLE heap = GetProcessHeap();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 LPWSTR typeW;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 if (HIWORD(type))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 typeW = HEAP_strdupAtoW(heap,0,type);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 typeW = (LPWSTR)type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 if (HIWORD(typeW))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 HeapFree(heap,0,typeW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 LPSTR name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 if (et[i].u1.s.NameIsString)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 name = (LPSTR)(int)et[i].u1.Id;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 ret = lpfun(hmod,type,name,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 if (HIWORD(name)) HeapFree(heap,0,name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 * PE_EnumResourceNames32W
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284 PE_EnumResourceNamesW(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 HMODULE hmod,LPCWSTR type,ENUMRESNAMEPROCW lpfun,LONG lparam
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291 WIN_BOOL ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 LPWSTR name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304 if (et[i].u1.s.NameIsString)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305 name = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307 name = (LPWSTR)(int)et[i].u1.Id;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 ret = lpfun(hmod,type,name,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316 * PE_EnumResourceNames32A
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 PE_EnumResourceLanguagesA(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 HMODULE hmod,LPCSTR name,LPCSTR type,ENUMRESLANGPROCA lpfun,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321 LONG lparam
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 WIN_BOOL ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 25849
diff changeset
328 HANDLE heap = GetProcessHeap();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 LPWSTR nameW,typeW;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335 if (HIWORD(name))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
336 nameW = HEAP_strdupAtoW(heap,0,name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 nameW = (LPWSTR)name;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 resdir = GetResDirEntryW(resdir,nameW,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340 if (HIWORD(nameW))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 HeapFree(heap,0,nameW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 if (HIWORD(type))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345 typeW = HEAP_strdupAtoW(heap,0,type);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 typeW = (LPWSTR)type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 if (HIWORD(typeW))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 HeapFree(heap,0,typeW);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 /* languages are just ids... I hopem */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364 /**********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 * PE_EnumResourceLanguages32W
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367 WIN_BOOL
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 PE_EnumResourceLanguagesW(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369 HMODULE hmod,LPCWSTR name,LPCWSTR type,ENUMRESLANGPROCW lpfun,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 LONG lparam
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 PIMAGE_RESOURCE_DIRECTORY resdir;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 PIMAGE_RESOURCE_DIRECTORY_ENTRY et;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 WIN_BOOL ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378 if (!pem || !pem->pe_resource)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 resdir = GetResDirEntryW(resdir,name,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386 if (!resdir)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 ret = FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391 ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392 if (!ret)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 }