I don't think you need the ref in your first delegate signature, unless the native method uses a pointer to an array (double indirection).