Patrik Stridvall ps@leissner.se writes:
Does the Windows API really define exactly what a handle is?
typedef void* HANDLE seems pretty clear to me.
However your suggestion that any Winelib application that cares whether they are 32-bit or 64-bit are broken is a far too strict IMHO and I see no reason to require porters to fix such things.
An application that assumes that everything is 32-bit is broken, yes. I don't see why handles are any different than other types; if anything they should be less of a problem since they are supposed to be opaque, so their size should not matter for the application.
Of course most handles will fit in 32-bit, so we will still support apps that do invalid casts and truncate the handles; but this doesn't mean it is correct behavior, or that apps that do this should be able to compile without warnings.
So therefor I suggest that we should do the following TRACE("(%p)", (LPVOID) handle);
You must be joking. I said I didn't want any typecast, and here you suggest to have one on every single debugging output. Let me repeat it once more just in case: *NO* *TYPECASTS*.
The whole point of STRICT and pointer handles is to be able to use compiler type checks, and this is only possible without typecasts. Not to mention that your solution will probably still get a warning like "converting integer to pointer of different size" on a 64-bit platform.