Overriding a structure with an indirect definition

Started by Yuri, September 06, 2009, 01:20:22 PM

Previous topic - Next topic

Yuri

Hi Jeremy,

I encountered this error when using Edgar's headers. So that you don't have to look through them, I've extracted the relevant material. In this example, a GUID structure must be overridden differently, depending on whether UNICODE is defined.

GUID STRUCT
    Data1   dd
    Data2   dw
    Data3   dw
    Data4   db 8 DUP
ENDS

#define GUID_IID_IShellLinkA <0x000214EE,0,0,<0xC0,0,0,0,0,0,0,0x46>>
#define GUID_IID_IShellLinkW <0x000214F9,0,0,<0xC0,0,0,0,0,0,0,0x46>>

#ifdef UNICODE
    #define GUID_IID_IShellLink GUID_IID_IShellLinkW
#else
    #define GUID_IID_IShellLink GUID_IID_IShellLinkA
#endif


DATA SECTION

IId   GUID    GUID_IID_IShellLink


CODE SECTION

Start:
    xor eax,eax
    ret


This is the error message from GoAsm:
Quote
GoAsm.Exe Version 0.56.7 - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk

Error!
Line 20 of assembler source file (guid.asm):-
Unexpected material:-
<0x000214EE,0,0,<0xC0,0,0,0,0,0,0,0x46>>
Defined in Line 8 of assembler source file (guid.asm):
GUID_IID_IShellLinkA <0x000214EE,0,0,<0xC0,0,0,0,0,0,0,0x46>>

jorgon

Hi Yuri

Thanks for reporting this.

In order to achieve this, GoAsm needs to look one level deeper into the defines for initialisation information provided when the structure is used.

I can add this, and so I shall come back to you when this has been done.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

jorgon

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Yuri

Jeremy, thanks a lot for both improvements! I very much appreciate that! :U