Skip to content

Commit 633eca0

Browse files
committed
Add additional interfaces.
1 parent de49394 commit 633eca0

23 files changed

+1993
-100
lines changed

vsinterop/Microsoft/VisualStudio/Setup/Configuration/IEnumSetupInstances.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ public HRESULT Clone(IEnumSetupInstances** ppEnumInstances)
9292
/// Enumerates Visual Studio setup instances.
9393
/// </summary>
9494
/// <remarks>
95-
/// Matches the COM enumeration pattern used throughout Windows APIs.
95+
/// <para>
96+
/// Matches the COM enumeration pattern used throughout Windows APIs.
97+
/// </para>
9698
/// </remarks>
9799
[ComImport]
98100
[Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")]

vsinterop/Microsoft/VisualStudio/Setup/Configuration/ISetupConfiguration.cs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,22 @@ public HRESULT GetInstanceForCurrentProcess(ISetupInstance** ppInstance)
7474
return ((delegate* unmanaged[Stdcall]<ISetupConfiguration*, ISetupInstance**, HRESULT>)_lpVtbl[4])(pThis, ppInstance);
7575
}
7676

77-
/// <inheritdoc cref="Interface.GetInstanceForPath(char*, ISetupInstance**)"/>
78-
public HRESULT GetInstanceForPath(char* path, ISetupInstance** ppInstance)
77+
/// <inheritdoc cref="Interface.GetInstanceForPath(PCWSTR, ISetupInstance**)"/>
78+
public HRESULT GetInstanceForPath(PCWSTR path, ISetupInstance** ppInstance)
7979
{
8080
fixed (ISetupConfiguration* pThis = &this)
81-
return ((delegate* unmanaged[Stdcall]<ISetupConfiguration*, char*, ISetupInstance**, HRESULT>)_lpVtbl[5])(pThis, path, ppInstance);
81+
return ((delegate* unmanaged[Stdcall]<ISetupConfiguration*, PCWSTR, ISetupInstance**, HRESULT>)_lpVtbl[5])(pThis, path, ppInstance);
8282
}
8383

8484
/// <summary>
8585
/// Exposes methods to enumerate and locate Visual Studio instances.
8686
/// </summary>
8787
/// <remarks>
88-
/// See https://learn.microsoft.com/visualstudio/setup/configuration-interface for detailed information.
88+
/// <para>
89+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration">
90+
/// Official documentation.
91+
/// </see>
92+
/// </para>
8993
/// </remarks>
9094
[ComImport]
9195
[Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")]
@@ -95,19 +99,43 @@ public unsafe interface Interface
9599
/// <summary>
96100
/// Gets an enumerator for all installed instances that are normally discoverable.
97101
/// </summary>
102+
/// <remarks>
103+
/// <para>
104+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration.enuminstances">
105+
/// Official documentation.
106+
/// </see>
107+
/// </para>
108+
/// </remarks>
109+
/// <returns>Standard <see cref="HRESULT"/> indicating success or failure.</returns>
98110
[PreserveSig]
99111
HRESULT EnumInstances(IEnumSetupInstances** ppEnumInstances);
100112

101113
/// <summary>
102114
/// Gets the instance for the calling process, if any.
103115
/// </summary>
116+
/// <remarks>
117+
/// <para>
118+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration.getinstanceforcurrentprocess">
119+
/// Official documentation.
120+
/// </see>
121+
/// </para>
122+
/// </remarks>
123+
/// <returns>Standard <see cref="HRESULT"/> indicating success or failure.</returns>
104124
[PreserveSig]
105125
HRESULT GetInstanceForCurrentProcess(ISetupInstance** ppInstance);
106126

107127
/// <summary>
108128
/// Gets the instance that has registered installation information for the specified path.
109129
/// </summary>
130+
/// <remarks>
131+
/// <para>
132+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration.getinstanceforpath">
133+
/// Official documentation.
134+
/// </see>
135+
/// </para>
136+
/// </remarks>
137+
/// <returns>Standard <see cref="HRESULT"/> indicating success or failure.</returns>
110138
[PreserveSig]
111-
HRESULT GetInstanceForPath(char* path, ISetupInstance** ppInstance);
139+
HRESULT GetInstanceForPath(PCWSTR path, ISetupInstance** ppInstance);
112140
}
113141
}

