private IEnumerable <SYMBOL_INFO> Enumerate(Action <IntPtr> action) { PdbStore store = GetStore(action); foreach (SYMBOL_INFO si in store.Enumerate()) { yield return(si); } }
private static unsafe bool enum_proc(IntPtr pinfo, uint size, IntPtr pUserContext) { SYMBOL_INFO info = SYMBOL_INFO.Create(pinfo); PdbStore pdbStore = (PdbStore)Marshal.GetObjectForNativeVariant(pUserContext); pdbStore.Add(info); return(true); }
private PdbStore GetStore(Action <IntPtr> action) { PdbStore store = new PdbStore(); IntPtr pStore = Marshal.AllocHGlobal(16); // 16 == sizeof(VARIANT) Marshal.GetNativeVariantForObject(store, pStore); action(pStore); return(store); }
public static PdbStore CreateTypeStore(string pdbFilePath, IntPtr baseAddress, int memorySize) { PdbStore store = null; using (PdbDump pdbDumper = new PdbDump(pdbFilePath, baseAddress, memorySize)) { store = pdbDumper.GetStore((pStore) => { NativeMethods.SymEnumTypes(pdbDumper._hProcess, (ulong)baseAddress.ToInt64(), enum_proc, pStore); }); } return(store); }