How can I ignore a field when marshalling a structure with P/Invoke
There's no way to make the CLR ignore a field. I would instead use two structures, and perhaps make one a member of the other.
struct MyNativeStructure
{
public int foo;
public int bar;
}
struct MyStructure
{
public MyNativeStruct native;
public int ignored;
}