Hi,
When I make some P/Invoke or COM InterOP, I often bump into the IntPtr. So here is a couple of questions:
Everyone said that IntPtr is a struct, so what's in it? I can only think of an 32bit/64bit integer which is the address it points to. Anything else?
Where is the IntPtr located? If it is a struct, I believe it should be in the CLR managed stack. But what if I pass an IntPtr to an unmanaged method when doing p/invoke, isn't it passed to the unmanaged stack? Will it be copied to the unmanaged stack? There're managed and unmanaged heaps in a process address space, does this seperation also exist for a process' stack?