vsinterop/Microsoft/VisualStudio/Setup/Configuration/ISetupConfiguration2.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ public HRESULT GetInstanceForCurrentProcess(ISetupInstance** ppInstance)
7575
}
7676

7777
/// <inheritdoc cref="ISetupConfiguration.Interface.GetInstanceForPath"/>
78-
public HRESULT GetInstanceForPath(char* path, ISetupInstance** ppInstance)
78+
public HRESULT GetInstanceForPath(PCWSTR path, ISetupInstance** ppInstance)
7979
{
8080
fixed (ISetupConfiguration2* pThis = &this)
81-
return ((delegate* unmanaged[Stdcall]<ISetupConfiguration2*, char*, ISetupInstance**, HRESULT>)_lpVtbl[5])(pThis, path, ppInstance);
81+
return ((delegate* unmanaged[Stdcall]<ISetupConfiguration2*, PCWSTR, ISetupInstance**, HRESULT>)_lpVtbl[5])(pThis, path, ppInstance);
8282
}
8383

8484
/// <inheritdoc cref="Interface.EnumAllInstances(IEnumSetupInstances**)"/>
@@ -92,7 +92,14 @@ public HRESULT EnumAllInstances(IEnumSetupInstances** ppEnumInstances)
9292
/// Extends <see cref="ISetupConfiguration"/> to enumerate all Visual Studio instances.
9393
/// </summary>
9494
/// <remarks>
95-
/// Instances returned by this interface may include those that are incomplete or not normally discoverable.
95+
/// <para>
96+
/// Instances returned by this interface may include those that are incomplete or not normally discoverable.
97+
/// </para>
98+
/// <para>
99+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration2">
100+
/// Official documentation.
101+
/// </see>
102+
/// </para>
96103
/// </remarks>
97104
[ComImport]
98105
[Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")]
@@ -109,11 +116,19 @@ public unsafe interface Interface : ISetupConfiguration.Interface
109116

110117
/// <inheritdoc cref="ISetupConfiguration.Interface.GetInstanceForPath"/>
111118
[PreserveSig]
112-
new HRESULT GetInstanceForPath(char* path, ISetupInstance** ppInstance);
119+
new HRESULT GetInstanceForPath(PCWSTR path, ISetupInstance** ppInstance);
113120

114121
/// <summary>
115122
/// Enumerates all instances, including those that may not be discoverable using <see cref="ISetupConfiguration.Interface.EnumInstances"/>.
116123
/// </summary>
124+
/// <remarks>
125+
/// <para>
126+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetupconfiguration2.enumallinstances">
127+
/// Official documentation.
128+
/// </see>
129+
/// </para>
130+
/// </remarks>
131+
/// <returns>Standard <see cref="HRESULT"/> indicating success or failure.</returns>
117132
[PreserveSig]
118133
HRESULT EnumAllInstances(IEnumSetupInstances** ppEnumInstances);
119134
}

vsinterop/Microsoft/VisualStudio/Setup/Configuration/ISetupErrorInfo.cs

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2025 Jeremy W Kuhne
1+
// Copyright (c) 2025 Jeremy W Kuhne
22
// SPDX-License-Identifier: MIT
33
// See LICENSE file in the project root for full license information
44

@@ -60,25 +60,25 @@ public uint Release()
6060
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, uint>)_lpVtbl[2])(pThis);
6161
}
6262

63-
/// <inheritdoc cref="Interface.GetErrorClassName"/>
64-
public HRESULT GetErrorClassName(BSTR* pbstrErrorClassName)
63+
/// <inheritdoc cref="Interface.GetErrorHResult"/>
64+
public HRESULT GetErrorHResult(HRESULT* phrError)
6565
{
6666
fixed (ISetupErrorInfo* pThis = &this)
67-
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, BSTR*, HRESULT>)_lpVtbl[3])(pThis, pbstrErrorClassName);
67+
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, HRESULT*, HRESULT>)_lpVtbl[3])(pThis, phrError);
6868
}
6969

