I'm trying to call NtGetContextThread from C# on AMD64. The problem is that the CONTEXT structure for AMD64 needs to be aligned on a 16-byte boundary, and when I call NtGetContextThread I always get STATUS_DATATYPE_MISALIGNMENT
. I'm aware that C# can align individual members of a struct using the Pack attribute, but it doesn't seem to be able to align the entire structure. Is there any way I could do this?
EDIT: Just to make it clear, I don't want to align individual members. I want to align the entire structure.