Commit 423813e3 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

When enumerating resource, only use the lower 31 bit of the name as

the offset (for the highest bit is '1'). Should fix wine-net/257.
parent a4b80d44
...@@ -185,10 +185,10 @@ PE_EnumResourceTypesA(HMODULE hmod,ENUMRESTYPEPROCA lpfun,LONG lparam) { ...@@ -185,10 +185,10 @@ PE_EnumResourceTypesA(HMODULE hmod,ENUMRESTYPEPROCA lpfun,LONG lparam) {
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) { for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPSTR name; LPSTR name;
if (HIWORD(et[i].u1.Name)) if (et[i].u1.s.NameIsString)
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name)); name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
else else
name = (LPSTR)et[i].u1.Name; name = (LPSTR)(int)et[i].u1.Id;
ret = lpfun(hmod,name,lparam); ret = lpfun(hmod,name,lparam);
if (HIWORD(name)) if (HIWORD(name))
HeapFree(heap,0,name); HeapFree(heap,0,name);
...@@ -217,10 +217,10 @@ PE_EnumResourceTypesW(HMODULE hmod,ENUMRESTYPEPROCW lpfun,LONG lparam) { ...@@ -217,10 +217,10 @@ PE_EnumResourceTypesW(HMODULE hmod,ENUMRESTYPEPROCW lpfun,LONG lparam) {
ret = FALSE; ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) { for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR type; LPWSTR type;
if (HIWORD(et[i].u1.Name)) if (et[i].u1.s.NameIsString)
type = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name); type = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
else else
type = (LPWSTR)et[i].u1.Name; type = (LPWSTR)(int)et[i].u1.Id;
ret = lpfun(hmod,type,lparam); ret = lpfun(hmod,type,lparam);
if (!ret) if (!ret)
...@@ -261,10 +261,10 @@ PE_EnumResourceNamesA( ...@@ -261,10 +261,10 @@ PE_EnumResourceNamesA(
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) { for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPSTR name; LPSTR name;
if (HIWORD(et[i].u1.Name)) if (et[i].u1.s.NameIsString)
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name)); name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
else else
name = (LPSTR)et[i].u1.Name; name = (LPSTR)(int)et[i].u1.Id;
ret = lpfun(hmod,type,name,lparam); ret = lpfun(hmod,type,name,lparam);
if (HIWORD(name)) HeapFree(heap,0,name); if (HIWORD(name)) HeapFree(heap,0,name);
if (!ret) if (!ret)
...@@ -297,10 +297,10 @@ PE_EnumResourceNamesW( ...@@ -297,10 +297,10 @@ PE_EnumResourceNamesW(
ret = FALSE; ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) { for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR name; LPWSTR name;
if (HIWORD(et[i].u1.Name)) if (et[i].u1.s.NameIsString)
name = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name); name = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
else else
name = (LPWSTR)et[i].u1.Name; name = (LPWSTR)(int)et[i].u1.Id;
ret = lpfun(hmod,type,name,lparam); ret = lpfun(hmod,type,name,lparam);
if (!ret) if (!ret)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment