Export (0) Print
Expand All
Expand Minimize

MsiEnumFeatures function

The MsiEnumFeatures function enumerates the published features for a given product. This function retrieves one feature ID each time it is called.

Syntax


UINT MsiEnumFeatures(
  _In_   LPCTSTR szProduct,
  _In_   DWORD iFeatureIndex,
  _Out_  LPTSTR lpFeatureBuf,
  _Out_  LPTSTR lpParentBuf
);

Parameters

szProduct [in]

Null-terminated string specifying the product code of the product whose features are to be enumerated.

iFeatureIndex [in]

Specifies the index of the feature to retrieve. This parameter should be zero for the first call to the MsiEnumFeatures function and then incremented for subsequent calls. Because features are not ordered, any new feature has an arbitrary index. This means that the function can return features in any order.

lpFeatureBuf [out]

Pointer to a buffer that receives the feature ID. The size of the buffer must hold a string value of length MAX_FEATURE_CHARS+1. The function returns ERROR_MORE_DATA if the length of the feature ID exceeds MAX_FEATURE_CHARS.

lpParentBuf [out]

Pointer to a buffer that receives the feature ID of the parent of the feature. The size of the buffer must hold a string value of length MAX_FEATURE_CHARS+1. If the length of the feature ID of the parent feature exceeds MAX_FEATURE_CHARS, only the first MAX_FEATURE_CHARS characters get copied into the buffer.

Return value

ValueMeaning
ERROR_BAD_CONFIGURATION

The configuration data is corrupt.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_MORE_DATA

A buffer is too small to hold the requested data.

ERROR_NO_MORE_ITEMS

There are no features to return.

ERROR_SUCCESS

A value was enumerated.

ERROR_UNKNOWN_PRODUCT

The specified product is unknown.

 

Remarks

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

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiEnumFeaturesW (Unicode) and MsiEnumFeaturesA (ANSI)

See also

System Status Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft