public void ProcessStruct(object theStruct)
{
foreach (FieldInfo fi in theStruct.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
{
if (fi.FieldType.IsPointer && IsNullTermArray(fi))
{
//Has the custom attribute, commence processing of
//IntPtr* pointing to null-terminated array
ProcessIntPtr(fi.GetValue(theStruct));
}
else{/*..Other Processing..*/ }
}
}
public void unsafe ProcessIntPtr(IntPtr* ptr)
{
//Iterate over the array and process the elements
//There are pointer operations here.
}