|
| 1 | +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. |
| 2 | + |
| 3 | +using System; |
| 4 | +using System.Runtime.InteropServices; |
| 5 | +using System.Runtime.InteropServices.ComTypes; |
| 6 | + |
| 7 | +namespace Microsoft.DiaSymReader |
| 8 | +{ |
| 9 | + [ComImport] |
| 10 | + [Guid("6576c987-7e8d-4298-a6e1-6f9783165f07")] |
| 11 | + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] |
| 12 | + [ComVisible(false)] |
| 13 | + public interface ISymUnmanagedReader5 : ISymUnmanagedReader4 |
| 14 | + { |
| 15 | + #region ISymUnmanagedReader methods |
| 16 | + |
| 17 | + [PreserveSig] |
| 18 | + new int GetDocument( |
| 19 | + [MarshalAs(UnmanagedType.LPWStr)] string url, |
| 20 | + Guid language, |
| 21 | + Guid languageVendor, |
| 22 | + Guid documentType, |
| 23 | + [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedDocument document); |
| 24 | + |
| 25 | + [PreserveSig] |
| 26 | + new int GetDocuments( |
| 27 | + int bufferLength, |
| 28 | + out int count, |
| 29 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedDocument[] documents); |
| 30 | + |
| 31 | + [PreserveSig] |
| 32 | + new int GetUserEntryPoint(out int methodToken); |
| 33 | + |
| 34 | + [PreserveSig] |
| 35 | + new int GetMethod(int methodToken, [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod method); |
| 36 | + |
| 37 | + [PreserveSig] |
| 38 | + new int GetMethodByVersion( |
| 39 | + int methodToken, |
| 40 | + int version, |
| 41 | + [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod method); |
| 42 | + |
| 43 | + [PreserveSig] |
| 44 | + new int GetVariables( |
| 45 | + int methodToken, |
| 46 | + int bufferLength, |
| 47 | + out int count, |
| 48 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ISymUnmanagedVariable[] variables); |
| 49 | + |
| 50 | + [PreserveSig] |
| 51 | + new int GetGlobalVariables( |
| 52 | + int bufferLength, |
| 53 | + out int count, |
| 54 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedVariable[] variables); |
| 55 | + |
| 56 | + [PreserveSig] |
| 57 | + new int GetMethodFromDocumentPosition( |
| 58 | + ISymUnmanagedDocument document, |
| 59 | + int line, |
| 60 | + int column, |
| 61 | + [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod method); |
| 62 | + |
| 63 | + [PreserveSig] |
| 64 | + new int GetSymAttribute( |
| 65 | + int methodToken, |
| 66 | + [MarshalAs(UnmanagedType.LPWStr)] string name, |
| 67 | + int bufferLength, |
| 68 | + out int count, |
| 69 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] customDebugInformation); |
| 70 | + |
| 71 | + [PreserveSig] |
| 72 | + new int GetNamespaces( |
| 73 | + int bufferLength, |
| 74 | + out int count, |
| 75 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedNamespace[] namespaces); |
| 76 | + |
| 77 | + [PreserveSig] |
| 78 | + new int Initialize( |
| 79 | + [MarshalAs(UnmanagedType.Interface)] object metadataImporter, |
| 80 | + [MarshalAs(UnmanagedType.LPWStr)] string fileName, |
| 81 | + [MarshalAs(UnmanagedType.LPWStr)] string searchPath, |
| 82 | + IStream stream); |
| 83 | + |
| 84 | + [PreserveSig] |
| 85 | + new int UpdateSymbolStore([MarshalAs(UnmanagedType.LPWStr)] string fileName, IStream stream); |
| 86 | + |
| 87 | + [PreserveSig] |
| 88 | + new int ReplaceSymbolStore([MarshalAs(UnmanagedType.LPWStr)] string fileName, IStream stream); |
| 89 | + |
| 90 | + [PreserveSig] |
| 91 | + new int GetSymbolStoreFileName( |
| 92 | + int bufferLength, |
| 93 | + out int count, |
| 94 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] char[] name); |
| 95 | + |
| 96 | + [PreserveSig] |
| 97 | + new int GetMethodsFromDocumentPosition( |
| 98 | + ISymUnmanagedDocument document, |
| 99 | + int line, |
| 100 | + int column, |
| 101 | + int bufferLength, |
| 102 | + out int count, |
| 103 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] ISymUnmanagedMethod[] methods); |
| 104 | + |
| 105 | + [PreserveSig] |
| 106 | + new int GetDocumentVersion(ISymUnmanagedDocument document, out int version, [MarshalAs(UnmanagedType.Bool)]out bool isCurrent); |
| 107 | + |
| 108 | + [PreserveSig] |
| 109 | + new int GetMethodVersion(ISymUnmanagedMethod method, out int version); |
| 110 | + |
| 111 | + #endregion |
| 112 | + |
| 113 | + #region ISymUnmanagedReader2 methods |
| 114 | + |
| 115 | + [PreserveSig] |
| 116 | + new int GetMethodByVersionPreRemap( |
| 117 | + int methodToken, |
| 118 | + int version, |
| 119 | + [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod method); |
| 120 | + |
| 121 | + [PreserveSig] |
| 122 | + new int GetSymAttributePreRemap( |
| 123 | + int methodToken, |
| 124 | + [MarshalAs(UnmanagedType.LPWStr)] string name, |
| 125 | + int bufferLength, |
| 126 | + out int count, |
| 127 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] customDebugInformation); |
| 128 | + |
| 129 | + [PreserveSig] |
| 130 | + new int GetMethodsInDocument( |
| 131 | + ISymUnmanagedDocument document, |
| 132 | + int bufferLength, |
| 133 | + out int count, |
| 134 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ISymUnmanagedMethod[] methods); |
| 135 | + |
| 136 | + #endregion |
| 137 | + |
| 138 | + #region ISymUnmanagedReader3 methods |
| 139 | + |
| 140 | + /// <summary> |
| 141 | + /// Gets a custom debug information based upon its name and an EnC 1-based version number. |
| 142 | + /// </summary> |
| 143 | + [PreserveSig] |
| 144 | + new int GetSymAttributeByVersion( |
| 145 | + int methodToken, |
| 146 | + int version, |
| 147 | + [MarshalAs(UnmanagedType.LPWStr)] string name, |
| 148 | + int bufferLength, |
| 149 | + out int count, |
| 150 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] customDebugInformation); |
| 151 | + |
| 152 | + /// <summary> |
| 153 | + /// Gets a custom debug information based upon its name and an EnC 1-based version number. |
| 154 | + /// </summary> |
| 155 | + [PreserveSig] |
| 156 | + new int GetSymAttributeByVersionPreRemap( |
| 157 | + int methodToken, |
| 158 | + int version, |
| 159 | + [MarshalAs(UnmanagedType.LPWStr)] string name, |
| 160 | + int bufferLength, |
| 161 | + out int count, |
| 162 | + [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] customDebugInformation); |
| 163 | + |
| 164 | + #endregion |
| 165 | + |
| 166 | + #region ISymUnmanagedReader4 methods |
| 167 | + |
| 168 | + /// <summary> |
| 169 | + /// Checkes whether the id stored in the PDB matches the PDB ID stored in the PE/COFF Debug Directory. |
| 170 | + /// </summary> |
| 171 | + [PreserveSig] |
| 172 | + new int MatchesModule(Guid guid, uint stamp, int age, [MarshalAs(UnmanagedType.Bool)]out bool result); |
| 173 | + |
| 174 | + /// <summary> |
| 175 | + /// Returns a pointer to Portable Debug Metadata. Only available for Portable PDBs. |
| 176 | + /// </summary> |
| 177 | + /// <param name="metadata"> |
| 178 | + /// A pointer to memory where Portable Debug Metadata start. The memory is owned by the SymReader and |
| 179 | + /// valid until <see cref="ISymUnmanagedDispose.Destroy"/> is invoked. |
| 180 | + /// |
| 181 | + /// Null if the PDB is not portable. |
| 182 | + /// </param> |
| 183 | + /// <param name="size">Size of the metadata block.</param> |
| 184 | + /// <returns> |
| 185 | + /// S_OK if the PDB is portable, S_FALSE if it isn't. |
| 186 | + /// </returns> |
| 187 | + /// <remarks> |
| 188 | + /// If the store was updated via <see cref="UpdateSymbolStore(string, IStream)"/> |
| 189 | + /// returns the metadata of the latest update. |
| 190 | + /// </remarks> |
| 191 | + [PreserveSig] |
| 192 | + new unsafe int GetPortableDebugMetadata(out byte* metadata, out int size); |
| 193 | + |
| 194 | + /// <summary> |
| 195 | + /// Returns a pointer to Source Server data stored in the PDB. |
| 196 | + /// </summary> |
| 197 | + /// <param name="data"> |
| 198 | + /// A pointer to memory where Source Server data start. The memory is owned by the SymReader and |
| 199 | + /// valid until <see cref="ISymUnmanagedDispose.Destroy"/> is invoked. |
| 200 | + /// |
| 201 | + /// Null if the PDB doesn't contain Source Server data. |
| 202 | + /// </param> |
| 203 | + /// <param name="size">Size of the data in bytes.</param> |
| 204 | + /// <returns> |
| 205 | + /// S_OK if the PDB contains Source Server data, S_FALSE if it doesn't. |
| 206 | + /// </returns> |
| 207 | + [PreserveSig] |
| 208 | + new unsafe int GetSourceServerData(out byte* data, out int size); |
| 209 | + |
| 210 | + #endregion |
| 211 | + |
| 212 | + #region ISymUnmanagedReader5 methods |
| 213 | + |
| 214 | + /// <summary> |
| 215 | + /// Returns a pointer to Portable Debug Metadata of the specified version (EnC generation). Only available for Portable PDBs. |
| 216 | + /// </summary> |
| 217 | + /// <param name="version"> |
| 218 | + /// EnC 1-based version number. Version 1 corresponds to the baseline. |
| 219 | + /// </param> |
| 220 | + /// <param name="metadata"> |
| 221 | + /// A pointer to memory where Portable Debug Metadata start. The memory is owned by the SymReader and |
| 222 | + /// valid until <see cref="ISymUnmanagedDispose.Destroy"/> is invoked. |
| 223 | + /// |
| 224 | + /// Null if the PDB is not portable. |
| 225 | + /// </param> |
| 226 | + /// <param name="size">Size of the metadata block.</param> |
| 227 | + [PreserveSig] |
| 228 | + unsafe int GetPortableDebugMetadataByVersion(int version, out byte* metadata, out int size); |
| 229 | + |
| 230 | + #endregion |
| 231 | + } |
| 232 | +} |
0 commit comments