public bool TraverseStubHeap(ulong heap, int type, LoaderHeapTraverse callback) { InitDelegate(ref _traverseStubHeap, VTable->TraverseVirtCallStubHeap); int hr = _traverseStubHeap(Self, heap, type, Marshal.GetFunctionPointerForDelegate(callback)); GC.KeepAlive(callback); return(hr == S_OK); }
internal abstract bool TraverseStubHeap(ulong appDomain, int type, LoaderHeapTraverse callback);
internal abstract bool TraverseHeap(ulong heap, LoaderHeapTraverse callback);
internal override bool TraverseStubHeap(ulong appDomain, int type, LoaderHeapTraverse callback) { byte[] input; if (IntPtr.Size == 4) input = new byte[sizeof(ulong) * 2]; else input = new byte[sizeof(ulong) * 3]; WriteValueToBuffer(appDomain, input, 0); WriteValueToBuffer(type, input, sizeof(ulong)); WriteValueToBuffer(Marshal.GetFunctionPointerForDelegate(callback), input, sizeof(ulong) + sizeof(int)); return Request(DacRequests.VIRTCALLSTUBHEAP_TRAVERSE, input, null); }