Unmanaged code calls my functions. In first function I sould pass back pointer to my managet object. Sometimes later some of my othrer functions got called with that same pointer as one of parameters . I sould dereference it use it to perform some calculations and then if it is not neaded dispose of it.
To cut the story short I need to pin that object so that GC won't move it til I dispose of it. How to do that in C# ?
Thanks in advance.
To cut the story short I need to pin that object so that GC won't move it til I dispose of it. How to do that in C# ?
Thanks in advance.