Files
docker-wine-dotnet/VisualStudioMock/ISetupInstance.cs
Roman Vanicek 36fe0d3bf2
Some checks failed
continuous-integration/drone/push Build is failing
Fully working COM to COM marshalling within .NET process
2025-02-05 23:04:10 +01:00

66 lines
2.7 KiB
C#

using System;
using System.Runtime.InteropServices;
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
namespace VisualStudioMock
{
/// <summary>
/// Information about an instance of a product.
/// </summary>
/// <remarks>
/// You can enumerate all properties of basic types by casting to an <see cref="ISetupPropertyStore" />.
/// </remarks>
[ComImport]
[Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[TypeIdentifier]
[ComVisible(true)]
public interface ISetupInstance
{
/// <summary>
/// Gets the instance identifier (should match the name of the parent instance directory).
/// </summary>
/// <returns>The instance identifier.</returns>
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstanceId();
/// <summary>
/// Gets the local date and time when the installation was originally installed.
/// </summary>
[return: MarshalAs(UnmanagedType.Struct)]
System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate();
/// <summary>
/// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.
/// </summary>
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationName();
/// <summary>
/// Gets the path to the installation root of the product.
/// </summary>
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationPath();
/// <summary>
/// Gets the version of the product installed in this instance.
/// </summary>
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationVersion();
/// <summary>
/// Gets the display name (title) of the product installed in this instance.
/// </summary>
/// <param name="lcid">The LCID for the display name.</param>
[return: MarshalAs(UnmanagedType.BStr)]
string GetDisplayName([In][MarshalAs(UnmanagedType.U4)] int lcid = 0);
/// <summary>
/// Gets the description of the product installed in this instance.
/// </summary>
/// <param name="lcid">The LCID for the description.</param>
[return: MarshalAs(UnmanagedType.BStr)]
string GetDescription([In][MarshalAs(UnmanagedType.U4)] int lcid = 0);
/// <summary>
/// Resolves the optional relative path to the root path of the instance.
/// </summary>
/// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>
/// <returns>The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash.</returns>
[return: MarshalAs(UnmanagedType.BStr)]
string ResolvePath([In][MarshalAs(UnmanagedType.LPWStr)] string pwszRelativePath = null);
}
}