MsiEnumComponents

[This is preliminary documentation and subject to change.]

The MsiEnumComponents function enumerates the installed components for all products. This function retrieves one component code each time it is called.

UINT MsiEnumComponents(
  DWORD iComponentIndex, // 0-based index into installed components
  LPTSTR lpComponentBuf  // buffer of char count: 39
                         // (size of string GUID)
);
 

Parameters

iComponentIndex
Specifies the index of the component to retrieve. This parameter should be zero for the first call to the MsiEnumComponents function and then incremented for subsequent calls. Because components are not ordered, any new component has an arbitrary index. This means that the function can return components in any order.
lpComponentBuf
Pointer to a buffer that receives the component code.

Return Values

ERROR_BAD_CONFIGURATION
The configuration data is corrupt.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_NO_MORE_ITEMS
There are no componets to return.
ERROR_SUCCESS
A value was enumerated.

Remarks

To enumerate components, an application should initially call the MsiEnumComponents function with the iComponentIndex parameter set to zero. The application should then increment the iComponentIndex parameter and call MsiEnumComponents until there are no more components (that is, until the function returns ERROR_NO_MORE_ITEMS).

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msi.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

System Status Functions