private static ISymUnmanagedReader CreatePortableSymReader(Stream pdbStream, object metadataImporter) { var binder = new PortablePdb.SymBinder(); ISymUnmanagedReader reader; int hr = binder.GetReaderFromStream(metadataImporter, new ComStreamWrapper(pdbStream), out reader); SymUnmanagedReaderExtensions.ThrowExceptionForHR(hr); return reader; }
private static ISymUnmanagedReader CreatePortableSymReader(Stream pdbStream, object metadataImporter) { var binder = new PortablePdb.SymBinder(); ISymUnmanagedReader reader; int hr = binder.GetReaderFromStream(metadataImporter, new ComStreamWrapper(pdbStream), out reader); SymUnmanagedReaderExtensions.ThrowExceptionForHR(hr); return(reader); }
public static ISymUnmanagedReader CreateReader(Stream pdbStream, object metadataImporter) { pdbStream.Position = 0; bool isPortable = pdbStream.ReadByte() == 'B' && pdbStream.ReadByte() == 'S' && pdbStream.ReadByte() == 'J' && pdbStream.ReadByte() == 'B'; pdbStream.Position = 0; if (isPortable) { var binder = new PortablePdb.SymBinder(); ISymUnmanagedReader reader; int hr = binder.GetReaderFromStream(metadataImporter, new ComStreamWrapper(pdbStream), out reader); SymUnmanagedReaderExtensions.ThrowExceptionForHR(hr); return reader; } else { return CreateNativeSymReader(pdbStream, metadataImporter); } }
public static ISymUnmanagedReader CreateReader(Stream pdbStream, object metadataImporter) { pdbStream.Position = 0; bool isPortable = pdbStream.ReadByte() == 'B' && pdbStream.ReadByte() == 'S' && pdbStream.ReadByte() == 'J' && pdbStream.ReadByte() == 'B'; pdbStream.Position = 0; if (isPortable) { var binder = new PortablePdb.SymBinder(); ISymUnmanagedReader reader; int hr = binder.GetReaderFromStream(metadataImporter, new ComStreamWrapper(pdbStream), out reader); SymUnmanagedReaderExtensions.ThrowExceptionForHR(hr); return(reader); } else { return(CreateNativeSymReader(pdbStream, metadataImporter)); } }