提交 99732fd2 编写于 作者: T Tomas Matousek

Add ISymUnmanagedBinder interfaces to Microsoft.DiaSymReader

上级 6fefc866
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Runtime.InteropServices;
namespace Microsoft.DiaSymReader
{
[ComImport]
[Guid("AA544D42-28CB-11d3-BD22-0000F80849BD")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComVisible(false)]
public interface ISymUnmanagedBinder
{
/// <summary>
/// Given a metadata interface and a file name, returns the
/// correct <see cref="ISymUnmanagedReader"/> that will read the debugging symbols
/// associated with the module.
/// </summary>
[PreserveSig]
int GetReaderForFile(
[MarshalAs(UnmanagedType.Interface)]object metadataImporter,
[MarshalAs(UnmanagedType.LPWStr)]string fileName,
[MarshalAs(UnmanagedType.LPWStr)]string searchPath,
[MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader);
/// <summary>
/// Given a metadata interface and a stream that contains
/// the symbol store, returns the <see cref="ISymUnmanagedReader"/>
/// that will read the debugging symbols from the given
/// symbol store.
/// </summary>
[PreserveSig]
int GetReaderFromStream(
[MarshalAs(UnmanagedType.Interface)]object metadataImporter,
[MarshalAs(UnmanagedType.Interface)]object stream,
[MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader);
};
}
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Runtime.InteropServices;
namespace Microsoft.DiaSymReader
{
[ComImport]
[Guid("ACCEE350-89AF-4ccb-8B40-1C2C4C6F9434")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComVisible(false)]
public interface ISymUnmanagedBinder2 : ISymUnmanagedBinder
{
#region ISymUnmanagedBinder methods
/// <summary>
/// Given a metadata interface and a file name, returns the
/// correct <see cref="ISymUnmanagedReader"/> that will read the debugging symbols
/// associated with the module.
/// </summary>
[PreserveSig]
new int GetReaderForFile(
[MarshalAs(UnmanagedType.Interface)]object metadataImporter,
[MarshalAs(UnmanagedType.LPWStr)]string fileName,
[MarshalAs(UnmanagedType.LPWStr)]string searchPath,
[MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader);
/// <summary>
/// Given a metadata interface and a stream that contains
/// the symbol store, returns the <see cref="ISymUnmanagedReader"/>
/// that will read the debugging symbols from the given
/// symbol store.
/// </summary>
[PreserveSig]
new int GetReaderFromStream(
[MarshalAs(UnmanagedType.Interface)]object metadataImporter,
[MarshalAs(UnmanagedType.Interface)]object stream,
[MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader);
#endregion
/// <summary>
/// Given a metadata interface and a file name, returns the
/// <see cref="ISymUnmanagedReader"/> interface that will read the debugging symbols associated
/// with the module.
/// </summary>
/// <remarks>
/// This version of the function can search for the PDB in areas other than
/// right next to the module.
/// The search policy can be controlled by combining CorSymSearchPolicyAttributes
/// e.g AllowReferencePathAccess|AllowSymbolServerAccess will look for the pdb next
/// to the PE file and on a symbol server, but won't query the registry or use the path
/// in the PE file.
/// If a searchPath is provided, those directories will always be searched.
/// </remarks>
[PreserveSig]
int GetReaderForFile2(
[MarshalAs(UnmanagedType.Interface)]object metadataImporter,
[MarshalAs(UnmanagedType.LPWStr)]string fileName,
[MarshalAs(UnmanagedType.LPWStr)]string searchPath,
SymUnmanagedSearchPolicy searchPolicy,
[MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader);
}
}
......@@ -9,8 +9,11 @@
<Import_RootNamespace>Microsoft.DiaSymReader</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)SymUnmanagedSearchPolicy.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymEncUnmanagedMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedAsyncMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedConstant.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedDispose.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedDocument.cs" />
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.DiaSymReader
{
public enum SymUnmanagedSearchPolicy
{
/// <summary>
/// Query the registry for symbol search paths.
/// </summary>
AllowRegistryAccess = 0x1,
/// <summary>
/// Access a symbol server.
/// </summary>
AllowSymbolServerAccess = 0x2,
/// <summary>
/// Look at the path specified in Debug Directory.
/// </summary>
AllowOriginalPathAccess = 0x4,
/// <summary>
/// Look for PDB in the place where the exe is.
/// </summary>
AllowReferencePathAccess = 0x8
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册