Exemple #1
0
        public ISymbolReader GetReaderForFile(Object importer, String fileName,
                                              String searchPath, SymSearchPolicies searchPolicy,
                                              IntPtr callback)
        {
            ISymUnmanagedReader reader = null;
            IntPtr uImporter           = IntPtr.Zero;

            try
            {
                uImporter = Marshal.GetIUnknownForObject(importer);
                int hr = ((ISymUnmanagedBinder3)m_binder).GetReaderFromCallback(uImporter, fileName, searchPath, (int)searchPolicy, callback, out reader);
                if (IsFailingResultNormal(hr))
                {
                    return(null);
                }
                Marshal.ThrowExceptionForHR(hr);
            }
            finally
            {
                if (uImporter != IntPtr.Zero)
                {
                    Marshal.Release(uImporter);
                }
            }
            return(new SymReader(reader));
        }
Exemple #2
0
        /// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.GetReaderForFile1"]/*' />
        public ISymbolReader GetReaderForFile(Object importer, String fileName,
                                              String searchPath, SymSearchPolicies searchPolicy)
        {
            if (m_binder == null)
            {
                return(null);
            }

            ISymUnmanagedReader symReader = null;
            IntPtr uImporter = IntPtr.Zero;

            try
            {
                uImporter = ((importer as SharpDX.ComObject)?.NativePointer).Value;
                int hr = ((ISymUnmanagedBinder2)m_binder).GetReaderForFile2(uImporter, fileName, searchPath, (int)searchPolicy, out symReader);
                if (IsFailingResultNormal(hr))
                {
                    return(null);
                }
                Marshal.ThrowExceptionForHR(hr);
            }
            finally
            {
                if (uImporter != IntPtr.Zero)
                {
                    Marshal.Release(uImporter);
                }
            }
            return(new SymReader(symReader));
        }
        /// <summary>
        /// Create a new symbol provider.
        /// Note that the symbol provider will cache the symbol readers it creates
        /// </summary>
        /// <param name="searchPath">A semicolon separated list of paths to search for a PDB file</param>
        /// <param name="searchPolicy">Flags which specify where else to search</param>
        public SymbolProvider(string searchPath, SymSearchPolicies searchPolicy)
        {
            m_searchPath = searchPath;
            m_searchPolicy = searchPolicy;

            // Create a metadata dispenser and symbol binder via COM interop to use for all modules
            m_metadataDispenser = new IMetaDataDispenser();
            m_symBinder = new ISymUnmanagedBinder2();
        }
        /// <summary>
        /// Create a new symbol provider.
        /// Note that the symbol provider will cache the symbol readers it creates
        /// </summary>
        /// <param name="searchPath">A semicolon separated list of paths to search for a PDB file</param>
        /// <param name="searchPolicy">Flags which specify where else to search</param>
        public SymbolProvider(string searchPath, SymSearchPolicies searchPolicy)
        {
            m_searchPath   = searchPath;
            m_searchPolicy = searchPolicy;

            // Create a metadata dispenser and symbol binder via COM interop to use for all modules
            m_metadataDispenser = new IMetaDataDispenser();
            m_symBinder         = new ISymUnmanagedBinder2();
        }
Exemple #5
0
        /// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.GetReaderForFile1"]/*' />
        public ISymbolReader GetReaderForFile(Object importer, String fileName,
                                              String searchPath, SymSearchPolicies searchPolicy)
        {
            ISymUnmanagedReader symReader = null;
            IntPtr uImporter = IntPtr.Zero;

            try {
                uImporter = Marshal.GetIUnknownForObject(importer);
                ((ISymUnmanagedBinder2)m_binder).GetReaderForFile2(uImporter, fileName, searchPath, (int)searchPolicy, out symReader);
            } finally {
                if (uImporter != IntPtr.Zero)
                {
                    Marshal.Release(uImporter);
                }
            }
            return(new SymReader(symReader));
        }
Exemple #6
0
 public ISymbolReader GetReaderForFile(object importer, string fileName, string searchPath, SymSearchPolicies searchPolicy, IntPtr callback)
 {
     ISymUnmanagedReader reader;
     IntPtr uImporter = IntPtr.Zero;
     try
     {
         uImporter = Marshal.GetIUnknownForObject(importer);
         int hr = ((ISymUnmanagedBinder3)unmanagedBinder).GetReaderFromCallback(uImporter, fileName, searchPath, (int)searchPolicy, callback, out reader);
         if (IsFailingResultNormal(hr))
         {
             return null;
         }
         Marshal.ThrowExceptionForHR(hr);
     }
     finally
     {
         if (uImporter != IntPtr.Zero)
             Marshal.Release(uImporter);
     }
     return new SymbolReader(reader);
 }
 /// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.GetReaderForFile1"]/*' />
 public ISymbolReader GetReaderForFile(Object importer, String fileName,
                                       String searchPath, SymSearchPolicies searchPolicy)
 {
     ISymUnmanagedReader symReader = null;
     IntPtr uImporter = IntPtr.Zero;
     try
     {
         uImporter = Marshal.GetIUnknownForObject(importer);
         int hr = ((ISymUnmanagedBinder2) m_binder).GetReaderForFile2(uImporter, fileName, searchPath,
                                                                      (int) searchPolicy, out symReader);
         if (IsFailingResultNormal(hr))
         {
             return null;
         }
         Marshal.ThrowExceptionForHR(hr);
     }
     finally
     {
         if (uImporter != IntPtr.Zero)
             Marshal.Release(uImporter);
     }
     return new SymReader(symReader);
 }
 /// <include file='doc\symbinder.uex' path='docs/doc[@for="SymbolBinder.GetReaderForFile2"]/*' />
 public ISymbolReader GetReaderForFile(Object importer, String fileName,
     String searchPath, SymSearchPolicies searchPolicy,
     IntPtr callback)
 {
     ISymUnmanagedReader reader = null;
     IntPtr uImporter = IntPtr.Zero;
     try {
         uImporter = Marshal.GetIUnknownForObject(importer);
         ((ISymUnmanagedBinder3)m_binder).GetReaderFromCallback(uImporter, fileName, searchPath, (int)searchPolicy, callback, out reader);
     } finally {
         if (uImporter != IntPtr.Zero)
             Marshal.Release(uImporter);
     }
     return new SymReader(reader);
 }
Exemple #9
0
        public ISymbolReader GetReaderForFile(object importer, string fileName, string searchPath, SymSearchPolicies searchPolicy)
        {
            ISymUnmanagedReader symReader;
            IntPtr uImporter = IntPtr.Zero;

            try
            {
                uImporter = Marshal.GetIUnknownForObject(importer);
                int hr = ((ISymUnmanagedBinder2)unmanagedBinder).GetReaderForFile2(uImporter, fileName, searchPath, (int)searchPolicy, out symReader);
                if (IsFailingResultNormal(hr))
                {
                    return(null);
                }
                Marshal.ThrowExceptionForHR(hr);
            }
            finally
            {
                if (uImporter != IntPtr.Zero)
                {
                    Marshal.Release(uImporter);
                }
            }
            return(new SymbolReader(symReader));
        }