Use DUMMYxxxNAME for anonymous struct/unions.
This commit is contained in:
parent
6c97e45546
commit
da0acca7d8
|
@ -79,7 +79,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
|
|||
{
|
||||
pos = (min + max) / 2;
|
||||
if (entry[pos].u1.Id == id)
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
if (entry[pos].u1.Id > id) max = pos - 1;
|
||||
else min = pos + 1;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
|
|||
{
|
||||
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
||||
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s2.OffsetToDirectory);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -448,7 +448,7 @@ static HRESULT ICO_ExtractIconExW(
|
|||
const IMAGE_RESOURCE_DIRECTORY *resdir;
|
||||
|
||||
/* go down this resource entry, name */
|
||||
resdir = (PIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s.OffsetToDirectory));
|
||||
resdir = (PIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s2.OffsetToDirectory));
|
||||
|
||||
/* default language (0) */
|
||||
resdir = find_entry_default(resdir,rootresdir);
|
||||
|
|
|
@ -42,7 +42,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
|
|||
{
|
||||
pos = (min + max) / 2;
|
||||
if (entry[pos].u1.Id == id)
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
if (entry[pos].u1.Id > id) max = pos - 1;
|
||||
else min = pos + 1;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
|
|||
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
||||
|
||||
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s2.OffsetToDirectory);
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,11 +96,11 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_
|
|||
while (min <= max)
|
||||
{
|
||||
pos = (min + max) / 2;
|
||||
str = (IMAGE_RESOURCE_DIR_STRING_U *)((char *)root + entry[pos].u1.s.NameOffset);
|
||||
str = (IMAGE_RESOURCE_DIR_STRING_U *)((char *)root + entry[pos].u1.s1.NameOffset);
|
||||
res = strncmpiW( nameW, str->NameString, str->Length );
|
||||
if (!res && namelen == str->Length)
|
||||
{
|
||||
ret = (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s.OffsetToDirectory);
|
||||
ret = (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
break;
|
||||
}
|
||||
if (res < 0) max = pos - 1;
|
||||
|
|
|
@ -1638,11 +1638,11 @@ typedef struct tagODBC_VS_ARGS {
|
|||
union {
|
||||
WCHAR *wszArg;
|
||||
CHAR *szArg;
|
||||
}u1;
|
||||
} DUMMYUNIONNAME1;
|
||||
union {
|
||||
WCHAR *wszCorrelation;
|
||||
CHAR *szCorrelation;
|
||||
}u2;
|
||||
} DUMMYUNIONNAME2;
|
||||
RETCODE RetCode;
|
||||
} ODBC_VS_ARGS, *PODBC_VS_ARGS;
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ typedef struct
|
|||
LPVOID lpFirstBlock;
|
||||
LPVOID lpLastBlock;
|
||||
} Region;
|
||||
} Foo;
|
||||
} DUMMYUNIONNAME;
|
||||
} PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
|
||||
|
||||
#define PROCESS_HEAP_REGION 0x0001
|
||||
|
|
|
@ -2196,17 +2196,17 @@ typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
|
|||
struct {
|
||||
unsigned NameOffset:31;
|
||||
unsigned NameIsString:1;
|
||||
} s;
|
||||
} DUMMYSTRUCTNAME1;
|
||||
DWORD Name;
|
||||
WORD Id;
|
||||
} u1;
|
||||
} DUMMYUNIONNAME1;
|
||||
union {
|
||||
DWORD OffsetToData;
|
||||
struct {
|
||||
unsigned OffsetToDirectory:31;
|
||||
unsigned DataIsDirectory:1;
|
||||
} s;
|
||||
} u2;
|
||||
} DUMMYSTRUCTNAME2;
|
||||
} DUMMYUNIONNAME2;
|
||||
} IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
|
||||
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ static void fixup_resources( IMAGE_RESOURCE_DIRECTORY *dir, char *root, void *ba
|
|||
entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
||||
for (i = 0; i < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; i++, entry++)
|
||||
{
|
||||
void *ptr = root + entry->u2.s.OffsetToDirectory;
|
||||
if (entry->u2.s.DataIsDirectory) fixup_resources( ptr, root, base );
|
||||
void *ptr = root + entry->u2.s2.OffsetToDirectory;
|
||||
if (entry->u2.s2.DataIsDirectory) fixup_resources( ptr, root, base );
|
||||
else
|
||||
{
|
||||
IMAGE_RESOURCE_DATA_ENTRY *data = ptr;
|
||||
|
|
|
@ -70,7 +70,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
|
|||
{
|
||||
pos = (min + max) / 2;
|
||||
if (entry[pos].u1.Id == id)
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
if (entry[pos].u1.Id > id) max = pos - 1;
|
||||
else min = pos + 1;
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_nameW( const IMAGE_RESOURCE
|
|||
while (min <= max)
|
||||
{
|
||||
pos = (min + max) / 2;
|
||||
str = (IMAGE_RESOURCE_DIR_STRING_U *)((char *)root + entry[pos].u1.s.NameOffset);
|
||||
str = (IMAGE_RESOURCE_DIR_STRING_U *)((char *)root + entry[pos].u1.s1.NameOffset);
|
||||
res = strncmpiW( name, str->NameString, str->Length );
|
||||
if (!res && namelen == str->Length)
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].u2.s2.OffsetToDirectory);
|
||||
if (res < 0) max = pos - 1;
|
||||
else min = pos + 1;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
|
|||
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
||||
|
||||
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s.OffsetToDirectory);
|
||||
return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry->u2.s2.OffsetToDirectory);
|
||||
}
|
||||
|
||||
|
||||
|
@ -288,9 +288,9 @@ BOOL WINAPI EnumResourceTypesA( HMODULE hmod, ENUMRESTYPEPROCA lpfun, LONG lpara
|
|||
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
||||
LPSTR type;
|
||||
|
||||
if (et[i].u1.s.NameIsString)
|
||||
if (et[i].u1.s1.NameIsString)
|
||||
{
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s.NameOffset);
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s1.NameOffset);
|
||||
DWORD len = WideCharToMultiByte( CP_ACP, 0, pResString->NameString, pResString->Length,
|
||||
NULL, 0, NULL, NULL);
|
||||
if (!(type = HeapAlloc(GetProcessHeap(), 0, len + 1)))
|
||||
|
@ -330,9 +330,9 @@ BOOL WINAPI EnumResourceTypesW( HMODULE hmod, ENUMRESTYPEPROCW lpfun, LONG lpara
|
|||
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
||||
LPWSTR type;
|
||||
|
||||
if (et[i].u1.s.NameIsString)
|
||||
if (et[i].u1.s1.NameIsString)
|
||||
{
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s.NameOffset);
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s1.NameOffset);
|
||||
if (!(type = HeapAlloc(GetProcessHeap(), 0, (pResString->Length+1) * sizeof (WCHAR))))
|
||||
return FALSE;
|
||||
memcpy(type, pResString->NameString, pResString->Length * sizeof (WCHAR));
|
||||
|
@ -372,9 +372,9 @@ BOOL WINAPI EnumResourceNamesA( HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfu
|
|||
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
||||
LPSTR name;
|
||||
|
||||
if (et[i].u1.s.NameIsString)
|
||||
if (et[i].u1.s1.NameIsString)
|
||||
{
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s.NameOffset);
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s1.NameOffset);
|
||||
DWORD len = WideCharToMultiByte(CP_ACP, 0, pResString->NameString, pResString->Length,
|
||||
NULL, 0, NULL, NULL);
|
||||
if (!(name = HeapAlloc(GetProcessHeap(), 0, len + 1 )))
|
||||
|
@ -417,9 +417,9 @@ BOOL WINAPI EnumResourceNamesW( HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpf
|
|||
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
||||
LPWSTR name;
|
||||
|
||||
if (et[i].u1.s.NameIsString)
|
||||
if (et[i].u1.s1.NameIsString)
|
||||
{
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s.NameOffset);
|
||||
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s1.NameOffset);
|
||||
if (!(name = HeapAlloc(GetProcessHeap(), 0, (pResString->Length + 1) * sizeof (WCHAR))))
|
||||
return FALSE;
|
||||
memcpy(name, pResString->NameString, pResString->Length * sizeof (WCHAR));
|
||||
|
|
|
@ -1543,12 +1543,12 @@ BOOL WINAPI HeapWalk(
|
|||
if (ptr == (char *)(currentheap + currentheap->headerSize))
|
||||
{
|
||||
entry->wFlags |= PROCESS_HEAP_REGION;
|
||||
entry->Foo.Region.dwCommittedSize = currentheap->commitSize;
|
||||
entry->Foo.Region.dwUnCommittedSize =
|
||||
entry->u.Region.dwCommittedSize = currentheap->commitSize;
|
||||
entry->u.Region.dwUnCommittedSize =
|
||||
currentheap->size - currentheap->commitSize;
|
||||
entry->Foo.Region.lpFirstBlock = /* first valid block */
|
||||
entry->u.Region.lpFirstBlock = /* first valid block */
|
||||
currentheap + currentheap->headerSize;
|
||||
entry->Foo.Region.lpLastBlock = /* first invalid block */
|
||||
entry->u.Region.lpLastBlock = /* first invalid block */
|
||||
currentheap + currentheap->size;
|
||||
}
|
||||
ret = TRUE;
|
||||
|
|
Loading…
Reference in New Issue