public static int GetReaderForFile(this ISymUnmanagedBinder instance, object importer, IntPtr filename, IntPtr searchPath, ref object retVal) { int returnValue = instance.__GetReaderForFile(importer, filename, searchPath, ref retVal); ProcessOutParameter(retVal); return(returnValue); }
//// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.SymbolBinder"]/*' /> public SymbolBinder() { Type binderType = Type.GetTypeFromCLSID(CLSID_CorSymBinder); object comBinder = (ISymUnmanagedBinder)Activator.CreateInstance(binderType); m_binder = (ISymUnmanagedBinder)comBinder; }
public PdbSymbolProvider() { try { // Create a COM Metadata dispenser Guid dispenserClassID = new Guid(0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x00, 0x80, 0xc7, 0x92, 0xe5, 0xd8); // CLSID_CorMetaDataDispenser Guid dispenserIID = new Guid(0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c); // IID_IMetaDataDispenser object objDispenser; if (MetaDataGetDispenser(ref dispenserClassID, ref dispenserIID, out objDispenser) < 0) { return; } _metadataDispenser = (IMetaDataDispenser)objDispenser; Guid symBinderClassID = new Guid(0x0A29FF9E, 0x7F9C, 0x4437, 0x8B, 0x11, 0xF4, 0x24, 0x49, 0x1E, 0x39, 0x31); // CLSID_CorSymBinder Guid symBinderIID = new Guid(0xAA544d42, 0x28CB, 0x11d3, 0xbd, 0x22, 0x00, 0x00, 0xf8, 0x08, 0x49, 0xbd); // IID_ISymUnmanagedBinder object objBinder; if (CoCreateInstance(ref symBinderClassID, IntPtr.Zero, // pUnkOuter 1, // CLSCTX_INPROC_SERVER ref symBinderIID, out objBinder) < 0) { return; } _symBinder = (ISymUnmanagedBinder)objBinder; } catch { } }
public static ISymUnmanagedReader GetReaderFromStream(this ISymUnmanagedBinder instance, object importer, IStream pstream) { ISymUnmanagedReader returnValue = instance.__GetReaderFromStream(importer, pstream); ProcessOutParameter(returnValue); return(returnValue); }
public SymbolBinder() { Guid clsid = SymbolStoreGuids.CLSID_CorSymBinderGuid; Guid iid = typeof(ISymUnmanagedBinder).GUID; _unmanaged = CoreUtils.CoCreateInstance <ISymUnmanagedBinder>(clsid, iid, true); }
public ISymUnmanagedReader GetSymReader(string fullname, string searchPath) { try { ISymUnmanagedBinder symBinder = new ISymUnmanagedBinder(new Debugger.Interop.CorSym.CorSymBinder_SxSClass()); return(symBinder.GetReaderForFile(metaData, fullname, searchPath)); } catch { return(null); } }
public ISymUnmanagedReader GetSymReader(Debugger.Wrappers.CorDebug.IStream stream) { try { ISymUnmanagedBinder symBinder = new ISymUnmanagedBinder(new Debugger.Interop.CorSym.CorSymBinder_SxSClass()); return(symBinder.GetReaderFromStream(metaData, stream)); } catch { return(null); } }
public SymbolBinder(ISymUnmanagedBinder unmanaged) { if (unmanaged == null) { throw new ArgumentNullException("unmanaged"); } _unmanaged = unmanaged; }
/// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.SymbolBinder"]/*' /> public SymbolBinder() { Guid CLSID_CorSymBinder = new Guid("0A29FF9E-7F9C-4437-8B11-F424491E3931"); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { m_binder = (ISymUnmanagedBinder3)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_CorSymBinder)); } }
/// <summary> /// Create a SymbolBinder given the underling COM object for ISymUnmanagedBinder /// </summary> /// <param name="comBinderObject"></param> /// <remarks>Note that this could be protected, but C# doesn't have a way to express "internal AND /// protected", just "internal OR protected"</remarks> internal SymbolBinder(ISymUnmanagedBinder comBinderObject) { // We should not wrap null instances if (comBinderObject == null) { throw new ArgumentNullException("comBinderObject"); } m_binder = comBinderObject; }
public static ISymUnmanagedReader GetReaderFromStream(this ISymUnmanagedBinder binder, Stream stream, object metadataImporter) { if (binder == null) { throw new ArgumentNullException(nameof(binder)); } ISymUnmanagedReader symReader; ThrowExceptionForHR(binder.GetReaderFromStream(metadataImporter, SymUnmanagedStreamFactory.CreateStream(stream), out symReader)); return(symReader); }
private PdbSymbolProvider(string binaryFilePath, string pdbFilePath = "") { _binaryFilePath = binaryFilePath; _pdbFilePath = pdbFilePath; if (String.IsNullOrEmpty(_pdbFilePath)) { _pdbFilePath = Path.ChangeExtension(binaryFilePath, ".pdb"); } // Create a COM Metadata dispenser Guid dispenserClassID = new Guid(0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x00, 0x80, 0xc7, 0x92, 0xe5, 0xd8); // CLSID_CorMetaDataDispenser Guid dispenserIID = new Guid(0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c); // IID_IMetaDataDispenser object objDispenser; Marshal.ThrowExceptionForHR(NativeMethods.MetaDataGetDispenser(ref dispenserClassID, ref dispenserIID, out objDispenser)); _metadataDispenser = (IMetaDataDispenser)objDispenser; // Create a symbol binder [?] Guid symBinderClassID = new Guid(0x0A29FF9E, 0x7F9C, 0x4437, 0x8B, 0x11, 0xF4, 0x24, 0x49, 0x1E, 0x39, 0x31); // CLSID_CorSymBinder Guid symBinderIID = new Guid(0xAA544d42, 0x28CB, 0x11d3, 0xbd, 0x22, 0x00, 0x00, 0xf8, 0x08, 0x49, 0xbd); // IID_ISymUnmanagedBinder object objBinder; if (NativeMethods.CoCreateInstance(ref symBinderClassID, IntPtr.Zero, // pUnkOuter 1, // CLSCTX_INPROC_SERVER ref symBinderIID, out objBinder) < 0) { throw new InvalidComObjectException("PdbSymbolProvider unable to construct an ISymUnmanagedBinder."); } _symBinder = (ISymUnmanagedBinder)objBinder; // Create a symbol reader Guid importerIID = new Guid(0x7dac8207, 0xd3ae, 0x4c75, 0x9b, 0x67, 0x92, 0x80, 0x1a, 0x49, 0x7d, 0x44); // IID_IMetaDataImport // Open an metadata importer on the given filename. We'll end up passing this importer straight // through to the Binder. object objImporter; Marshal.ThrowExceptionForHR(_metadataDispenser.OpenScope(binaryFilePath, 0x00000010 /* read only */, ref importerIID, out objImporter)); string pdbFolderPath = Path.GetDirectoryName(pdbFilePath); ISymUnmanagedReader reader; Marshal.ThrowExceptionForHR(_symBinder.GetReaderForFile(objImporter, binaryFilePath, pdbFolderPath, out reader)); _symReader = reader; // Create a source file map [if we can find the map file] _sourceFileMap = SourceFileMap.Load(pdbFilePath); }
// ISymUnmanagedBinder public static ISymUnmanagedReader GetReaderForFile(this ISymUnmanagedBinder symBinder, object importer, string filename, string searchPath) { IntPtr pfilename = Marshal.StringToCoTaskMemUni(filename); IntPtr psearchPath = Marshal.StringToCoTaskMemUni(searchPath); object res = null; // The method will create the object anyway so we have to use preservesig so that we can release it // failing to do so would lock the assembly int code = symBinder.GetReaderForFile(importer, pfilename, psearchPath, ref res); Marshal.FreeCoTaskMem(pfilename); Marshal.FreeCoTaskMem(psearchPath); if (code != 0) { Marshal.FinalReleaseComObject(res); throw new COMException("", code); } return((ISymUnmanagedReader)res); }
public void Dispose() { if (_symReader != null) { Marshal.ReleaseComObject(_symReader); _symReader = null; } if (_symBinder != null) { Marshal.ReleaseComObject(_symBinder); _symBinder = null; } if (_metadataDispenser != null) { Marshal.ReleaseComObject(_metadataDispenser); _metadataDispenser = null; } }
/// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.SymbolBinder"]/*' /> public SymbolBinder() { var CLSID_CorSymBinder = new Guid("0A29FF9E-7F9C-4437-8B11-F424491E3931"); m_binder = (ISymUnmanagedBinder3) Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_CorSymBinder)); }
public SymbolBinder() { Guid CLSID_CorSymBinder = new Guid("0A29FF9E-7F9C-4437-8B11-F424491E3931"); m_binder = (ISymUnmanagedBinder3)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_CorSymBinder)); }
public PdbSymbolProvider() { try { // Create a COM Metadata dispenser Guid dispenserClassID = new Guid(0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x00, 0x80, 0xc7, 0x92, 0xe5, 0xd8); // CLSID_CorMetaDataDispenser Guid dispenserIID = new Guid(0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c); // IID_IMetaDataDispenser object objDispenser; if (MetaDataGetDispenser(ref dispenserClassID, ref dispenserIID, out objDispenser) < 0) return; _metadataDispenser = (IMetaDataDispenser)objDispenser; Guid symBinderClassID = new Guid(0x0A29FF9E, 0x7F9C, 0x4437, 0x8B, 0x11, 0xF4, 0x24, 0x49, 0x1E, 0x39, 0x31); // CLSID_CorSymBinder Guid symBinderIID = new Guid(0xAA544d42, 0x28CB, 0x11d3, 0xbd, 0x22, 0x00, 0x00, 0xf8, 0x08, 0x49, 0xbd); // IID_ISymUnmanagedBinder object objBinder; if (CoCreateInstance(ref symBinderClassID, IntPtr.Zero, // pUnkOuter 1, // CLSCTX_INPROC_SERVER ref symBinderIID, out objBinder) < 0) return; _symBinder = (ISymUnmanagedBinder)objBinder; } catch { } }
/// <summary> /// Create a SymbolBinder given the underling COM object for ISymUnmanagedBinder /// </summary> /// <param name="comBinderObject"></param> /// <remarks>Note that this could be protected, but C# doesn't have a way to express "internal AND /// protected", just "internal OR protected"</remarks> internal SymbolBinder(ISymUnmanagedBinder comBinderObject) { // We should not wrap null instances if (comBinderObject == null) throw new ArgumentNullException("comBinderObject"); m_binder = comBinderObject; }
//// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.SymbolBinder"]/*' /> public SymbolBinder() { Type binderType = Type.GetTypeFromCLSID(CLSID_CorSymBinder); object comBinder = (ISymUnmanagedBinder)Activator.CreateInstance(binderType); m_binder = (ISymUnmanagedBinder)comBinder; }