Exemplo n.º 1
0
        public ISymbolNamespace[] GetNamespaces()
        {
            int size;

            HRESULT.ThrowOnFailure(_unmanaged.GetNamespaces(0, out size, null));

            var unmanagedNamespaces = new ISymUnmanagedNamespace[size];

            HRESULT.ThrowOnFailure(_unmanaged.GetNamespaces(unmanagedNamespaces.Length, out size, unmanagedNamespaces));

            var namespaces = new ISymbolNamespace[size];

            for (int i = 0; i < size; i++)
            {
                namespaces[i] = new SymbolNamespace(unmanagedNamespaces[i]);
            }

            return(namespaces);
        }
        public void SetMethodSourceRange(ISymbolDocumentWriter startDoc, int startLine, int startColumn, ISymbolDocumentWriter endDoc, int endLine, int endColumn)
        {
            var symStartDoc = startDoc as SymbolDocumentWriter;

            if (symStartDoc == null)
            {
                throw new InvalidOperationException();
            }

            var symEndDoc = endDoc as SymbolDocumentWriter;

            if (symEndDoc == null)
            {
                throw new InvalidOperationException();
            }

            HRESULT.ThrowOnFailure(_unmanaged.SetMethodSourceRange(
                                       symStartDoc.Unmanaged, startLine, startColumn,
                                       symEndDoc.Unmanaged, endLine, endColumn));
        }
        public static string FindAssemblyPath(string name)
        {
            UnmanagedApi.IAssemblyCache cache;
            HRESULT.ThrowOnFailure(UnmanagedApi.FusionNative.CreateAssemblyCache(out cache, 0));

            var assemblyInfo = new UnmanagedApi.ASSEMBLY_INFO()
            {
                cbAssemblyInfo = Marshal.SizeOf(typeof(UnmanagedApi.ASSEMBLY_INFO)),
            };

            uint queryFlags = (uint)UnmanagedApi.QUERYASMINFO_FLAG.VALIDATE;

            cache.QueryAssemblyInfo(queryFlags, name, ref assemblyInfo);
            if (assemblyInfo.cbAssemblyInfo == 0)
            {
                return(null);
            }

            assemblyInfo.pszCurrentAssemblyPathBuf = new string(new char[assemblyInfo.cchBuf]);
            cache.QueryAssemblyInfo(queryFlags, name, ref assemblyInfo);

            return(assemblyInfo.pszCurrentAssemblyPathBuf);
        }
 public void DefineParameter(string name, System.Reflection.ParameterAttributes attributes, int sequence,
                             SymAddressKind addrKind, int addr1, int addr2, int addr3)
 {
     HRESULT.ThrowOnFailure(_unmanaged.DefineParameter(name,
                                                       (int)attributes, sequence, (int)addrKind, addr1, addr2, addr3));
 }
 public void CloseScope(int endOffset)
 {
     HRESULT.ThrowOnFailure(_unmanaged.CloseScope(endOffset));
 }
 public void CloseNamespace()
 {
     HRESULT.ThrowOnFailure(_unmanaged.CloseNamespace());
 }
 public void CloseMethod()
 {
     HRESULT.ThrowOnFailure(_unmanaged.CloseMethod());
 }
 public void UsingNamespace(string fullName)
 {
     HRESULT.ThrowOnFailure(_unmanaged.UsingNamespace(fullName));
 }
 public void SetUserEntryPoint(SymbolToken entryMethod)
 {
     HRESULT.ThrowOnFailure(_unmanaged.SetUserEntryPoint(entryMethod.GetToken()));
 }
 public void SetSymAttribute(SymbolToken parent, string name, byte[] data)
 {
     HRESULT.ThrowOnFailure(_unmanaged.SetSymAttribute(
                                parent.GetToken(), name, data.Length, data));
 }
 public void SetScopeRange(int scopeID, int startOffset, int endOffset)
 {
     HRESULT.ThrowOnFailure(_unmanaged.SetScopeRange(scopeID, startOffset, endOffset));
 }
Exemplo n.º 12
0
 public AssemblyName()
 {
     HRESULT.ThrowOnFailure(FusionNative.CreateAssemblyNameObject(out _assemblyName, null, 0, IntPtr.Zero));
 }
 public void OpenNamespace(string name)
 {
     HRESULT.ThrowOnFailure(_unmanaged.OpenNamespace(name));
 }
 public void OpenMethod(SymbolToken method)
 {
     HRESULT.ThrowOnFailure(_unmanaged.OpenMethod(method.GetToken()));
 }
        public void Initialize(IntPtr emitter, string filename, bool fFullBuild)
        {
            object objEmitter = Marshal.GetObjectForIUnknown(emitter);

            HRESULT.ThrowOnFailure(_unmanaged.Initialize(objEmitter, filename, null, fFullBuild));
        }
Exemplo n.º 16
0
 public void SetSource(byte[] source)
 {
     HRESULT.ThrowOnFailure(_unmanaged.SetSource(source.Length, source));
 }
Exemplo n.º 17
0
 public void SetCheckSum(Guid algorithmId, byte[] checkSum)
 {
     HRESULT.ThrowOnFailure(_unmanaged.SetCheckSum(algorithmId, checkSum.Length, checkSum));
 }
Exemplo n.º 18
0
 public AssemblyName(string fullName)
 {
     HRESULT.ThrowOnFailure(FusionNative.CreateAssemblyNameObject(out _assemblyName, null, 0, IntPtr.Zero));
     this.FullName = fullName;
 }