to serialize wrapped unmanaged types, use Unsafe.AsPointer() for conversion and handle memory allocation manually. Consider using StructLayout for precise control.
Unsafe.AsPointer()
StructLayout