Marshal opaque structs as IntPtr instead of Byte[](blogs.msdn.com)
submitted by
erick(230) 5 years, 5 months ago
If you have an opaque native structure that you want to pass through managed code, consider using IntPtr, not Byte[], in your marshalling signatures. Opaque means that you don't care about the contents of the buffer. For example, if in C#, you pinvoke to get an opaque native structure that you then hand to some other native API, the pinvoke definitions should use IntPtr instead of Byte[].
|category: CLR
|Views: 9
tags:
IntPtr Byte CLR another
Everyones tags:
Your Tags: