public static dsn_app_info[] CopyAppInfoArrayToManaged(IntPtr ptr, int size) { var ss = new List <dsn_app_info>(); for (var i = 0; i < size; i++) { var obj = new dsn_app_info(); Marshal.PtrToStructure(ptr, obj); ss.Add(obj); // TODO: marshalled size of(dsn_app_info) ptr += (int)(IntPtr.Size + sizeof(int) + 2 * DSN_MAX_APP_TYPE_NAME_LENGTH); } return(ss.ToArray()); }
public static dsn_app_info[] CopyAppInfoArrayToManaged(IntPtr ptr, int size) { var ss = new List<dsn_app_info>(); for (int i = 0; i < size; i++) { var obj = new dsn_app_info(); Marshal.PtrToStructure(ptr, obj); ss.Add(obj); // TODO: marshalled size of(dsn_app_info) ptr += (int)(IntPtr.Size + sizeof(int) + 2 * DSN_MAX_APP_TYPE_NAME_LENGTH); } return ss.ToArray(); }