News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Conditional assembly problem

Started by donkey, March 28, 2009, 07:10:40 PM

Previous topic - Next topic

donkey

Hi Jeremy,

I am having trouble with the exact syntax to get this structure working under the new headers OS ID scheme...

// just to have a value we'll set GUID to a DWORD
#DEFINE HANDLE DD
#DEFINE GUID DD

#define NTDDI_WIN9X                         0x03000000
#define NTDDI_WINNT4                        0x04000000
#define NTDDI_WIN2K                         0x05000000
#define NTDDI_WINXP                         0x05010000
#define NTDDI_VISTA                         0x06000000
WINVER = NTDDI_VISTA

XNOTIFYICONDATAA STRUCT
cbSize DD
hWnd HANDLE
uID DD
uFlags DD
uCallbackMessage DD
hIcon HANDLE
#IF WINVER < NTDDI_WIN2K
szTip DB 64 DUP
#ENDIF

#IF WINVER >= NTDDI_WINN2K
szTip DB 128 DUP
dwState DD
dwStateMask DD
szInfo DB 256 DUP
UNION
uTimeout DD
uVersion DD
ENDUNION
szInfoTitle DB 64 DUP
dwInfoFlags DD
#ENDIF

#IF WINVER >= NTDDI_WINNXP
guidItem GUID
#ENDIF

#IF WINVER >= NTDDI_VISTA
hBalloonIcon HANDLE
#ENDIF
ENDS


When (as above) NTDDI_VISTA is defined the member hBalloonIcon should be available however everything past the first #IF is ignored or at least seems to be. Changing the WINVER to WIN2K or above will not display szTip.

Using WINVER = NTDDI_WIN2K
Inappropriate or missing operand to the mnemonic
mov eax,XNOTIFYICONDATAA.szTip


EDIT:

It appears to be the >= operator that is causing the problem, using simple > seems to work...

#define NTDDI_WS03MAX 0x0502FFFF
#define NTDDI_WIN2KMAX                      0x0500FFFF

XNOTIFYICONDATAA STRUCT
cbSize DD
hWnd HANDLE
uID DD
uFlags DD
uCallbackMessage DD
hIcon HANDLE
#IF WINVER < NTDDI_WIN2K
szTip DB 64 DUP
#ENDIF

#IF WINVER > NTDDI_WINNT4
szTip DB 128 DUP
dwState DD
dwStateMask DD
szInfo DB 256 DUP
UNION
uTimeout DD
uVersion DD
ENDUNION
szInfoTitle DB 64 DUP
dwInfoFlags DD
#ENDIF

#IF WINVER > NTDDI_WIN2KMAX
guidItem GUID
#ENDIF

#IF WINVER > NTDDI_WS03MAX
hBalloonIcon HANDLE
#ENDIF
ENDS


Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Edgar

When declaring this structure I got the message:-
QuoteCould not evaluate expression in conditional directive:-
NTDDI_WINN2K
The expression has two N's instead of one, which may be your problem.

I see that you get a much less informative error message.
This seems to be because you are not actually declaring the structure but merely using it to establish an offset from one place to another.
I'll look into whether I can improve on this error message and come back to you.


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

donkey

Thanks Jeremy,

Don't know how many times I looked at that and didn't see the 2 double N's. All is good !
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

I've improved the error messages when conditional assembly goes wrong inside structs when not declaring the struct, but merely using it to find the distance from one place to another, in GoAsm Version 0.56.5e (attached).


[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)