Reputation: 4587
I'm porting an old 32-bit COM server to 64-bit architecture.
Many functions take buffer addresses and offsets as parameters, as __int3264 and __int3264 pointers. The problem is that this type is not automatically generated as __int64 in x64 since the interfaces are IDispatch-inherited, and __int3264 is not supported with automation interfaces!
For functions expecting addresses I'll replace __int3264* to void*.
Offset parameters were put as __int3264 and LONG (both 32-bit in automation+x64). I cannot use hyper (mapped as __int64) since it will break in 32-bit systems.
Should I use void* for all offset/address parameters or there is another way to port those to x64 COM server?
Upvotes: 1
Views: 228
Reputation: 16142
void * is only allowed in [local] interfaces - it can't be marshalled (there's no way of knowing the size or semantics of a void pointer).
If you want a polymorphic type, use __int3264. You're right that it can't be used with automation because automation doesn't support polymorphic types.
Why not just use a __int64 and put the 32bit value in the __int64 value?
Upvotes: 2