The problem arises if I use generic names for nested structures, for example, HDITEM rather than directly HDITEMA or HDITEMW. To illustrate this, I have composed a simple example:
SampleA STRUCT
a DD
b DD
ENDS
#ifndef UNICODE
#define Sample SampleA
#endif
MyStruct1 STRUCT
c Sample
d DD
e DD
ENDS
MyStruct2 STRUCT
c SampleA
d DD
e DD
ENDS
; ==============================================================================
DATA SECTION
example1 MyStruct1
example2 MyStruct2
buf DB 100 DUP 0
; ==============================================================================
CODE SECTION
Start:
invoke msvcrt.dll:sprintf, addr buf, <"example1 size: %d",13,10,"example2 size: %d",0>, \
sizeof example1, sizeof example2
add esp,16
invoke user32.dll:MessageBoxA, 0, addr buf, "Test", 0
ret
Here's what it reports to me:
Quote
---------------------------
Test
---------------------------
example1 size: 8
example2 size: 16
---------------------------
ОК
---------------------------
The sizes are different, though Sample was defined to be the same as SampleA.
Hi Yuri
Thanks for paring down this bug making it easier to chase up.
I'm working on this and will come back to you.
Yuri
I've added this functionality in GoAsm Version 0.56.6e which can be obtained from this thread (http://www.masm32.com/board/index.php?topic=11895.0) to which you have contributed.
Thank you for the quick help, Jeremy! Now everything is OK. :)