How to turn game data into IntPtr?

I’ve been using the Steamworks.NET package and I’ve been successfully implementing a bunch of the interfaces on my own, however I got stuck on this method that requires IntPtr to send data on the network

I got the whole function working, but can’t wrap my head around IntPtr pubData, which is the data to send, and uint cubData, which is the size of the data. As I understand IntPtr is simply a pointer, so when I send messages they arrive correctly but I’m sending the memory address of the data, not the data itself.

EDIT:
Nevermind, figured it out. Used Structures and Marshal.StructureToPtr() and it worked.

If you want the native side to modify it, you can also do this:

Pinning a texture for manipulation via native code:

https://discussions.unity.com/t/731131/6