Hi,
I have a 32-bit .NET assembly which PInvokes into the C layer. I want to port this assembly to 64-bit. I have read many documents related to porting to 64-bit, all of which seems to suggest that we need to take care of the alignment if we are to use structures.
I had a general question related to structure alignment and wanted to clarify that first so that I dont miss anything.
Suppose I have a C entry point which accepts a struct pointer and basically fills up the values inside. This C code does not have any packing directives and I have all the .NET structs aligned to pack=8. So if I pass a structure with adjacent ints, I thought it could be a problem interpreting the data populated in the .NET layer, as the C by default would use pack=4 and we are interpreting the struct as pack=8 in .NET layer, so thought it could cause a problem. But it doesn't seem to be the case. The data seems to be interpreted fine.
Can anyone explain this behavior?
Thanks, Niranjan