示例#1
0
        internal override IList <MethodTableTokenPair> GetMethodTableList(ulong module)
        {
            List <MethodTableTokenPair> mts = new List <MethodTableTokenPair>();

            SOSDac.ModuleMapTraverse    traverse = delegate(uint index, ulong mt, IntPtr token) { mts.Add(new MethodTableTokenPair(mt, index)); };
            LegacyModuleMapTraverseArgs args     = new LegacyModuleMapTraverseArgs
            {
                Callback = Marshal.GetFunctionPointerForDelegate(traverse),
                Module   = module
            };

            // TODO:  Blah, theres got to be a better way to do this.
            byte[] input = GetByteArrayForStruct <LegacyModuleMapTraverseArgs>();
            IntPtr mem   = Marshal.AllocHGlobal(input.Length);

            Marshal.StructureToPtr(args, mem, true);
            Marshal.Copy(mem, input, 0, input.Length);
            Marshal.FreeHGlobal(mem);

            bool r = Request(DacRequests.MODULEMAP_TRAVERSE, input, null);

            GC.KeepAlive(traverse);

            return(mts);
        }
示例#2
0
        internal override IList<ulong> GetMethodTableList(ulong module)
        {
            List<ulong> mts = new List<ulong>();

            ModuleMapTraverse traverse = delegate (uint index, ulong mt, IntPtr token) { mts.Add(mt); };
            LegacyModuleMapTraverseArgs args = new LegacyModuleMapTraverseArgs();
            args.pCallback = Marshal.GetFunctionPointerForDelegate(traverse);
            args.module = module;

            // TODO:  Blah, theres got to be a better way to do this.
            byte[] input = GetByteArrayForStruct<LegacyModuleMapTraverseArgs>();
            IntPtr mem = Marshal.AllocHGlobal(input.Length);
            Marshal.StructureToPtr(args, mem, true);
            Marshal.Copy(mem, input, 0, input.Length);
            Marshal.FreeHGlobal(mem);

            bool r = Request(DacRequests.MODULEMAP_TRAVERSE, input, null);

            GC.KeepAlive(traverse);

            return mts;
        }