70-
/// <inheritdoc cref="Interface.GetErrorMessage"/>
71-
public HRESULT GetErrorMessage(BSTR* pbstrErrorMessage)
70+
/// <inheritdoc cref="Interface.GetErrorClassName"/>
71+
public HRESULT GetErrorClassName(BSTR* pbstrErrorClassName)
7272
{
7373
fixed (ISetupErrorInfo* pThis = &this)
74-
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, BSTR*, HRESULT>)_lpVtbl[4])(pThis, pbstrErrorMessage);
74+
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, BSTR*, HRESULT>)_lpVtbl[4])(pThis, pbstrErrorClassName);
7575
}
7676

77-
/// <inheritdoc cref="Interface.GetErrorHResult"/>
78-
public HRESULT GetErrorHResult(HRESULT* phrError)
77+
/// <inheritdoc cref="Interface.GetErrorMessage"/>
78+
public HRESULT GetErrorMessage(BSTR* pbstrErrorMessage)
7979
{
8080
fixed (ISetupErrorInfo* pThis = &this)
81-
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, HRESULT*, HRESULT>)_lpVtbl[5])(pThis, phrError);
81+
return ((delegate* unmanaged[Stdcall]<ISetupErrorInfo*, BSTR*, HRESULT>)_lpVtbl[5])(pThis, pbstrErrorMessage);
8282
}
8383

8484
/// <summary>
@@ -88,17 +88,32 @@ public HRESULT GetErrorHResult(HRESULT* phrError)
8888
/// <para>
8989
/// May also implement <see cref="ISetupPropertyStore"/>.
9090
/// </para>
91+
/// <para><see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorinfo"/></para>
9192
/// </remarks>
9293
[ComImport]
9394
[Guid("2A2F3292-958E-4905-B36E-013BE84E27AB")]
9495
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
9596
public unsafe interface Interface
9697
{
98+
/// <summary>
99+
/// Gets the HRESULT of the error.
100+
/// </summary>
101+
/// <param name="phrError">Pointer to receive the error HRESULT.</param>
102+
/// <returns>Standard HRESULT indicating success or failure.</returns>
103+
/// <remarks>
104+
/// <para><see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorinfo.geterrorhresult"/></para>
105+
/// </remarks>
106+
[PreserveSig]
107+
HRESULT GetErrorHResult(HRESULT* phrError);
108+
97109
/// <summary>
98110
/// Gets the class name of the error (exception).
99111
/// </summary>
100112
/// <param name="pbstrErrorClassName">Pointer to receive the error class name.</param>
101-
/// <returns>Standard HRESULT indicating success or failure.</returns>
113+
/// <returns>Standard <see cref="HRESULT"/> indicating success or failure.</returns>
114+
/// <remarks>
115+
/// <para><see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorinfo.geterrorclassname"/></para>
116+
/// </remarks>
102117
[PreserveSig]
103118
HRESULT GetErrorClassName(BSTR* pbstrErrorClassName);
104119

@@ -107,15 +122,10 @@ public unsafe interface Interface
107122
/// </summary>
108123
/// <param name="pbstrErrorMessage">Pointer to receive the error message.</param>
109124
/// <returns>Standard HRESULT indicating success or failure.</returns>
125+
/// <remarks>
126+
/// <para><see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorinfo.geterrormessage"/></para>
127+
/// </remarks>
110128
[PreserveSig]
111129
HRESULT GetErrorMessage(BSTR* pbstrErrorMessage);
112-
113-
/// <summary>
114-
/// Gets the HRESULT of the error.
115-
/// </summary>
116-
/// <param name="phrError">Pointer to receive the error HRESULT.</param>
117-
/// <returns>Standard HRESULT indicating success or failure.</returns>
118-
[PreserveSig]
119-
HRESULT GetErrorHResult(HRESULT* phrError);
120130
}
121131
}

vsinterop/Microsoft/VisualStudio/Setup/Configuration/ISetupErrorState.cs

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2025 Jeremy W Kuhne
1+
// Copyright (c) 2025 Jeremy W Kuhne
22
// SPDX-License-Identifier: MIT
33
// See LICENSE file in the project root for full license information
44

@@ -61,22 +61,29 @@ public uint Release()
6161
}
6262

