K
Ken Allen
The documentation is not clear on the exact behaviour of the
Marshal.PtrToStructure method and whether it copies the contents of the
IntPtr region to a new managed object or whether it creates the managed
object to reference the same region of memory.
Question 1: should I call Marshal.FreeCoTaskMem after calling
Marshal.PtrToStructure?
Question 2: the Marshal.PtrToStructure method seems to create an object for
the structure -- should I be concerned with converting it to a value object?
-Ken
Marshal.PtrToStructure method and whether it copies the contents of the
IntPtr region to a new managed object or whether it creates the managed
object to reference the same region of memory.
Question 1: should I call Marshal.FreeCoTaskMem after calling
Marshal.PtrToStructure?
Question 2: the Marshal.PtrToStructure method seems to create an object for
the structure -- should I be concerned with converting it to a value object?
-Ken