Ejemplo n.º 1
0
 public void Dispose()
 {
     if (ourProcess != null)
     {
         SymCleanup(ourProcess.Handle);
         ourProcess = null;
     }
     if (dbghelpModule != null && !dbghelpModule.IsClosed)
     {
         dbghelpModule.Dispose();
         dbghelpModule = null;
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     if (process != null)
     {
         SymCleanup(process.Handle);
         process = null;
     }
     if (dbgHelpLib == null || dbgHelpLib.IsClosed)
     {
         return;
     }
     dbgHelpLib.Dispose();
     dbgHelpLib = null;
 }
Ejemplo n.º 3
0
        private DacLocator(String searchPath)
        {
            this.searchPath = searchPath;
            ourProcess      = Process.GetCurrentProcess();
            dbghelpModule   = LoadLibrary("dbghelp.dll");
            if (dbghelpModule.IsInvalid)
            {
                throw new Win32Exception(String.Format("Could not load dbghelp.dll: {0}", Marshal.GetLastWin32Error()));
            }

            if (!SymInitialize(ourProcess.Handle, searchPath, false))
            {
                throw new Win32Exception(String.Format("SymInitialize() failed: {0}", Marshal.GetLastWin32Error()));
            }
        }
Ejemplo n.º 4
0
        private DacLocator(string searchPath)
        {
            this.searchPath = searchPath;
            ourProcess = Process.GetCurrentProcess();

            CreateFiles();

            dbghelpModule = Environment.Is64BitProcess ? LoadLibrary("x64\\dbghelp.dll")
                                                       : LoadLibrary("x86\\dbghelp.dll");

            if (dbghelpModule.IsInvalid)
                throw new InvalidOperationException("Could not load dbghelp.dll", new Win32Exception(Marshal.GetLastWin32Error()));

            if (!SymInitialize(ourProcess.Handle, searchPath, false))
                throw new InvalidOperationException("SymInitialize: Unexpected error occured.", new Win32Exception(Marshal.GetLastWin32Error()));
        }
Ejemplo n.º 5
0
        private DacLocator(string searchPath)
        {
            this.searchPath = searchPath;
            ourProcess      = Process.GetCurrentProcess();

            CreateFiles();

            dbghelpModule = Environment.Is64BitProcess ? LoadLibrary("x64\\dbghelp.dll")
                                                       : LoadLibrary("x86\\dbghelp.dll");

            if (dbghelpModule.IsInvalid)
            {
                throw new InvalidOperationException("Could not load dbghelp.dll", new Win32Exception(Marshal.GetLastWin32Error()));
            }

            if (!SymInitialize(ourProcess.Handle, searchPath, false))
            {
                throw new InvalidOperationException("SymInitialize: Unexpected error occured.", new Win32Exception(Marshal.GetLastWin32Error()));
            }
        }
Ejemplo n.º 6
0
        public void Dispose()
        {
            if (process != null)
            {
                try
                {
                    SymCleanup(process.Handle);
                }
                finally
                {
                    process.Dispose();
                }

                process = null;
            }
            if (dbgHelpLib?.IsClosed != false)
            {
                return;
            }
            dbgHelpLib.Dispose();
            dbgHelpLib = null;
        }
Ejemplo n.º 7
0
 public void Dispose()
 {
     if (ourProcess != null)
     {
         SymCleanup(ourProcess.Handle);
         ourProcess = null;
     }
     if (dbghelpModule != null && !dbghelpModule.IsClosed)
     {
         dbghelpModule.Dispose();
         dbghelpModule = null;
     }
 }
Ejemplo n.º 8
0
 public static extern IntPtr GetProcAddress
 (
     [param: In] LibrarySafeHandle hModule,
     [param: In, MarshalAs(UnmanagedType.LPStr)] string lpProcName
 );
Ejemplo n.º 9
0
 public void Dispose()
 {
     if (process != null)
     {
         SymCleanup(process.Handle);
         process = null;
     }
     if (dbgHelpLib == null || dbgHelpLib.IsClosed)
         return;
     dbgHelpLib.Dispose();
     dbgHelpLib = null;
 }