News:

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

Headers update

Started by donkey, January 17, 2010, 06:48:35 AM

Previous topic - Next topic

donkey

Hi all,

I've uploaded a minor change to the headers, I have still not integrated the Win7 headers to the main ones as I have less time than I expected to work on them and they are extensive. The upload consists of the minor edits I have made over the last few months. These are generally corrections or type definitions that allow for more seamless switching between Win64 and Win32 versions. Also this thread by Tapejara demonstrated an error in Windef.h that has been corrected, the TCHAR and TBYTE types were not being changed to WORDs when STRINGS UNICODE was defined or when a Unicode encoded file was assembled. The version has been incremented to GOASMHDRVER = 0x020012, no major additions were made to the project for this release.

Note that if you wish to distribute your source code and are using TCHAR or TBYTE you will want to ensure the proper version of the headers is used with the following conditional compilation:

#IF GOASMHDRVER < 0x020012
GOASM_ECHO This program requires headers version 2.00.12 or greater
GOASM_EXIT
#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

BlackVortex

You are my favourite donkey ! Thanks for your work !   :cheekygreen:

donkey

I have uploaded an interim version of the headers (0x020013). It contains some corrections as well as some new definitions, (about 1000 or so) as well as about 50 new interface definitions. I have added a couple of header files that might be of use right away with Windows 7, the main one is the KnownFolders header file. Progress is slow with the headers because I am going over them definition by definition and making corrections as well as adding definitions that were omitted previously, this has turned out to be a very large task. The project will require the addition of nearly 100 new headers and somewhere around 10,000 new definitions when all is said and done. There are no changes or additions that will break current code.

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

New upload with several new headers for Win7 as well as a few updated files, here's a synopsis:

Quotewindef.h // new types added

AdjustStack macro added, provides 32/64 bit cross compilation fix for c calls

Headers updated to Win7

accctrl.h // updated
aclapi.h // updated
aclui.h // updated
ahadmin.h // updated
ActivScp.h // new
commctrl.h // updated
ObjectArray.h // new
KnownFolders.h // new
propidl.h // new
propsys.h // new
propkey.h // new - format for property keys #DEFINE PKEY_name <FMTID GUID, pid> - PROPKEY struct will decode
structuredquerycondition.h // new
oaidl.h // updated
winuser.h // updated - Added CreateWindow support macro (no push/push/call support, only invoke)
wingdi.h // updated
wincrypt.h // updated
winerror.h // partially updated
winnt.h // updated
exdisp // updated
pidl.h // undocumented header - new
shlobj.h // updated

Since the core files have been completed, winuser, shobj, comctrl and winnt and wingdi, I have versioned this release as headers 2.1 (GOASMHDRVER = 0x021000)

An important change for shlobj.h as well as shobjidl.h is that all guid definitions have been moved to the shlguid.h header, this allows you to use the shell definitions without overloading the symbol table with guids. It really doesn't seem to make that much difference as GoAsm is more than adequate to handle them but I thought it might be a good idea.

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

BlackVortex

I had to manually define WINVER with the last update. I use :

#DEFINE WINVER NTDDI_WIN7ALL
#include windows.h


Was that change intended ?

donkey

Hi BlackVortex,

No, this change was not intended, I will look into it. There was a change to set the versions of common controls and shell based on the WINVER flag but it should not have had the effect you mentioned. My tests seemed to bear this out but I will do further testing and get back to you.

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

Hi BlackVortex,

There was a dependency that I had missed in the winnt.h file that was causing it to fail if WINVER was not defined before Windows.h was loaded. This was a problem with the dependency chain, not winnt.h and was entirely due to my trying to tidy up the file a bit before I uploaded. I moved one line and retested but not as extensively as I should have. The problem has been fixed and a new upload is available, GOASMHDRVER = 0x021001.

Thanks for pointing it out, since I always specify OS version explicitly I might have gone some time before I found that one. If you do not want to download the whole project, the problem was in Windows.h and I have attached it here. Just replace Windows.h in version 0x021000 with this one.

