My question is about handles in the 64-bit Windows architecture: Can they be values larger than 2^32?
Handles in Visual Studio C/C++ are defined as pointers (64-bit): typedef void *HANDLE;
I read that at least some handles in 64-bit have only the lower 32 bits significant (https://msdn.microsoft.com/nl-nl/library/windows/desktop/aa384203(v=vs.85).aspx). But does that apply to ALL handles?
Second question is whether pointers to structs can be regarded as handles. Would it be safe to cast those to 32-bit integer?
Some background: I am porting a complex application to 64-bit and have to deal with in/out parameters that I would very much like to keep 32-bit integers. But they are sometimes (mis)used to transport handles and an occasional struct pointer too. I know that it would be better to separate them in different functions, but that would be very hard to do.