SymInitialize() private method

private SymInitialize ( IntPtr hProcess, [ UserSearchPath, bool fInvadeProcess ) : bool
hProcess IntPtr
UserSearchPath [
fInvadeProcess bool
return bool
Example #1
0
        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
        }
Example #2
0
        public static Sym Initalize()
        {
            DebugHelp.SymSetOptions(DebugHelp.SymOptions.SYMOPT_DEBUG);

            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);

            return(new Sym());
        }