News:

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

Headers V2.0 alpha

Started by donkey, March 22, 2009, 02:48:30 AM

Previous topic - Next topic

ToutEnMasm


Some words of my experience of the problem.

There is litlle differences between the header's of the sdk XP and the sdk Vista , the structure NOTIFYICONDATAA is just a sample of this little differences.
That i have tested is compiled a program (XP) with the sdk vista and then the sdk XP.
The SDK VISTA don't work for XP,it is strange but it is like that.Without compilation errors a certain numbers of controls don't work's.
Here is the two forms of the structure

XP
Quote
NOTIFYICONDATAA   STRUCT
   cbSize DWORD ?
   hWnd DWORD ?
   uID DWORD ?
   uFlags DWORD ?
   uCallbackMessage DWORD ?
   hIcon DWORD ?
IF COMPARE(_WIN32_IE,LT,00500h)
   szTip BYTE 64 dup (?)
   ELSE
   szTip BYTE 128 dup (?)
ENDIF
IF COMPARE(_WIN32_IE,GE,00500h)
   dwState DWORD ?
   dwStateMask DWORD ?
   szInfo BYTE 256 dup (?)
   union   DUMMYUNIONNAME
   uTimeout DWORD ?
   uVersion DWORD ?
   ENDS
   szInfoTitle BYTE 64 dup (?)
   dwInfoFlags DWORD ?
ENDIF
IF COMPARE(_WIN32_IE,GE,0600h)
   guidItem GUID <>
ENDIF
NOTIFYICONDATAA      ENDS

Vista
Quote
NOTIFYICONDATAA   STRUCT
   cbSize DWORD ?
   hWnd DWORD ?
   uID DWORD ?
   uFlags DWORD ?
   uCallbackMessage DWORD ?
   hIcon DWORD ?
IF COMPARE (NTDDI_VERSION,LT,NTDDI_WIN2K)
   szTip BYTE 64 dup (?)
ENDIF
IF COMPARE (NTDDI_VERSION,GE,NTDDI_WIN2K)
   szTip BYTE 128 dup (?)
   dwState DWORD ?
   dwStateMask DWORD ?
   szInfo BYTE 256 dup (?)
   union   DUMMYUNIONNAME
   uTimeout DWORD ?
   uVersion DWORD ? ; used with NIM_SETVERSION, values 0, 3 and 4
   ENDS
   szInfoTitle BYTE 64 dup (?)
   dwInfoFlags DWORD ?
ENDIF
IF COMPARE (NTDDI_VERSION,GE,NTDDI_WINXP)
   guidItem GUID <>
ENDIF
IF COMPARE (NTDDI_VERSION,GE,NTDDI_VISTA)
   hBalloonIcon DWORD ?
ENDIF
NOTIFYICONDATAA      ENDS

What answer To give I don't know



donkey

Hi BlackVortex,

Yeah that one was a bit much, but I am currently working on the beta release of Headers2.0 and it will manage structures like that much easier to define than in the alpha version. I have decided to go with the NTDDI defines to determine Windows version, which was the reason I originally planned on dropping NT4 and 9X support (no NTDDI equates for those) but I have decided to add a few...

#define NTDDI_WINCE 0x02000000
#define NTDDI_WIN9X  0x03000000
#define NTDDI_WINNT4 0x04000000

That way I can continue to support the OS versions but have a standard ID scheme, the Microsoft headers are all over the place using 3 or 4 different OS id schemes sometimes in the same file. It was getting a bit discouraging to try to figure it all out. Replacing the whole lot with one standard scheme seems to make life easier. It also allows for a quantitative check (ie >=) so no more complex #IFNDEF blocks, the only caveat is that checks have to be done from highest to lowest because of the way GoAsm processes equates. No allowance for IE versions will be made unless it is greater than 6 and there is a structure size member, otherwise all members will be included without switching.

I am targeting the beta release for Tuesday but it may be sooner than that (depending on the weather).

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

donkey

#17
The final alpha (hopefully) has been uploaded, unfortunately I found the conditional assembly bug after the upload so the conditional assemblies have a problem but I hope that it gets fixed fairly soon so the project can continue without my having to rewrite each of those structures. At any rate it should only affect a very small amount of code so I am leaving them as is for now. All files have now been completed and the change over to WINVER = NTDDI_xxx is complete.
"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

donkey

Headers 2.0 is now in Beta release, it has replaced the main headers file at the website, the link in this thread is no longer valid. I finished SHObj.h ahead of schedule, we had quite a bit of snow here ruining my plans for the day. I have tested the headers as best I can in 32 bit mode with some applications I have. Here are some notes:

You should always set the target Windows platform, the headers will default to Windows XP SP0 if none is set. The definitions for versions is found in windef.h

example : WINVER = NTDDI_WIN2K

The Windows version must be set before windows.h or any header file is included.

Win32 is default, to switch all structures and definitions to 64 bit define the WIN64 switch:

#DEFINE WIN64

WIN64 must be set before windows.h or any header file is included.

Many structures have been updated to include resizing based on the Windows version, if you do not specify a version number your application may fail on some OS versions due to the cbSize member. Specifying a version number too low will result in any members for higher versions being unavailable and will throw an error if referenced.

Attempting to use WIN64 with an OS version that does not have 64 bit support will show a warning message, for example using NTDDI_WIN9X with WIN64.

GoAsm.Exe Version 0.56.5c or greater is required
GoLink.Exe Version 0.26.10 beta3 or greater is required

Edgar

EDIT:

One small change to windef.h, I had been working under the assumption that I could chain typedefs, that is not working properly. The following change has to be made

replace the typedefs for LPARAM and WPARAM with the following:

#IFDEF WIN64
#DEFINE LPARAM DQ
#DEFINE WPARAM DQ
#ELSE
#DEFINE LPARAM DD
#DEFINE WPARAM DD
#ENDIF
"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