예제 #1
0
파일: Sym.cs 프로젝트: sean-lab/inVtero.net
        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
        }
예제 #2
0
파일: Sym.cs 프로젝트: wflk/EhTrace
        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());
        }