annotate loader/pe_resource.c @ 19664:f6badf921e82

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