6363
/// <inheritdoc cref="Interface.GetFailedPackages"/>
64-
public HRESULT GetFailedPackages(uint* pcFailedPackages, ISetupFailedPackageReference*** pppFailedPackages)
64+
public HRESULT GetFailedPackages(SAFEARRAY** ppsaFailedPackages)
6565
{
6666
fixed (ISetupErrorState* pThis = &this)
67-
return ((delegate* unmanaged[Stdcall]<ISetupErrorState*, uint*, ISetupFailedPackageReference***, HRESULT>)_lpVtbl[3])(pThis, pcFailedPackages, pppFailedPackages);
67+
return ((delegate* unmanaged[Stdcall]<ISetupErrorState*, SAFEARRAY**, HRESULT>)_lpVtbl[3])(pThis, ppsaFailedPackages);
6868
}
6969

7070
/// <inheritdoc cref="Interface.GetSkippedPackages"/>
71-
public HRESULT GetSkippedPackages(uint* pcSkippedPackages, ISetupPackageReference*** pppSkippedPackages)
71+
public HRESULT GetSkippedPackages(SAFEARRAY** ppsaSkippedPackages)
7272
{
7373
fixed (ISetupErrorState* pThis = &this)
74-
return ((delegate* unmanaged[Stdcall]<ISetupErrorState*, uint*, ISetupPackageReference***, HRESULT>)_lpVtbl[4])(pThis, pcSkippedPackages, pppSkippedPackages);
74+
return ((delegate* unmanaged[Stdcall]<ISetupErrorState*, SAFEARRAY**, HRESULT>)_lpVtbl[4])(pThis, ppsaSkippedPackages);
7575
}
7676

7777
/// <summary>
7878
/// Information about the error state of an instance.
7979
/// </summary>
80+
/// <remarks>
81+
/// <para>
82+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate">
83+
/// Official documentation.
84+
/// </see>
85+
/// </para>
86+
/// </remarks>
8087
[ComImport]
8188
[Guid("46DCCD94-A287-476A-851E-DFBC2FFDBC20")]
8289
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
@@ -85,19 +92,33 @@ public unsafe interface Interface
8592
/// <summary>
8693
/// Gets an array of failed package references.
8794
/// </summary>
88-
/// <param name="pcFailedPackages">Pointer to receive the number of failed packages.</param>
89-
/// <param name="pppFailedPackages">Pointer to receive an array of failed package reference pointers.</param>
95+
/// <param name="ppsaFailedPackages">
96+
/// Pointer to an array of <see cref="ISetupFailedPackageReference"/>, if packages have failed.
97+
/// </param>
98+
/// <remarks>
99+
/// <para>
100+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate.getfailedpackages">
101+
/// Official documentation.
102+
/// </see>
103+
/// </para>
104+
/// </remarks>
90105
/// <returns>Standard HRESULT indicating success or failure.</returns>
91106
[PreserveSig]
92-
HRESULT GetFailedPackages(uint* pcFailedPackages, ISetupFailedPackageReference*** pppFailedPackages);
107+
HRESULT GetFailedPackages(SAFEARRAY** ppsaFailedPackages);
93108

94109
/// <summary>
95110
/// Gets an array of skipped package references.
96111
/// </summary>
97-
/// <param name="pcSkippedPackages">Pointer to receive the number of skipped packages.</param>
98-
/// <param name="pppSkippedPackages">Pointer to receive an array of skipped package reference pointers.</param>
112+
/// <param name="ppsaSkippedPackages">Pointer to an array of <see cref="ISetupPackageReference"/>, if packages have been skipped.</param>
113+
/// <remarks>
114+
/// <para>
115+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate.getskippedpackages">
116+
/// Official documentation.
117+
/// </see>
118+
/// </para>
119+
/// </remarks>
99120
/// <returns>Standard HRESULT indicating success or failure.</returns>
100121
[PreserveSig]
101-
HRESULT GetSkippedPackages(uint* pcSkippedPackages, ISetupPackageReference*** pppSkippedPackages);
122+
HRESULT GetSkippedPackages(SAFEARRAY** ppsaSkippedPackages);
102123
}
103124
}

vsinterop/Microsoft/VisualStudio/Setup/Configuration/ISetupErrorState2.cs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2025 Jeremy W Kuhne
1+
// Copyright (c) 2025 Jeremy W Kuhne
22
// SPDX-License-Identifier: MIT
33
// See LICENSE file in the project root for full license information
44

@@ -61,17 +61,17 @@ public uint Release()
6161
}
6262

