Is IntPtr a managed or unmanaged data type in c#?
Managed. C# only produces managed code, you can't have any unmanaged
types.
Do I need to be doing
Intptr = IPtr;
fixed(void * ptr = (void *)IPtr )
{
....
}
to avoid relocation? or can I use
void *ptr = (void *)Iptr without fixed?
Most likely no, but it depends on what the IntPtr is pointing at. I
assume you wouldn't have an IntPtr pointing to something managed
unless you had already pinned it. The first piece of code won't work
though.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
Please reply only to the newsgroup.