예제 #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));
        }
예제 #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));
        }
예제 #3
0
        /// <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();
        }
예제 #4
0
        /// <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();
        }
예제 #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));
        }
예제 #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);
 }
예제 #8
0
 /// <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);
 }
예제 #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));
        }