6363
/// <inheritdoc cref="ISetupErrorState.Interface.GetFailedPackages"/>
64-
public HRESULT GetFailedPackages(uint* pcFailedPackages, ISetupFailedPackageReference*** pppFailedPackages)
64+
public HRESULT GetFailedPackages(SAFEARRAY** ppsaFailedPackages)
6565
{
6666
fixed (ISetupErrorState2* pThis = &this)
67-
return ((delegate* unmanaged[Stdcall]<ISetupErrorState2*, uint*, ISetupFailedPackageReference***, HRESULT>)_lpVtbl[3])(pThis, pcFailedPackages, pppFailedPackages);
67+
return ((delegate* unmanaged[Stdcall]<ISetupErrorState2*, SAFEARRAY**, HRESULT>)_lpVtbl[3])(pThis, ppsaFailedPackages);
6868
}
6969

7070
/// <inheritdoc cref="ISetupErrorState.Interface.GetSkippedPackages"/>
71-
public HRESULT GetSkippedPackages(uint* pcSkippedPackages, ISetupPackageReference*** pppSkippedPackages)
71+
public HRESULT GetSkippedPackages(SAFEARRAY** ppsaSkippedPackages)
7272
{
7373
fixed (ISetupErrorState2* pThis = &this)
74-
return ((delegate* unmanaged[Stdcall]<ISetupErrorState2*, uint*, ISetupPackageReference***, HRESULT>)_lpVtbl[4])(pThis, pcSkippedPackages, pppSkippedPackages);
74+
return ((delegate* unmanaged[Stdcall]<ISetupErrorState2*, SAFEARRAY**, HRESULT>)_lpVtbl[4])(pThis, ppsaSkippedPackages);
7575
}
7676

7777
/// <inheritdoc cref="Interface.GetErrorLogFilePath"/>
@@ -91,23 +91,37 @@ public HRESULT GetLogFilePath(BSTR* pbstrLogFilePath)
9191
/// <summary>
9292
/// Information about the error state of an instance.
9393
/// </summary>
94+
/// <remarks>
95+
/// <para>
96+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate2">
97+
/// Official documentation.
98+
/// </see>
99+
/// </para>
100+
/// </remarks>
94101
[ComImport]
95102
[Guid("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF")]
96103
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
97104
public unsafe interface Interface : ISetupErrorState.Interface
98105
{
99106
/// <inheritdoc cref="ISetupErrorState.Interface.GetFailedPackages"/>
100107
[PreserveSig]
101-
new HRESULT GetFailedPackages(uint* pcFailedPackages, ISetupFailedPackageReference*** pppFailedPackages);
108+
new HRESULT GetFailedPackages(SAFEARRAY** ppsaFailedPackages);
102109

103110
/// <inheritdoc cref="ISetupErrorState.Interface.GetSkippedPackages"/>
104111
[PreserveSig]
105-
new HRESULT GetSkippedPackages(uint* pcSkippedPackages, ISetupPackageReference*** pppSkippedPackages);
112+
new HRESULT GetSkippedPackages(SAFEARRAY** ppsaSkippedPackages);
106113

107114
/// <summary>
108115
/// Gets the path to the error log.
109116
/// </summary>
110117
/// <param name="pbstrErrorLogFilePath">Pointer to receive the error log file path.</param>
118+
/// <remarks>
119+
/// <para>
120+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate2.geterrorlogfilepath">
121+
/// Official documentation.
122+
/// </see>
123+
/// </para>
124+
/// </remarks>
111125
/// <returns>Standard HRESULT indicating success or failure.</returns>
112126
[PreserveSig]
113127
HRESULT GetErrorLogFilePath(BSTR* pbstrErrorLogFilePath);
@@ -116,6 +130,13 @@ public unsafe interface Interface : ISetupErrorState.Interface
116130
/// Gets the path to the main setup log.
117131
/// </summary>
118132
/// <param name="pbstrLogFilePath">Pointer to receive the main log file path.</param>
133+
/// <remarks>
134+
/// <para>
135+
/// <see href="https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.setup.configuration.isetuperrorstate2.getlogfilepath">
136+
/// Official documentation.
137+
/// </see>
138+
/// </para>
139+
/// </remarks>
119140
/// <returns>Standard HRESULT indicating success or failure.</returns>
120141
[PreserveSig]
121142
HRESULT GetLogFilePath(BSTR* pbstrLogFilePath);

0 commit comments

Comments
 (0)