Hello all!
I am trying to find GC root of any given managed object in a dump file by using Microsoft debugging APIs.
I can enumarete managed objects successfuly (I can get address, size, type info etc.).
I chose ICorDebugProcess5::EnumerateGCReferences to obtain GC roots. This one returns also successfully so I get an enum for roots.
ICorDebugGCReferenceEnum GCEnum;
m_iCordebugProcess5.EnumerateGCReferences(true, out GCEnum);
However, when try to enumarate over "GCEnum" with next method (http://msdn.microsoft.com/en-us/library/hh387796(v=vs.110).aspx), we got "Not Implemented" (HRESULT: 0x80004001) exception
We have imported the interface as seen below:
[ComImport, Guid("7F3C24D3-7E1D-4245-AC3A-F72F8859C80C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface ICorDebugGCReferenceEnum : ICorDebugEnum { [PreserveSig] int Next([In] uint celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] COR_GC_REFERENCE[] objects, out uint pceltFetched); }
Also, I could not understand the value of "celt" parameter, I have tried with several values, all the time it gives the same exception.
Could you please help me to find the error, also give an example for usage of this method?