I should explain how COMMCTRLVER and SHELLVER default definitions have changed, it is a rather important change. The versions are now set based on the value of the WINVER flag, the common controls and shell versions are set to the version number distributed with the Windows version specified. This is preferable to just setting them to the highest available version by default as it will automatically truncate structures to the size expected by whatever Windows version you supply and will limit the availability of certain ordinals to that version as well. This behavior can be overridden by specifying a value for the versions before including windows.h.

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

BlackVortex

Now it's back to normal. What is the default value for WINVER if I don't define it ?

donkey

Quote from: BlackVortex on February 05, 2010, 03:26:52 PM
Now it's back to normal. What is the default value for WINVER if I don't define it ?

NTDDI_WINXP
"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

I have uploaded version 0x021004 to my website, it contains the fix described in the following thread to allow for an alternate syntax for COM calls:

http://www.masm32.com/board/index.php?topic=13308.0

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

I have uploaded version 0x021005 to the website, it contains a number of additions to various header files as well as some corrections. This version marks the debut of the FILTERAPI switch that Yuri demonstrated the need for. API filtering will block the assembly of certain API calls based on the Windows version or DLL version supplied, for example if you specify WINVER = NTDDI_WIN2K all functions that do not natively ship with Win2K will report as follows:

QuoteThe following symbols were not defined in the object file or files:-
SomeApiFunction_NotAvailable

One notable exception to this is GDI+ which can be redistributed as far as Win98 so version 1.0 though not natively available below XP will be allowed. To override this behavior for a particular DLL and still use the API filtering you can explicitly set the required version of the DLL. For example to set common controls to version 6.1 (it will default to 5.82 even on Win7):

#DEFINE COMMCTRLVER WIN32_COMMCTRL_610

The predefined version constants are found in windef.h.

In order to distinguish between an API that doesn't exist and one that is not available to the windows version you specify _NotAvailable is appended to the API name.

I have not completed user32.dll or kernel32.dll yet, that may take some time as I am getting ready for a small trip on Tuesday but I will get to them when I return. I would really appreciate other contributions to this portion of the project as the more filtering that can be added the more effective WINVER will be, so if you'd like to pick a small DLL to write the filters for just check the API_Filter.h file to see how to do it.

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

Yuri

Edgar, my COM DLL exports a function called DllInstall. Now it's changed to DllInstall_NotAvailable. Maybe it'd be better to exclude it from version checking?

Quote
GoAsm.Exe Version 0.56.8 - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk

Error!
Line 185 of assembler source file (main.asm):-
Unknown mnemonic, instruction, redefinition or directive:-
DllInstall_NotAvailable
Defined in Line 27 of the include file API_Filter.h:
DllInstall  DllInstall_NotAvailable

Quote from: Platform SDK
This function may be implemented and exported by name by a DLL for use during application installation or setup. It is invoked by regsvr32 to allow the DLL to perform tasks such as adding information to the registry.

DllInstall is used only for application installation and setup. It should not be called by an application. It is similar in purpose to DllRegisterServer or DllUnregisterServer. Unlike these functions, DllInstall takes an input string which can be used to specify a variety of different actions. This allows a DLL to be installed in more than one way, based on any criteria that is appropriate.

donkey

Hi Yuri,

Darn, I was going to do that and thought I did, too many things between my main project, GDI+ tests and the headers, I have fixed it and uploaded again. Version has been incremented to 0x021006.

Thanks

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

Yuri

Edgar, GUID_IID_IDispatch remains undefined. First because the corresponding block is commented out in oaidl.h, and second, it should be placed outside of #IFNDEF IDISPATCH_DEFINED ... #ENDIF.

donkey

Thanks Yuri,

I will update it in the next release, it will just be an uncommenting of the def in oaidl.h and moving the guid definition:

#IFNDEF GUID_IID_IDispatch
#define GUID_IID_IDispatch <0x00020400,0x0000,0x0000,<0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46>>
#ENDIF

#IFNDEF IDISPATCH_DEFINED
#IFNDEF IDispatch
IDispatch STRUCT
UNION
struct
QueryInterface PTR
AddRef PTR
Release PTR
ends
IUnknown Unknown
ENDUNION
GetTypeInfoCount PTR
GetTypeInfo PTR
GetIDsOfNames PTR
Invoke PTR
ENDS
#ENDIF
#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