authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-09 14:03:39-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-09 14:04:38-07:00
log4d10fbef10f79334b866c0f52f802c203ef9690c
treea5d1a61ead6bfaaff47ce061d7006c9f1621840b
parente0d5ae75af98cf38cab701cd4d915ca53cb48684

windows_com: add missing __CRT_UUID_DECL() for IEnumSetupInstances

This is intended to fix this error: lld-link: error: undefined symbol: _GUID const& __mingw_uuidof<IEnumSetupInstances>() >>> referenced by D:\a\1\s\src\windows_com.hpp:898 >>> D:\a\1\s\zig-cache\o\a5030d467932f0ce2f6511feb7d6af12\windows_sdk.obj:(__IEnumSetupInstances_IID_getter()) Thank you to Martin Storsjö for suggesting the fix.

1 files changed, 909 insertions(+), 904 deletions(-)

src/windows_com.hpp+909-904
......@@ -1,904 +1,909 @@
1// The MIT License(MIT)
2// Copyright(C) Microsoft Corporation.All rights reserved.
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files(the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions :
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20// IN THE SOFTWARE.
21//
22
23#pragma once
24
25// Windows headers
26#include <windows.h>
27#include <fcntl.h>
28#include <io.h>
29#include <shellapi.h>
30
31// Standard headers
32#include <stdio.h>
33
34// COM support header files
35#include <comdef.h>
36
37// Constants
38//
39#ifndef E_NOTFOUND
40#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
41#endif
42
43#ifndef E_FILENOTFOUND
44#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
45#endif
46
47#ifndef E_NOTSUPPORTED
48#define E_NOTSUPPORTED HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
49#endif
50
51// Enumerations
52//
53/// <summary>
54/// The state of an instance.
55/// </summary>
56enum InstanceState
57{
58 /// <summary>
59 /// The instance state has not been determined.
60 /// </summary>
61 eNone = 0,
62
63 /// <summary>
64 /// The instance installation path exists.
65 /// </summary>
66 eLocal = 1,
67
68 /// <summary>
69 /// A product is registered to the instance.
70 /// </summary>
71 eRegistered = 2,
72
73 /// <summary>
74 /// No reboot is required for the instance.
75 /// </summary>
76 eNoRebootRequired = 4,
77
78 /// <summary>
79 /// No errors were reported for the instance.
80 /// </summary>
81 eNoErrors = 8,
82
83 /// <summary>
84 /// The instance represents a complete install.
85 /// </summary>
86 eComplete = UINT_MAX,
87};
88
89// Forward interface declarations
90//
91#ifndef __ISetupInstance_FWD_DEFINED__
92#define __ISetupInstance_FWD_DEFINED__
93typedef struct ISetupInstance ISetupInstance;
94#endif
95
96#ifndef __ISetupInstance2_FWD_DEFINED__
97#define __ISetupInstance2_FWD_DEFINED__
98typedef struct ISetupInstance2 ISetupInstance2;
99#endif
100
101#ifndef __ISetupInstanceCatalog_FWD_DEFINED__
102#define __ISetupInstanceCatalog_FWD_DEFINED__
103typedef struct ISetupInstanceCatalog ISetupInstanceCatalog;
104#endif
105
106#ifndef __ISetupLocalizedProperties_FWD_DEFINED__
107#define __ISetupLocalizedProperties_FWD_DEFINED__
108typedef struct ISetupLocalizedProperties ISetupLocalizedProperties;
109#endif
110
111#ifndef __IEnumSetupInstances_FWD_DEFINED__
112#define __IEnumSetupInstances_FWD_DEFINED__
113typedef struct IEnumSetupInstances IEnumSetupInstances;
114#endif
115
116#ifndef __ISetupConfiguration_FWD_DEFINED__
117#define __ISetupConfiguration_FWD_DEFINED__
118typedef struct ISetupConfiguration ISetupConfiguration;
119#endif
120
121#ifndef __ISetupConfiguration2_FWD_DEFINED__
122#define __ISetupConfiguration2_FWD_DEFINED__
123typedef struct ISetupConfiguration2 ISetupConfiguration2;
124#endif
125
126#ifndef __ISetupPackageReference_FWD_DEFINED__
127#define __ISetupPackageReference_FWD_DEFINED__
128typedef struct ISetupPackageReference ISetupPackageReference;
129#endif
130
131#ifndef __ISetupHelper_FWD_DEFINED__
132#define __ISetupHelper_FWD_DEFINED__
133typedef struct ISetupHelper ISetupHelper;
134#endif
135
136#ifndef __ISetupErrorState_FWD_DEFINED__
137#define __ISetupErrorState_FWD_DEFINED__
138typedef struct ISetupErrorState ISetupErrorState;
139#endif
140
141#ifndef __ISetupErrorState2_FWD_DEFINED__
142#define __ISetupErrorState2_FWD_DEFINED__
143typedef struct ISetupErrorState2 ISetupErrorState2;
144#endif
145
146#ifndef __ISetupFailedPackageReference_FWD_DEFINED__
147#define __ISetupFailedPackageReference_FWD_DEFINED__
148typedef struct ISetupFailedPackageReference ISetupFailedPackageReference;
149#endif
150
151#ifndef __ISetupFailedPackageReference2_FWD_DEFINED__
152#define __ISetupFailedPackageReference2_FWD_DEFINED__
153typedef struct ISetupFailedPackageReference2 ISetupFailedPackageReference2;
154#endif
155
156#ifndef __ISetupPropertyStore_FWD_DEFINED__
157#define __ISetupPropertyStore_FWD_DEFINED__
158typedef struct ISetupPropertyStore ISetupPropertyStore;
159#endif
160
161#ifndef __ISetupLocalizedPropertyStore_FWD_DEFINED__
162#define __ISetupLocalizedPropertyStore_FWD_DEFINED__
163typedef struct ISetupLocalizedPropertyStore ISetupLocalizedPropertyStore;
164#endif
165
166// Forward class declarations
167//
168#ifndef __SetupConfiguration_FWD_DEFINED__
169#define __SetupConfiguration_FWD_DEFINED__
170
171#ifdef __cplusplus
172typedef class SetupConfiguration SetupConfiguration;
173#endif
174
175#endif
176
177#ifndef _MSC_VER
178#define _Deref_out_opt_
179#endif
180
181#ifdef __cplusplus
182extern "C" {
183#endif
184
185 // Interface definitions
186 //
187 EXTERN_C const IID IID_ISetupInstance;
188
189#if defined(__cplusplus) && !defined(CINTERFACE)
190 /// <summary>
191 /// Information about an instance of a product.
192 /// </summary>
193 struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown
194 {
195 /// <summary>
196 /// Gets the instance identifier (should match the name of the parent instance directory).
197 /// </summary>
198 /// <param name="pbstrInstanceId">The instance identifier.</param>
199 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
200 STDMETHOD(GetInstanceId)(
201 _Out_ BSTR* pbstrInstanceId
202 ) = 0;
203
204 /// <summary>
205 /// Gets the local date and time when the installation was originally installed.
206 /// </summary>
207 /// <param name="pInstallDate">The local date and time when the installation was originally installed.</param>
208 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
209 STDMETHOD(GetInstallDate)(
210 _Out_ LPFILETIME pInstallDate
211 ) = 0;
212
213 /// <summary>
214 /// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.
215 /// </summary>
216 /// <param name="pbstrInstallationName">The unique name of the installation, often indicating the branch and other information used for telemetry.</param>
217 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
218 STDMETHOD(GetInstallationName)(
219 _Out_ BSTR* pbstrInstallationName
220 ) = 0;
221
222 /// <summary>
223 /// Gets the path to the installation root of the product.
224 /// </summary>
225 /// <param name="pbstrInstallationPath">The path to the installation root of the product.</param>
226 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
227 STDMETHOD(GetInstallationPath)(
228 _Out_ BSTR* pbstrInstallationPath
229 ) = 0;
230
231 /// <summary>
232 /// Gets the version of the product installed in this instance.
233 /// </summary>
234 /// <param name="pbstrInstallationVersion">The version of the product installed in this instance.</param>
235 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
236 STDMETHOD(GetInstallationVersion)(
237 _Out_ BSTR* pbstrInstallationVersion
238 ) = 0;
239
240 /// <summary>
241 /// Gets the display name (title) of the product installed in this instance.
242 /// </summary>
243 /// <param name="lcid">The LCID for the display name.</param>
244 /// <param name="pbstrDisplayName">The display name (title) of the product installed in this instance.</param>
245 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
246 STDMETHOD(GetDisplayName)(
247 _In_ LCID lcid,
248 _Out_ BSTR* pbstrDisplayName
249 ) = 0;
250
251 /// <summary>
252 /// Gets the description of the product installed in this instance.
253 /// </summary>
254 /// <param name="lcid">The LCID for the description.</param>
255 /// <param name="pbstrDescription">The description of the product installed in this instance.</param>
256 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
257 STDMETHOD(GetDescription)(
258 _In_ LCID lcid,
259 _Out_ BSTR* pbstrDescription
260 ) = 0;
261
262 /// <summary>
263 /// Resolves the optional relative path to the root path of the instance.
264 /// </summary>
265 /// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>
266 /// <param name="pbstrAbsolutePath">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.</param>
267 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
268 STDMETHOD(ResolvePath)(
269 _In_opt_z_ LPCOLESTR pwszRelativePath,
270 _Out_ BSTR* pbstrAbsolutePath
271 ) = 0;
272 };
273#endif
274
275 EXTERN_C const IID IID_ISetupInstance2;
276
277#if defined(__cplusplus) && !defined(CINTERFACE)
278 /// <summary>
279 /// Information about an instance of a product.
280 /// </summary>
281 struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance
282 {
283 /// <summary>
284 /// Gets the state of the instance.
285 /// </summary>
286 /// <param name="pState">The state of the instance.</param>
287 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
288 STDMETHOD(GetState)(
289 _Out_ InstanceState* pState
290 ) = 0;
291
292 /// <summary>
293 /// Gets an array of package references registered to the instance.
294 /// </summary>
295 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>.</param>
296 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
297 STDMETHOD(GetPackages)(
298 _Out_ LPSAFEARRAY* ppsaPackages
299 ) = 0;
300
301 /// <summary>
302 /// Gets a pointer to the <see cref="ISetupPackageReference"/> that represents the registered product.
303 /// </summary>
304 /// <param name="ppPackage">Pointer to an instance of <see cref="ISetupPackageReference"/>. This may be NULL if <see cref="GetState"/> does not return <see cref="eComplete"/>.</param>
305 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
306 STDMETHOD(GetProduct)(
307 _Outptr_result_maybenull_ ISetupPackageReference** ppPackage
308 ) = 0;
309
310 /// <summary>
311 /// Gets the relative path to the product application, if available.
312 /// </summary>
313 /// <param name="pbstrProductPath">The relative path to the product application, if available.</param>
314 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
315 STDMETHOD(GetProductPath)(
316 _Outptr_result_maybenull_ BSTR* pbstrProductPath
317 ) = 0;
318
319 /// <summary>
320 /// Gets the error state of the instance, if available.
321 /// </summary>
322 /// <param name="pErrorState">The error state of the instance, if available.</param>
323 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
324 STDMETHOD(GetErrors)(
325 _Outptr_result_maybenull_ ISetupErrorState** ppErrorState
326 ) = 0;
327
328 /// <summary>
329 /// Gets a value indicating whether the instance can be launched.
330 /// </summary>
331 /// <param name="pfIsLaunchable">Whether the instance can be launched.</param>
332 /// <returns>Standard HRESULT indicating success or failure.</returns>
333 /// <remarks>
334 /// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will.
335 /// </remarks>
336 STDMETHOD(IsLaunchable)(
337 _Out_ VARIANT_BOOL* pfIsLaunchable
338 ) = 0;
339
340 /// <summary>
341 /// Gets a value indicating whether the instance is complete.
342 /// </summary>
343 /// <param name="pfIsLaunchable">Whether the instance is complete.</param>
344 /// <returns>Standard HRESULT indicating success or failure.</returns>
345 /// <remarks>
346 /// An instance is complete if it had no errors during install, resume, or repair.
347 /// </remarks>
348 STDMETHOD(IsComplete)(
349 _Out_ VARIANT_BOOL* pfIsComplete
350 ) = 0;
351
352 /// <summary>
353 /// Gets product-specific properties.
354 /// </summary>
355 /// <param name="ppProperties">A pointer to an instance of <see cref="ISetupPropertyStore"/>. This may be NULL if no properties are defined.</param>
356 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
357 STDMETHOD(GetProperties)(
358 _Outptr_result_maybenull_ ISetupPropertyStore** ppProperties
359 ) = 0;
360
361 /// <summary>
362 /// Gets the directory path to the setup engine that installed the instance.
363 /// </summary>
364 /// <param name="pbstrEnginePath">The directory path to the setup engine that installed the instance.</param>
365 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
366 STDMETHOD(GetEnginePath)(
367 _Outptr_result_maybenull_ BSTR* pbstrEnginePath
368 ) = 0;
369 };
370#endif
371
372 EXTERN_C const IID IID_ISetupInstanceCatalog;
373
374#if defined(__cplusplus) && !defined(CINTERFACE)
375 /// <summary>
376 /// Information about a catalog used to install an instance.
377 /// </summary>
378 struct DECLSPEC_UUID("9AD8E40F-39A2-40F1-BF64-0A6C50DD9EEB") DECLSPEC_NOVTABLE ISetupInstanceCatalog : public IUnknown
379 {
380 /// <summary>
381 /// Gets catalog information properties.
382 /// </summary>
383 /// <param name="ppCatalogInfo">A pointer to an instance of <see cref="ISetupPropertyStore"/>.</param>
384 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property does not exist.</returns>
385 STDMETHOD(GetCatalogInfo)(
386 _Out_ ISetupPropertyStore** ppCatalogInfo
387 ) = 0;
388
389 /// <summary>
390 /// Gets a value indicating whether the catalog is a prerelease.
391 /// </summary>
392 /// <param name="pfIsPrerelease">Whether the catalog for the instance is a prerelease version.</param>
393 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property does not exist.</returns>
394 STDMETHOD(IsPrerelease)(
395 _Out_ VARIANT_BOOL* pfIsPrerelease
396 ) = 0;
397 };
398#endif
399
400 EXTERN_C const IID IID_ISetupLocalizedProperties;
401
402#if defined(__cplusplus) && !defined(CINTERFACE)
403 /// <summary>
404 /// Provides localized properties of an instance of a product.
405 /// </summary>
406 struct DECLSPEC_UUID("F4BD7382-FE27-4AB4-B974-9905B2A148B0") DECLSPEC_NOVTABLE ISetupLocalizedProperties : public IUnknown
407 {
408 /// <summary>
409 /// Gets localized product-specific properties.
410 /// </summary>
411 /// <param name="ppLocalizedProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no properties are defined.</param>
412 /// <returns>Standard HRESULT indicating success or failure.</returns>
413 STDMETHOD(GetLocalizedProperties)(
414 _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedProperties
415 ) = 0;
416
417 /// <summary>
418 /// Gets localized channel-specific properties.
419 /// </summary>
420 /// <param name="ppLocalizedChannelProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no channel properties are defined.</param>
421 /// <returns>Standard HRESULT indicating success or failure.</returns>
422 STDMETHOD(GetLocalizedChannelProperties)(
423 _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedChannelProperties
424 ) = 0;
425 };
426#endif
427
428 EXTERN_C const IID IID_IEnumSetupInstances;
429
430#if defined(__cplusplus) && !defined(CINTERFACE)
431 /// <summary>
432 /// An enumerator of installed <see cref="ISetupInstance"/> objects.
433 /// </summary>
434 struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown
435 {
436 /// <summary>
437 /// Retrieves the next set of product instances in the enumeration sequence.
438 /// </summary>
439 /// <param name="celt">The number of product instances to retrieve.</param>
440 /// <param name="rgelt">A pointer to an array of <see cref="ISetupInstance"/>.</param>
441 /// <param name="pceltFetched">A pointer to the number of product instances retrieved. If <paramref name="celt"/> is 1 this parameter may be NULL.</param>
442 /// <returns>S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if <paramref name="celt"/> is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an <see cref="ISetupInstance"/> could not be allocated.</returns>
443 STDMETHOD(Next)(
444 _In_ ULONG celt,
445 _Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt,
446 _Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched
447 ) = 0;
448
449 /// <summary>
450 /// Skips the next set of product instances in the enumeration sequence.
451 /// </summary>
452 /// <param name="celt">The number of product instances to skip.</param>
453 /// <returns>S_OK if the number of elements could be skipped; otherwise, S_FALSE;</returns>
454 STDMETHOD(Skip)(
455 _In_ ULONG celt
456 ) = 0;
457
458 /// <summary>
459 /// Resets the enumeration sequence to the beginning.
460 /// </summary>
461 /// <returns>Always returns S_OK;</returns>
462 STDMETHOD(Reset)(void) = 0;
463
464 /// <summary>
465 /// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence.
466 /// </summary>
467 /// <param name="ppenum">A pointer to a pointer to a new <see cref="IEnumSetupInstances"/> interface. If the method fails, this parameter is undefined.</param>
468 /// <returns>S_OK if a clone was returned; otherwise, E_OUTOFMEMORY.</returns>
469 STDMETHOD(Clone)(
470 _Deref_out_opt_ IEnumSetupInstances** ppenum
471 ) = 0;
472 };
473#endif
474
475 EXTERN_C const IID IID_ISetupConfiguration;
476
477#if defined(__cplusplus) && !defined(CINTERFACE)
478
479#ifdef __GNUC__
480 __CRT_UUID_DECL(ISetupConfiguration, 0x42843719, 0xDB4C, 0x46C2, 0x8E, 0x7C, 0x64, 0xF1, 0x81, 0x6E, 0xFD, 0x5B);
481#endif
482
483 /// <summary>
484 /// Gets information about product instances installed on the machine.
485 /// </summary>
486 struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown
487 {
488 /// <summary>
489 /// Enumerates all launchable product instances installed.
490 /// </summary>
491 /// <param name="ppEnumInstances">An enumeration of completed, installed product instances.</param>
492 /// <returns>Standard HRESULT indicating success or failure.</returns>
493 STDMETHOD(EnumInstances)(
494 _Out_ IEnumSetupInstances** ppEnumInstances
495 ) = 0;
496
497 /// <summary>
498 /// Gets the instance for the current process path.
499 /// </summary>
500 /// <param name="ppInstance">The instance for the current process path.</param>
501 /// <returns>
502 /// The instance for the current process path, or E_NOTFOUND if not found.
503 /// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
504 /// </returns>
505 /// <remarks>
506 /// The returned instance may not be launchable.
507 /// </remarks>
508 STDMETHOD(GetInstanceForCurrentProcess)(
509 _Out_ ISetupInstance** ppInstance
510 ) = 0;
511
512 /// <summary>
513 /// Gets the instance for the given path.
514 /// </summary>
515 /// <param name="ppInstance">The instance for the given path.</param>
516 /// <returns>
517 /// The instance for the given path, or E_NOTFOUND if not found.
518 /// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
519 /// </returns>
520 /// <remarks>
521 /// The returned instance may not be launchable.
522 /// </remarks>
523 STDMETHOD(GetInstanceForPath)(
524 _In_z_ LPCWSTR wzPath,
525 _Out_ ISetupInstance** ppInstance
526 ) = 0;
527 };
528#endif
529
530 EXTERN_C const IID IID_ISetupConfiguration2;
531
532#if defined(__cplusplus) && !defined(CINTERFACE)
533 /// <summary>
534 /// Gets information about product instances.
535 /// </summary>
536 struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration
537 {
538 /// <summary>
539 /// Enumerates all product instances.
540 /// </summary>
541 /// <param name="ppEnumInstances">An enumeration of all product instances.</param>
542 /// <returns>Standard HRESULT indicating success or failure.</returns>
543 STDMETHOD(EnumAllInstances)(
544 _Out_ IEnumSetupInstances** ppEnumInstances
545 ) = 0;
546 };
547#endif
548
549 EXTERN_C const IID IID_ISetupPackageReference;
550
551#if defined(__cplusplus) && !defined(CINTERFACE)
552 /// <summary>
553 /// A reference to a package.
554 /// </summary>
555 struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown
556 {
557 /// <summary>
558 /// Gets the general package identifier.
559 /// </summary>
560 /// <param name="pbstrId">The general package identifier.</param>
561 /// <returns>Standard HRESULT indicating success or failure.</returns>
562 STDMETHOD(GetId)(
563 _Out_ BSTR* pbstrId
564 ) = 0;
565
566 /// <summary>
567 /// Gets the version of the package.
568 /// </summary>
569 /// <param name="pbstrVersion">The version of the package.</param>
570 /// <returns>Standard HRESULT indicating success or failure.</returns>
571 STDMETHOD(GetVersion)(
572 _Out_ BSTR* pbstrVersion
573 ) = 0;
574
575 /// <summary>
576 /// Gets the target process architecture of the package.
577 /// </summary>
578 /// <param name="pbstrChip">The target process architecture of the package.</param>
579 /// <returns>Standard HRESULT indicating success or failure.</returns>
580 STDMETHOD(GetChip)(
581 _Out_ BSTR* pbstrChip
582 ) = 0;
583
584 /// <summary>
585 /// Gets the language and optional region identifier.
586 /// </summary>
587 /// <param name="pbstrLanguage">The language and optional region identifier.</param>
588 /// <returns>Standard HRESULT indicating success or failure.</returns>
589 STDMETHOD(GetLanguage)(
590 _Out_ BSTR* pbstrLanguage
591 ) = 0;
592
593 /// <summary>
594 /// Gets the build branch of the package.
595 /// </summary>
596 /// <param name="pbstrBranch">The build branch of the package.</param>
597 /// <returns>Standard HRESULT indicating success or failure.</returns>
598 STDMETHOD(GetBranch)(
599 _Out_ BSTR* pbstrBranch
600 ) = 0;
601
602 /// <summary>
603 /// Gets the type of the package.
604 /// </summary>
605 /// <param name="pbstrType">The type of the package.</param>
606 /// <returns>Standard HRESULT indicating success or failure.</returns>
607 STDMETHOD(GetType)(
608 _Out_ BSTR* pbstrType
609 ) = 0;
610
611 /// <summary>
612 /// Gets the unique identifier consisting of all defined tokens.
613 /// </summary>
614 /// <param name="pbstrUniqueId">The unique identifier consisting of all defined tokens.</param>
615 /// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
616 STDMETHOD(GetUniqueId)(
617 _Out_ BSTR* pbstrUniqueId
618 ) = 0;
619
620 /// <summary>
621 /// Gets a value indicating whether the package refers to an external extension.
622 /// </summary>
623 /// <param name="pfIsExtension">A value indicating whether the package refers to an external extension.</param>
624 /// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
625 STDMETHOD(GetIsExtension)(
626 _Out_ VARIANT_BOOL* pfIsExtension
627 ) = 0;
628 };
629#endif
630
631 EXTERN_C const IID IID_ISetupHelper;
632
633#if defined(__cplusplus) && !defined(CINTERFACE)
634 /// <summary>
635 /// Helper functions.
636 /// </summary>
637 /// <remarks>
638 /// You can query for this interface from the <see cref="SetupConfiguration"/> class.
639 /// </remarks>
640 struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown
641 {
642 /// <summary>
643 /// Parses a dotted quad version string into a 64-bit unsigned integer.
644 /// </summary>
645 /// <param name="pwszVersion">The dotted quad version string to parse, e.g. 1.2.3.4.</param>
646 /// <param name="pullVersion">A 64-bit unsigned integer representing the version. You can compare this to other versions.</param>
647 /// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version is not valid.</returns>
648 STDMETHOD(ParseVersion)(
649 _In_ LPCOLESTR pwszVersion,
650 _Out_ PULONGLONG pullVersion
651 ) = 0;
652
653 /// <summary>
654 /// Parses a dotted quad version string into a 64-bit unsigned integer.
655 /// </summary>
656 /// <param name="pwszVersionRange">The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer.</param>
657 /// <param name="pullMinVersion">A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions.</param>
658 /// <param name="pullMaxVersion">A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions.</param>
659 /// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version range is not valid.</returns>
660 STDMETHOD(ParseVersionRange)(
661 _In_ LPCOLESTR pwszVersionRange,
662 _Out_ PULONGLONG pullMinVersion,
663 _Out_ PULONGLONG pullMaxVersion
664 ) = 0;
665 };
666#endif
667
668 EXTERN_C const IID IID_ISetupErrorState;
669
670#if defined(__cplusplus) && !defined(CINTERFACE)
671 /// <summary>
672 /// Information about the error state of an instance.
673 /// </summary>
674 struct DECLSPEC_UUID("46DCCD94-A287-476A-851E-DFBC2FFDBC20") DECLSPEC_NOVTABLE ISetupErrorState : public IUnknown
675 {
676 /// <summary>
677 /// Gets an array of failed package references.
678 /// </summary>
679 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupFailedPackageReference"/>, if packages have failed.</param>
680 /// <returns>Standard HRESULT indicating success or failure.</returns>
681 STDMETHOD(GetFailedPackages)(
682 _Outptr_result_maybenull_ LPSAFEARRAY* ppsaFailedPackages
683 ) = 0;
684
685 /// <summary>
686 /// Gets an array of skipped package references.
687 /// </summary>
688 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>, if packages have been skipped.</param>
689 /// <returns>Standard HRESULT indicating success or failure.</returns>
690 STDMETHOD(GetSkippedPackages)(
691 _Outptr_result_maybenull_ LPSAFEARRAY* ppsaSkippedPackages
692 ) = 0;
693 };
694#endif
695
696 EXTERN_C const IID IID_ISetupErrorState2;
697
698#if defined(__cplusplus) && !defined(CINTERFACE)
699 /// <summary>
700 /// Information about the error state of an instance.
701 /// </summary>
702 struct DECLSPEC_UUID("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF") DECLSPEC_NOVTABLE ISetupErrorState2 : public ISetupErrorState
703 {
704 /// <summary>
705 /// Gets the path to the error log.
706 /// </summary>
707 /// <param name="pbstrChip">The path to the error log.</param>
708 /// <returns>Standard HRESULT indicating success or failure.</returns>
709 STDMETHOD(GetErrorLogFilePath)(
710 _Outptr_result_maybenull_ BSTR* pbstrErrorLogFilePath
711 ) = 0;
712
713 /// <summary>
714 /// Gets the path to the main setup log.
715 /// </summary>
716 /// <param name="pbstrChip">The path to the main setup log.</param>
717 /// <returns>Standard HRESULT indicating success or failure.</returns>
718 STDMETHOD(GetLogFilePath)(
719 _Outptr_result_maybenull_ BSTR* pbstrLogFilePath
720 ) = 0;
721 };
722#endif
723
724 EXTERN_C const IID IID_ISetupFailedPackageReference;
725
726#if defined(__cplusplus) && !defined(CINTERFACE)
727 /// <summary>
728 /// A reference to a failed package.
729 /// </summary>
730 struct DECLSPEC_UUID("E73559CD-7003-4022-B134-27DC650B280F") DECLSPEC_NOVTABLE ISetupFailedPackageReference : public ISetupPackageReference
731 {
732 };
733
734#endif
735
736 EXTERN_C const IID IID_ISetupFailedPackageReference2;
737
738#if defined(__cplusplus) && !defined(CINTERFACE)
739 /// <summary>
740 /// A reference to a failed package.
741 /// </summary>
742 struct DECLSPEC_UUID("0FAD873E-E874-42E3-B268-4FE2F096B9CA") DECLSPEC_NOVTABLE ISetupFailedPackageReference2 : public ISetupFailedPackageReference
743 {
744 /// <summary>
745 /// Gets the path to the optional package log.
746 /// </summary>
747 /// <param name="pbstrId">The path to the optional package log.</param>
748 /// <returns>Standard HRESULT indicating success or failure.</returns>
749 STDMETHOD(GetLogFilePath)(
750 _Outptr_result_maybenull_ BSTR* pbstrLogFilePath
751 ) = 0;
752
753 /// <summary>
754 /// Gets the description of the package failure.
755 /// </summary>
756 /// <param name="pbstrId">The description of the package failure.</param>
757 /// <returns>Standard HRESULT indicating success or failure.</returns>
758 STDMETHOD(GetDescription)(
759 _Outptr_result_maybenull_ BSTR* pbstrDescription
760 ) = 0;
761
762 /// <summary>
763 /// Gets the signature to use for feedback reporting.
764 /// </summary>
765 /// <param name="pbstrId">The signature to use for feedback reporting.</param>
766 /// <returns>Standard HRESULT indicating success or failure.</returns>
767 STDMETHOD(GetSignature)(
768 _Outptr_result_maybenull_ BSTR* pbstrSignature
769 ) = 0;
770
771 /// <summary>
772 /// Gets the array of details for this package failure.
773 /// </summary>
774 /// <param name="ppsaDetails">Pointer to an array of details as BSTRs.</param>
775 /// <returns>Standard HRESULT indicating success or failure.</returns>
776 STDMETHOD(GetDetails)(
777 _Out_ LPSAFEARRAY* ppsaDetails
778 ) = 0;
779
780 /// <summary>
781 /// Gets an array of packages affected by this package failure.
782 /// </summary>
783 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/> for packages affected by this package failure. This may be NULL.</param>
784 /// <returns>Standard HRESULT indicating success or failure.</returns>
785 STDMETHOD(GetAffectedPackages)(
786 _Out_ LPSAFEARRAY* ppsaAffectedPackages
787 ) = 0;
788 };
789
790#endif
791
792 EXTERN_C const IID IID_ISetupPropertyStore;
793
794#if defined(__cplusplus) && !defined(CINTERFACE)
795 /// <summary>
796 /// Provides named properties.
797 /// </summary>
798 /// <remarks>
799 /// You can get this from an <see cref="ISetupInstance"/>, <see cref="ISetupPackageReference"/>, or derivative.
800 /// </remarks>
801 struct DECLSPEC_UUID("C601C175-A3BE-44BC-91F6-4568D230FC83") DECLSPEC_NOVTABLE ISetupPropertyStore : public IUnknown
802 {
803 /// <summary>
804 /// Gets an array of property names in this property store.
805 /// </summary>
806 /// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
807 /// <returns>Standard HRESULT indicating success or failure.</returns>
808 STDMETHOD(GetNames)(
809 _Out_ LPSAFEARRAY* ppsaNames
810 ) = 0;
811
812 /// <summary>
813 /// Gets the value of a named property in this property store.
814 /// </summary>
815 /// <param name="pwszName">The name of the property to get.</param>
816 /// <param name="pvtValue">The value of the property.</param>
817 /// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
818 STDMETHOD(GetValue)(
819 _In_ LPCOLESTR pwszName,
820 _Out_ LPVARIANT pvtValue
821 ) = 0;
822 };
823
824#endif
825
826 EXTERN_C const IID IID_ISetupLocalizedPropertyStore;
827
828#if defined(__cplusplus) && !defined(CINTERFACE)
829 /// <summary>
830 /// Provides localized named properties.
831 /// </summary>
832 /// <remarks>
833 /// You can get this from an <see cref="ISetupLocalizedProperties"/>.
834 /// </remarks>
835 struct DECLSPEC_UUID("5BB53126-E0D5-43DF-80F1-6B161E5C6F6C") DECLSPEC_NOVTABLE ISetupLocalizedPropertyStore : public IUnknown
836 {
837 /// <summary>
838 /// Gets an array of property names in this property store.
839 /// </summary>
840 /// <param name="lcid">The LCID for the property names.</param>
841 /// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
842 /// <returns>Standard HRESULT indicating success or failure.</returns>
843 STDMETHOD(GetNames)(
844 _In_ LCID lcid,
845 _Out_ LPSAFEARRAY* ppsaNames
846 ) = 0;
847
848 /// <summary>
849 /// Gets the value of a named property in this property store.
850 /// </summary>
851 /// <param name="pwszName">The name of the property to get.</param>
852 /// <param name="lcid">The LCID for the property.</param>
853 /// <param name="pvtValue">The value of the property.</param>
854 /// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
855 STDMETHOD(GetValue)(
856 _In_ LPCOLESTR pwszName,
857 _In_ LCID lcid,
858 _Out_ LPVARIANT pvtValue
859 ) = 0;
860 };
861
862#endif
863
864 // Class declarations
865 //
866 EXTERN_C const CLSID CLSID_SetupConfiguration;
867
868#ifdef __cplusplus
869
870#ifdef __GNUC__
871 __CRT_UUID_DECL(SetupConfiguration, 0x177F0C4A, 0x1CD3, 0x4DE7, 0xA3, 0x2C, 0x71, 0xDB, 0xBB, 0x9F, 0xA3, 0x6D);
872#endif
873
874 /// <summary>
875 /// This class implements <see cref="ISetupConfiguration"/>, <see cref="ISetupConfiguration2"/>, and <see cref="ISetupHelper"/>.
876 /// </summary>
877 class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration;
878#endif
879 // Function declarations
880 //
881 /// <summary>
882 /// Gets an <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.
883 /// </summary>
884 /// <param name="ppConfiguration">The <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.</param>
885 /// <param name="pReserved">Reserved for future use.</param>
886 /// <returns>Standard HRESULT indicating success or failure.</returns>
887 STDMETHODIMP GetSetupConfiguration(
888 _Out_ ISetupConfiguration** ppConfiguration,
889 _Reserved_ LPVOID pReserved
890 );
891
892#ifdef __cplusplus
893}
894#endif
895
896_COM_SMARTPTR_TYPEDEF(ISetupInstance, __uuidof(ISetupInstance));
897_COM_SMARTPTR_TYPEDEF(ISetupInstance2, __uuidof(ISetupInstance2));
898_COM_SMARTPTR_TYPEDEF(IEnumSetupInstances, __uuidof(IEnumSetupInstances));
899_COM_SMARTPTR_TYPEDEF(ISetupConfiguration, __uuidof(ISetupConfiguration));
900_COM_SMARTPTR_TYPEDEF(ISetupConfiguration2, __uuidof(ISetupConfiguration2));
901_COM_SMARTPTR_TYPEDEF(ISetupHelper, __uuidof(ISetupHelper));
902_COM_SMARTPTR_TYPEDEF(ISetupPackageReference, __uuidof(ISetupPackageReference));
903_COM_SMARTPTR_TYPEDEF(ISetupPropertyStore, __uuidof(ISetupPropertyStore));
904_COM_SMARTPTR_TYPEDEF(ISetupInstanceCatalog, __uuidof(ISetupInstanceCatalog));
1// The MIT License(MIT)
2// Copyright(C) Microsoft Corporation.All rights reserved.
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files(the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions :
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20// IN THE SOFTWARE.
21//
22
23#pragma once
24
25// Windows headers
26#include <windows.h>
27#include <fcntl.h>
28#include <io.h>
29#include <shellapi.h>
30
31// Standard headers
32#include <stdio.h>
33
34// COM support header files
35#include <comdef.h>
36
37// Constants
38//
39#ifndef E_NOTFOUND
40#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
41#endif
42
43#ifndef E_FILENOTFOUND
44#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
45#endif
46
47#ifndef E_NOTSUPPORTED
48#define E_NOTSUPPORTED HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
49#endif
50
51// Enumerations
52//
53/// <summary>
54/// The state of an instance.
55/// </summary>
56enum InstanceState
57{
58 /// <summary>
59 /// The instance state has not been determined.
60 /// </summary>
61 eNone = 0,
62
63 /// <summary>
64 /// The instance installation path exists.
65 /// </summary>
66 eLocal = 1,
67
68 /// <summary>
69 /// A product is registered to the instance.
70 /// </summary>
71 eRegistered = 2,
72
73 /// <summary>
74 /// No reboot is required for the instance.
75 /// </summary>
76 eNoRebootRequired = 4,
77
78 /// <summary>
79 /// No errors were reported for the instance.
80 /// </summary>
81 eNoErrors = 8,
82
83 /// <summary>
84 /// The instance represents a complete install.
85 /// </summary>
86 eComplete = UINT_MAX,
87};
88
89// Forward interface declarations
90//
91#ifndef __ISetupInstance_FWD_DEFINED__
92#define __ISetupInstance_FWD_DEFINED__
93typedef struct ISetupInstance ISetupInstance;
94#endif
95
96#ifndef __ISetupInstance2_FWD_DEFINED__
97#define __ISetupInstance2_FWD_DEFINED__
98typedef struct ISetupInstance2 ISetupInstance2;
99#endif
100
101#ifndef __ISetupInstanceCatalog_FWD_DEFINED__
102#define __ISetupInstanceCatalog_FWD_DEFINED__
103typedef struct ISetupInstanceCatalog ISetupInstanceCatalog;
104#endif
105
106#ifndef __ISetupLocalizedProperties_FWD_DEFINED__
107#define __ISetupLocalizedProperties_FWD_DEFINED__
108typedef struct ISetupLocalizedProperties ISetupLocalizedProperties;
109#endif
110
111#ifndef __IEnumSetupInstances_FWD_DEFINED__
112#define __IEnumSetupInstances_FWD_DEFINED__
113typedef struct IEnumSetupInstances IEnumSetupInstances;
114#endif
115
116#ifndef __ISetupConfiguration_FWD_DEFINED__
117#define __ISetupConfiguration_FWD_DEFINED__
118typedef struct ISetupConfiguration ISetupConfiguration;
119#endif
120
121#ifndef __ISetupConfiguration2_FWD_DEFINED__
122#define __ISetupConfiguration2_FWD_DEFINED__
123typedef struct ISetupConfiguration2 ISetupConfiguration2;
124#endif
125
126#ifndef __ISetupPackageReference_FWD_DEFINED__
127#define __ISetupPackageReference_FWD_DEFINED__
128typedef struct ISetupPackageReference ISetupPackageReference;
129#endif
130
131#ifndef __ISetupHelper_FWD_DEFINED__
132#define __ISetupHelper_FWD_DEFINED__
133typedef struct ISetupHelper ISetupHelper;
134#endif
135
136#ifndef __ISetupErrorState_FWD_DEFINED__
137#define __ISetupErrorState_FWD_DEFINED__
138typedef struct ISetupErrorState ISetupErrorState;
139#endif
140
141#ifndef __ISetupErrorState2_FWD_DEFINED__
142#define __ISetupErrorState2_FWD_DEFINED__
143typedef struct ISetupErrorState2 ISetupErrorState2;
144#endif
145
146#ifndef __ISetupFailedPackageReference_FWD_DEFINED__
147#define __ISetupFailedPackageReference_FWD_DEFINED__
148typedef struct ISetupFailedPackageReference ISetupFailedPackageReference;
149#endif
150
151#ifndef __ISetupFailedPackageReference2_FWD_DEFINED__
152#define __ISetupFailedPackageReference2_FWD_DEFINED__
153typedef struct ISetupFailedPackageReference2 ISetupFailedPackageReference2;
154#endif
155
156#ifndef __ISetupPropertyStore_FWD_DEFINED__
157#define __ISetupPropertyStore_FWD_DEFINED__
158typedef struct ISetupPropertyStore ISetupPropertyStore;
159#endif
160
161#ifndef __ISetupLocalizedPropertyStore_FWD_DEFINED__
162#define __ISetupLocalizedPropertyStore_FWD_DEFINED__
163typedef struct ISetupLocalizedPropertyStore ISetupLocalizedPropertyStore;
164#endif
165
166// Forward class declarations
167//
168#ifndef __SetupConfiguration_FWD_DEFINED__
169#define __SetupConfiguration_FWD_DEFINED__
170
171#ifdef __cplusplus
172typedef class SetupConfiguration SetupConfiguration;
173#endif
174
175#endif
176
177#ifndef _MSC_VER
178#define _Deref_out_opt_
179#endif
180
181#ifdef __cplusplus
182extern "C" {
183#endif
184
185 // Interface definitions
186 //
187 EXTERN_C const IID IID_ISetupInstance;
188
189#if defined(__cplusplus) && !defined(CINTERFACE)
190 /// <summary>
191 /// Information about an instance of a product.
192 /// </summary>
193 struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown
194 {
195 /// <summary>
196 /// Gets the instance identifier (should match the name of the parent instance directory).
197 /// </summary>
198 /// <param name="pbstrInstanceId">The instance identifier.</param>
199 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
200 STDMETHOD(GetInstanceId)(
201 _Out_ BSTR* pbstrInstanceId
202 ) = 0;
203
204 /// <summary>
205 /// Gets the local date and time when the installation was originally installed.
206 /// </summary>
207 /// <param name="pInstallDate">The local date and time when the installation was originally installed.</param>
208 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
209 STDMETHOD(GetInstallDate)(
210 _Out_ LPFILETIME pInstallDate
211 ) = 0;
212
213 /// <summary>
214 /// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.
215 /// </summary>
216 /// <param name="pbstrInstallationName">The unique name of the installation, often indicating the branch and other information used for telemetry.</param>
217 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
218 STDMETHOD(GetInstallationName)(
219 _Out_ BSTR* pbstrInstallationName
220 ) = 0;
221
222 /// <summary>
223 /// Gets the path to the installation root of the product.
224 /// </summary>
225 /// <param name="pbstrInstallationPath">The path to the installation root of the product.</param>
226 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
227 STDMETHOD(GetInstallationPath)(
228 _Out_ BSTR* pbstrInstallationPath
229 ) = 0;
230
231 /// <summary>
232 /// Gets the version of the product installed in this instance.
233 /// </summary>
234 /// <param name="pbstrInstallationVersion">The version of the product installed in this instance.</param>
235 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
236 STDMETHOD(GetInstallationVersion)(
237 _Out_ BSTR* pbstrInstallationVersion
238 ) = 0;
239
240 /// <summary>
241 /// Gets the display name (title) of the product installed in this instance.
242 /// </summary>
243 /// <param name="lcid">The LCID for the display name.</param>
244 /// <param name="pbstrDisplayName">The display name (title) of the product installed in this instance.</param>
245 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
246 STDMETHOD(GetDisplayName)(
247 _In_ LCID lcid,
248 _Out_ BSTR* pbstrDisplayName
249 ) = 0;
250
251 /// <summary>
252 /// Gets the description of the product installed in this instance.
253 /// </summary>
254 /// <param name="lcid">The LCID for the description.</param>
255 /// <param name="pbstrDescription">The description of the product installed in this instance.</param>
256 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
257 STDMETHOD(GetDescription)(
258 _In_ LCID lcid,
259 _Out_ BSTR* pbstrDescription
260 ) = 0;
261
262 /// <summary>
263 /// Resolves the optional relative path to the root path of the instance.
264 /// </summary>
265 /// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>
266 /// <param name="pbstrAbsolutePath">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.</param>
267 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
268 STDMETHOD(ResolvePath)(
269 _In_opt_z_ LPCOLESTR pwszRelativePath,
270 _Out_ BSTR* pbstrAbsolutePath
271 ) = 0;
272 };
273#endif
274
275 EXTERN_C const IID IID_ISetupInstance2;
276
277#if defined(__cplusplus) && !defined(CINTERFACE)
278 /// <summary>
279 /// Information about an instance of a product.
280 /// </summary>
281 struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance
282 {
283 /// <summary>
284 /// Gets the state of the instance.
285 /// </summary>
286 /// <param name="pState">The state of the instance.</param>
287 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
288 STDMETHOD(GetState)(
289 _Out_ InstanceState* pState
290 ) = 0;
291
292 /// <summary>
293 /// Gets an array of package references registered to the instance.
294 /// </summary>
295 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>.</param>
296 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
297 STDMETHOD(GetPackages)(
298 _Out_ LPSAFEARRAY* ppsaPackages
299 ) = 0;
300
301 /// <summary>
302 /// Gets a pointer to the <see cref="ISetupPackageReference"/> that represents the registered product.
303 /// </summary>
304 /// <param name="ppPackage">Pointer to an instance of <see cref="ISetupPackageReference"/>. This may be NULL if <see cref="GetState"/> does not return <see cref="eComplete"/>.</param>
305 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
306 STDMETHOD(GetProduct)(
307 _Outptr_result_maybenull_ ISetupPackageReference** ppPackage
308 ) = 0;
309
310 /// <summary>
311 /// Gets the relative path to the product application, if available.
312 /// </summary>
313 /// <param name="pbstrProductPath">The relative path to the product application, if available.</param>
314 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
315 STDMETHOD(GetProductPath)(
316 _Outptr_result_maybenull_ BSTR* pbstrProductPath
317 ) = 0;
318
319 /// <summary>
320 /// Gets the error state of the instance, if available.
321 /// </summary>
322 /// <param name="pErrorState">The error state of the instance, if available.</param>
323 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
324 STDMETHOD(GetErrors)(
325 _Outptr_result_maybenull_ ISetupErrorState** ppErrorState
326 ) = 0;
327
328 /// <summary>
329 /// Gets a value indicating whether the instance can be launched.
330 /// </summary>
331 /// <param name="pfIsLaunchable">Whether the instance can be launched.</param>
332 /// <returns>Standard HRESULT indicating success or failure.</returns>
333 /// <remarks>
334 /// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will.
335 /// </remarks>
336 STDMETHOD(IsLaunchable)(
337 _Out_ VARIANT_BOOL* pfIsLaunchable
338 ) = 0;
339
340 /// <summary>
341 /// Gets a value indicating whether the instance is complete.
342 /// </summary>
343 /// <param name="pfIsLaunchable">Whether the instance is complete.</param>
344 /// <returns>Standard HRESULT indicating success or failure.</returns>
345 /// <remarks>
346 /// An instance is complete if it had no errors during install, resume, or repair.
347 /// </remarks>
348 STDMETHOD(IsComplete)(
349 _Out_ VARIANT_BOOL* pfIsComplete
350 ) = 0;
351
352 /// <summary>
353 /// Gets product-specific properties.
354 /// </summary>
355 /// <param name="ppProperties">A pointer to an instance of <see cref="ISetupPropertyStore"/>. This may be NULL if no properties are defined.</param>
356 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
357 STDMETHOD(GetProperties)(
358 _Outptr_result_maybenull_ ISetupPropertyStore** ppProperties
359 ) = 0;
360
361 /// <summary>
362 /// Gets the directory path to the setup engine that installed the instance.
363 /// </summary>
364 /// <param name="pbstrEnginePath">The directory path to the setup engine that installed the instance.</param>
365 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
366 STDMETHOD(GetEnginePath)(
367 _Outptr_result_maybenull_ BSTR* pbstrEnginePath
368 ) = 0;
369 };
370#endif
371
372 EXTERN_C const IID IID_ISetupInstanceCatalog;
373
374#if defined(__cplusplus) && !defined(CINTERFACE)
375 /// <summary>
376 /// Information about a catalog used to install an instance.
377 /// </summary>
378 struct DECLSPEC_UUID("9AD8E40F-39A2-40F1-BF64-0A6C50DD9EEB") DECLSPEC_NOVTABLE ISetupInstanceCatalog : public IUnknown
379 {
380 /// <summary>
381 /// Gets catalog information properties.
382 /// </summary>
383 /// <param name="ppCatalogInfo">A pointer to an instance of <see cref="ISetupPropertyStore"/>.</param>
384 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property does not exist.</returns>
385 STDMETHOD(GetCatalogInfo)(
386 _Out_ ISetupPropertyStore** ppCatalogInfo
387 ) = 0;
388
389 /// <summary>
390 /// Gets a value indicating whether the catalog is a prerelease.
391 /// </summary>
392 /// <param name="pfIsPrerelease">Whether the catalog for the instance is a prerelease version.</param>
393 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property does not exist.</returns>
394 STDMETHOD(IsPrerelease)(
395 _Out_ VARIANT_BOOL* pfIsPrerelease
396 ) = 0;
397 };
398#endif
399
400 EXTERN_C const IID IID_ISetupLocalizedProperties;
401
402#if defined(__cplusplus) && !defined(CINTERFACE)
403 /// <summary>
404 /// Provides localized properties of an instance of a product.
405 /// </summary>
406 struct DECLSPEC_UUID("F4BD7382-FE27-4AB4-B974-9905B2A148B0") DECLSPEC_NOVTABLE ISetupLocalizedProperties : public IUnknown
407 {
408 /// <summary>
409 /// Gets localized product-specific properties.
410 /// </summary>
411 /// <param name="ppLocalizedProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no properties are defined.</param>
412 /// <returns>Standard HRESULT indicating success or failure.</returns>
413 STDMETHOD(GetLocalizedProperties)(
414 _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedProperties
415 ) = 0;
416
417 /// <summary>
418 /// Gets localized channel-specific properties.
419 /// </summary>
420 /// <param name="ppLocalizedChannelProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no channel properties are defined.</param>
421 /// <returns>Standard HRESULT indicating success or failure.</returns>
422 STDMETHOD(GetLocalizedChannelProperties)(
423 _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedChannelProperties
424 ) = 0;
425 };
426#endif
427
428 EXTERN_C const IID IID_IEnumSetupInstances;
429
430#if defined(__cplusplus) && !defined(CINTERFACE)
431
432#ifdef __GNUC__
433 __CRT_UUID_DECL(IEnumSetupInstances, 0x6380BCFF, 0x41D3, 0x4B2E, 0x8B, 0x2E, 0xBF, 0x8A, 0x68, 0x10, 0xC8, 0x48);
434#endif
435
436 /// <summary>
437 /// An enumerator of installed <see cref="ISetupInstance"/> objects.
438 /// </summary>
439 struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown
440 {
441 /// <summary>
442 /// Retrieves the next set of product instances in the enumeration sequence.
443 /// </summary>
444 /// <param name="celt">The number of product instances to retrieve.</param>
445 /// <param name="rgelt">A pointer to an array of <see cref="ISetupInstance"/>.</param>
446 /// <param name="pceltFetched">A pointer to the number of product instances retrieved. If <paramref name="celt"/> is 1 this parameter may be NULL.</param>
447 /// <returns>S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if <paramref name="celt"/> is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an <see cref="ISetupInstance"/> could not be allocated.</returns>
448 STDMETHOD(Next)(
449 _In_ ULONG celt,
450 _Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt,
451 _Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched
452 ) = 0;
453
454 /// <summary>
455 /// Skips the next set of product instances in the enumeration sequence.
456 /// </summary>
457 /// <param name="celt">The number of product instances to skip.</param>
458 /// <returns>S_OK if the number of elements could be skipped; otherwise, S_FALSE;</returns>
459 STDMETHOD(Skip)(
460 _In_ ULONG celt
461 ) = 0;
462
463 /// <summary>
464 /// Resets the enumeration sequence to the beginning.
465 /// </summary>
466 /// <returns>Always returns S_OK;</returns>
467 STDMETHOD(Reset)(void) = 0;
468
469 /// <summary>
470 /// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence.
471 /// </summary>
472 /// <param name="ppenum">A pointer to a pointer to a new <see cref="IEnumSetupInstances"/> interface. If the method fails, this parameter is undefined.</param>
473 /// <returns>S_OK if a clone was returned; otherwise, E_OUTOFMEMORY.</returns>
474 STDMETHOD(Clone)(
475 _Deref_out_opt_ IEnumSetupInstances** ppenum
476 ) = 0;
477 };
478#endif
479
480 EXTERN_C const IID IID_ISetupConfiguration;
481
482#if defined(__cplusplus) && !defined(CINTERFACE)
483
484#ifdef __GNUC__
485 __CRT_UUID_DECL(ISetupConfiguration, 0x42843719, 0xDB4C, 0x46C2, 0x8E, 0x7C, 0x64, 0xF1, 0x81, 0x6E, 0xFD, 0x5B);
486#endif
487
488 /// <summary>
489 /// Gets information about product instances installed on the machine.
490 /// </summary>
491 struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown
492 {
493 /// <summary>
494 /// Enumerates all launchable product instances installed.
495 /// </summary>
496 /// <param name="ppEnumInstances">An enumeration of completed, installed product instances.</param>
497 /// <returns>Standard HRESULT indicating success or failure.</returns>
498 STDMETHOD(EnumInstances)(
499 _Out_ IEnumSetupInstances** ppEnumInstances
500 ) = 0;
501
502 /// <summary>
503 /// Gets the instance for the current process path.
504 /// </summary>
505 /// <param name="ppInstance">The instance for the current process path.</param>
506 /// <returns>
507 /// The instance for the current process path, or E_NOTFOUND if not found.
508 /// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
509 /// </returns>
510 /// <remarks>
511 /// The returned instance may not be launchable.
512 /// </remarks>
513 STDMETHOD(GetInstanceForCurrentProcess)(
514 _Out_ ISetupInstance** ppInstance
515 ) = 0;
516
517 /// <summary>
518 /// Gets the instance for the given path.
519 /// </summary>
520 /// <param name="ppInstance">The instance for the given path.</param>
521 /// <returns>
522 /// The instance for the given path, or E_NOTFOUND if not found.
523 /// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
524 /// </returns>
525 /// <remarks>
526 /// The returned instance may not be launchable.
527 /// </remarks>
528 STDMETHOD(GetInstanceForPath)(
529 _In_z_ LPCWSTR wzPath,
530 _Out_ ISetupInstance** ppInstance
531 ) = 0;
532 };
533#endif
534
535 EXTERN_C const IID IID_ISetupConfiguration2;
536
537#if defined(__cplusplus) && !defined(CINTERFACE)
538 /// <summary>
539 /// Gets information about product instances.
540 /// </summary>
541 struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration
542 {
543 /// <summary>
544 /// Enumerates all product instances.
545 /// </summary>
546 /// <param name="ppEnumInstances">An enumeration of all product instances.</param>
547 /// <returns>Standard HRESULT indicating success or failure.</returns>
548 STDMETHOD(EnumAllInstances)(
549 _Out_ IEnumSetupInstances** ppEnumInstances
550 ) = 0;
551 };
552#endif
553
554 EXTERN_C const IID IID_ISetupPackageReference;
555
556#if defined(__cplusplus) && !defined(CINTERFACE)
557 /// <summary>
558 /// A reference to a package.
559 /// </summary>
560 struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown
561 {
562 /// <summary>
563 /// Gets the general package identifier.
564 /// </summary>
565 /// <param name="pbstrId">The general package identifier.</param>
566 /// <returns>Standard HRESULT indicating success or failure.</returns>
567 STDMETHOD(GetId)(
568 _Out_ BSTR* pbstrId
569 ) = 0;
570
571 /// <summary>
572 /// Gets the version of the package.
573 /// </summary>
574 /// <param name="pbstrVersion">The version of the package.</param>
575 /// <returns>Standard HRESULT indicating success or failure.</returns>
576 STDMETHOD(GetVersion)(
577 _Out_ BSTR* pbstrVersion
578 ) = 0;
579
580 /// <summary>
581 /// Gets the target process architecture of the package.
582 /// </summary>
583 /// <param name="pbstrChip">The target process architecture of the package.</param>
584 /// <returns>Standard HRESULT indicating success or failure.</returns>
585 STDMETHOD(GetChip)(
586 _Out_ BSTR* pbstrChip
587 ) = 0;
588
589 /// <summary>
590 /// Gets the language and optional region identifier.
591 /// </summary>
592 /// <param name="pbstrLanguage">The language and optional region identifier.</param>
593 /// <returns>Standard HRESULT indicating success or failure.</returns>
594 STDMETHOD(GetLanguage)(
595 _Out_ BSTR* pbstrLanguage
596 ) = 0;
597
598 /// <summary>
599 /// Gets the build branch of the package.
600 /// </summary>
601 /// <param name="pbstrBranch">The build branch of the package.</param>
602 /// <returns>Standard HRESULT indicating success or failure.</returns>
603 STDMETHOD(GetBranch)(
604 _Out_ BSTR* pbstrBranch
605 ) = 0;
606
607 /// <summary>
608 /// Gets the type of the package.
609 /// </summary>
610 /// <param name="pbstrType">The type of the package.</param>
611 /// <returns>Standard HRESULT indicating success or failure.</returns>
612 STDMETHOD(GetType)(
613 _Out_ BSTR* pbstrType
614 ) = 0;
615
616 /// <summary>
617 /// Gets the unique identifier consisting of all defined tokens.
618 /// </summary>
619 /// <param name="pbstrUniqueId">The unique identifier consisting of all defined tokens.</param>
620 /// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
621 STDMETHOD(GetUniqueId)(
622 _Out_ BSTR* pbstrUniqueId
623 ) = 0;
624
625 /// <summary>
626 /// Gets a value indicating whether the package refers to an external extension.
627 /// </summary>
628 /// <param name="pfIsExtension">A value indicating whether the package refers to an external extension.</param>
629 /// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
630 STDMETHOD(GetIsExtension)(
631 _Out_ VARIANT_BOOL* pfIsExtension
632 ) = 0;
633 };
634#endif
635
636 EXTERN_C const IID IID_ISetupHelper;
637
638#if defined(__cplusplus) && !defined(CINTERFACE)
639 /// <summary>
640 /// Helper functions.
641 /// </summary>
642 /// <remarks>
643 /// You can query for this interface from the <see cref="SetupConfiguration"/> class.
644 /// </remarks>
645 struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown
646 {
647 /// <summary>
648 /// Parses a dotted quad version string into a 64-bit unsigned integer.
649 /// </summary>
650 /// <param name="pwszVersion">The dotted quad version string to parse, e.g. 1.2.3.4.</param>
651 /// <param name="pullVersion">A 64-bit unsigned integer representing the version. You can compare this to other versions.</param>
652 /// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version is not valid.</returns>
653 STDMETHOD(ParseVersion)(
654 _In_ LPCOLESTR pwszVersion,
655 _Out_ PULONGLONG pullVersion
656 ) = 0;
657
658 /// <summary>
659 /// Parses a dotted quad version string into a 64-bit unsigned integer.
660 /// </summary>
661 /// <param name="pwszVersionRange">The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer.</param>
662 /// <param name="pullMinVersion">A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions.</param>
663 /// <param name="pullMaxVersion">A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions.</param>
664 /// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version range is not valid.</returns>
665 STDMETHOD(ParseVersionRange)(
666 _In_ LPCOLESTR pwszVersionRange,
667 _Out_ PULONGLONG pullMinVersion,
668 _Out_ PULONGLONG pullMaxVersion
669 ) = 0;
670 };
671#endif
672
673 EXTERN_C const IID IID_ISetupErrorState;
674
675#if defined(__cplusplus) && !defined(CINTERFACE)
676 /// <summary>
677 /// Information about the error state of an instance.
678 /// </summary>
679 struct DECLSPEC_UUID("46DCCD94-A287-476A-851E-DFBC2FFDBC20") DECLSPEC_NOVTABLE ISetupErrorState : public IUnknown
680 {
681 /// <summary>
682 /// Gets an array of failed package references.
683 /// </summary>
684 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupFailedPackageReference"/>, if packages have failed.</param>
685 /// <returns>Standard HRESULT indicating success or failure.</returns>
686 STDMETHOD(GetFailedPackages)(
687 _Outptr_result_maybenull_ LPSAFEARRAY* ppsaFailedPackages
688 ) = 0;
689
690 /// <summary>
691 /// Gets an array of skipped package references.
692 /// </summary>
693 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>, if packages have been skipped.</param>
694 /// <returns>Standard HRESULT indicating success or failure.</returns>
695 STDMETHOD(GetSkippedPackages)(
696 _Outptr_result_maybenull_ LPSAFEARRAY* ppsaSkippedPackages
697 ) = 0;
698 };
699#endif
700
701 EXTERN_C const IID IID_ISetupErrorState2;
702
703#if defined(__cplusplus) && !defined(CINTERFACE)
704 /// <summary>
705 /// Information about the error state of an instance.
706 /// </summary>
707 struct DECLSPEC_UUID("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF") DECLSPEC_NOVTABLE ISetupErrorState2 : public ISetupErrorState
708 {
709 /// <summary>
710 /// Gets the path to the error log.
711 /// </summary>
712 /// <param name="pbstrChip">The path to the error log.</param>
713 /// <returns>Standard HRESULT indicating success or failure.</returns>
714 STDMETHOD(GetErrorLogFilePath)(
715 _Outptr_result_maybenull_ BSTR* pbstrErrorLogFilePath
716 ) = 0;
717
718 /// <summary>
719 /// Gets the path to the main setup log.
720 /// </summary>
721 /// <param name="pbstrChip">The path to the main setup log.</param>
722 /// <returns>Standard HRESULT indicating success or failure.</returns>
723 STDMETHOD(GetLogFilePath)(
724 _Outptr_result_maybenull_ BSTR* pbstrLogFilePath
725 ) = 0;
726 };
727#endif
728
729 EXTERN_C const IID IID_ISetupFailedPackageReference;
730
731#if defined(__cplusplus) && !defined(CINTERFACE)
732 /// <summary>
733 /// A reference to a failed package.
734 /// </summary>
735 struct DECLSPEC_UUID("E73559CD-7003-4022-B134-27DC650B280F") DECLSPEC_NOVTABLE ISetupFailedPackageReference : public ISetupPackageReference
736 {
737 };
738
739#endif
740
741 EXTERN_C const IID IID_ISetupFailedPackageReference2;
742
743#if defined(__cplusplus) && !defined(CINTERFACE)
744 /// <summary>
745 /// A reference to a failed package.
746 /// </summary>
747 struct DECLSPEC_UUID("0FAD873E-E874-42E3-B268-4FE2F096B9CA") DECLSPEC_NOVTABLE ISetupFailedPackageReference2 : public ISetupFailedPackageReference
748 {
749 /// <summary>
750 /// Gets the path to the optional package log.
751 /// </summary>
752 /// <param name="pbstrId">The path to the optional package log.</param>
753 /// <returns>Standard HRESULT indicating success or failure.</returns>
754 STDMETHOD(GetLogFilePath)(
755 _Outptr_result_maybenull_ BSTR* pbstrLogFilePath
756 ) = 0;
757
758 /// <summary>
759 /// Gets the description of the package failure.
760 /// </summary>
761 /// <param name="pbstrId">The description of the package failure.</param>
762 /// <returns>Standard HRESULT indicating success or failure.</returns>
763 STDMETHOD(GetDescription)(
764 _Outptr_result_maybenull_ BSTR* pbstrDescription
765 ) = 0;
766
767 /// <summary>
768 /// Gets the signature to use for feedback reporting.
769 /// </summary>
770 /// <param name="pbstrId">The signature to use for feedback reporting.</param>
771 /// <returns>Standard HRESULT indicating success or failure.</returns>
772 STDMETHOD(GetSignature)(
773 _Outptr_result_maybenull_ BSTR* pbstrSignature
774 ) = 0;
775
776 /// <summary>
777 /// Gets the array of details for this package failure.
778 /// </summary>
779 /// <param name="ppsaDetails">Pointer to an array of details as BSTRs.</param>
780 /// <returns>Standard HRESULT indicating success or failure.</returns>
781 STDMETHOD(GetDetails)(
782 _Out_ LPSAFEARRAY* ppsaDetails
783 ) = 0;
784
785 /// <summary>
786 /// Gets an array of packages affected by this package failure.
787 /// </summary>
788 /// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/> for packages affected by this package failure. This may be NULL.</param>
789 /// <returns>Standard HRESULT indicating success or failure.</returns>
790 STDMETHOD(GetAffectedPackages)(
791 _Out_ LPSAFEARRAY* ppsaAffectedPackages
792 ) = 0;
793 };
794
795#endif
796
797 EXTERN_C const IID IID_ISetupPropertyStore;
798
799#if defined(__cplusplus) && !defined(CINTERFACE)
800 /// <summary>
801 /// Provides named properties.
802 /// </summary>
803 /// <remarks>
804 /// You can get this from an <see cref="ISetupInstance"/>, <see cref="ISetupPackageReference"/>, or derivative.
805 /// </remarks>
806 struct DECLSPEC_UUID("C601C175-A3BE-44BC-91F6-4568D230FC83") DECLSPEC_NOVTABLE ISetupPropertyStore : public IUnknown
807 {
808 /// <summary>
809 /// Gets an array of property names in this property store.
810 /// </summary>
811 /// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
812 /// <returns>Standard HRESULT indicating success or failure.</returns>
813 STDMETHOD(GetNames)(
814 _Out_ LPSAFEARRAY* ppsaNames
815 ) = 0;
816
817 /// <summary>
818 /// Gets the value of a named property in this property store.
819 /// </summary>
820 /// <param name="pwszName">The name of the property to get.</param>
821 /// <param name="pvtValue">The value of the property.</param>
822 /// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
823 STDMETHOD(GetValue)(
824 _In_ LPCOLESTR pwszName,
825 _Out_ LPVARIANT pvtValue
826 ) = 0;
827 };
828
829#endif
830
831 EXTERN_C const IID IID_ISetupLocalizedPropertyStore;
832
833#if defined(__cplusplus) && !defined(CINTERFACE)
834 /// <summary>
835 /// Provides localized named properties.
836 /// </summary>
837 /// <remarks>
838 /// You can get this from an <see cref="ISetupLocalizedProperties"/>.
839 /// </remarks>
840 struct DECLSPEC_UUID("5BB53126-E0D5-43DF-80F1-6B161E5C6F6C") DECLSPEC_NOVTABLE ISetupLocalizedPropertyStore : public IUnknown
841 {
842 /// <summary>
843 /// Gets an array of property names in this property store.
844 /// </summary>
845 /// <param name="lcid">The LCID for the property names.</param>
846 /// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
847 /// <returns>Standard HRESULT indicating success or failure.</returns>
848 STDMETHOD(GetNames)(
849 _In_ LCID lcid,
850 _Out_ LPSAFEARRAY* ppsaNames
851 ) = 0;
852
853 /// <summary>
854 /// Gets the value of a named property in this property store.
855 /// </summary>
856 /// <param name="pwszName">The name of the property to get.</param>
857 /// <param name="lcid">The LCID for the property.</param>
858 /// <param name="pvtValue">The value of the property.</param>
859 /// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
860 STDMETHOD(GetValue)(
861 _In_ LPCOLESTR pwszName,
862 _In_ LCID lcid,
863 _Out_ LPVARIANT pvtValue
864 ) = 0;
865 };
866
867#endif
868
869 // Class declarations
870 //
871 EXTERN_C const CLSID CLSID_SetupConfiguration;
872
873#ifdef __cplusplus
874
875#ifdef __GNUC__
876 __CRT_UUID_DECL(SetupConfiguration, 0x177F0C4A, 0x1CD3, 0x4DE7, 0xA3, 0x2C, 0x71, 0xDB, 0xBB, 0x9F, 0xA3, 0x6D);
877#endif
878
879 /// <summary>
880 /// This class implements <see cref="ISetupConfiguration"/>, <see cref="ISetupConfiguration2"/>, and <see cref="ISetupHelper"/>.
881 /// </summary>
882 class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration;
883#endif
884 // Function declarations
885 //
886 /// <summary>
887 /// Gets an <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.
888 /// </summary>
889 /// <param name="ppConfiguration">The <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.</param>
890 /// <param name="pReserved">Reserved for future use.</param>
891 /// <returns>Standard HRESULT indicating success or failure.</returns>
892 STDMETHODIMP GetSetupConfiguration(
893 _Out_ ISetupConfiguration** ppConfiguration,
894 _Reserved_ LPVOID pReserved
895 );
896
897#ifdef __cplusplus
898}
899#endif
900
901_COM_SMARTPTR_TYPEDEF(ISetupInstance, __uuidof(ISetupInstance));
902_COM_SMARTPTR_TYPEDEF(ISetupInstance2, __uuidof(ISetupInstance2));
903_COM_SMARTPTR_TYPEDEF(IEnumSetupInstances, __uuidof(IEnumSetupInstances));
904_COM_SMARTPTR_TYPEDEF(ISetupConfiguration, __uuidof(ISetupConfiguration));
905_COM_SMARTPTR_TYPEDEF(ISetupConfiguration2, __uuidof(ISetupConfiguration2));
906_COM_SMARTPTR_TYPEDEF(ISetupHelper, __uuidof(ISetupHelper));
907_COM_SMARTPTR_TYPEDEF(ISetupPackageReference, __uuidof(ISetupPackageReference));
908_COM_SMARTPTR_TYPEDEF(ISetupPropertyStore, __uuidof(ISetupPropertyStore));
909_COM_SMARTPTR_TYPEDEF(ISetupInstanceCatalog, __uuidof(ISetupInstanceCatalog));