public static bool Initalize(long Handle, String SymPath, DebugHelp.SymOptions Options = DebugHelp.SymOptions.SYMOPT_UNDNAME) { #if NETSTANDARD2_0 return(true); #else DebugHelp.SymSetOptions(Options); if (string.IsNullOrWhiteSpace(SymPath)) { SymPath = Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"); } if (string.IsNullOrWhiteSpace(SymPath)) { SymPath = "SRV*http://msdl.microsoft.com/download/symbols"; } bool symStatus = DebugHelp.SymInitialize(Handle, SymPath, false); if (!symStatus) { Errors.Enqueue($"symbol status {symStatus}: {new Win32Exception(Marshal.GetLastWin32Error()).Message }"); } DebugHelp.SymSetOptions(Options); return(symStatus); #endif }
public static Sym Initalize(DebugHelp.SymOptions Options = DebugHelp.SymOptions.SYMOPT_DEBUG) { DebugHelp.SymSetOptions(Options); SymPath = Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"); if (string.IsNullOrWhiteSpace(SymPath)) { SymPath = "SRV*http://msdl.microsoft.com/download/symbols"; } bool symStatus = DebugHelp.SymInitialize(hCurrentProcess, SymPath, false); if (!symStatus) { WriteLine($"symbol status {symStatus}: {new Win32Exception(Marshal.GetLastWin32Error()).Message }"); } DebugHelp.SymSetOptions(DebugHelp.SymOptions.SYMOPT_DEBUG); ListAllSymbols = new List <MinSym>(); return(new Sym()); }