public void Dispose() { if (ourProcess != null) { SymCleanup(ourProcess.Handle); ourProcess = null; } if (dbghelpModule != null && !dbghelpModule.IsClosed) { dbghelpModule.Dispose(); dbghelpModule = null; } }
public void Dispose() { if (process != null) { SymCleanup(process.Handle); process = null; } if (dbgHelpLib == null || dbgHelpLib.IsClosed) { return; } dbgHelpLib.Dispose(); dbgHelpLib = null; }
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())); } }
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())); }
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())); } }
public void Dispose() { if (process != null) { try { SymCleanup(process.Handle); } finally { process.Dispose(); } process = null; } if (dbgHelpLib?.IsClosed != false) { return; } dbgHelpLib.Dispose(); dbgHelpLib = null; }
public static extern IntPtr GetProcAddress ( [param: In] LibrarySafeHandle hModule, [param: In, MarshalAs(UnmanagedType.LPStr)] string lpProcName );
public void Dispose() { if (process != null) { SymCleanup(process.Handle); process = null; } if (dbgHelpLib == null || dbgHelpLib.IsClosed) return; dbgHelpLib.Dispose(); dbgHelpLib = null; }