MsiEnumFeaturesA function (msi.h)
The MsiEnumFeatures function enumerates the published features for a given product. This function retrieves one feature ID each time it is called.
Syntax
UINT MsiEnumFeaturesA(
[in] LPCSTR szProduct,
[in] DWORD iFeatureIndex,
[out] LPSTR lpFeatureBuf,
[out] LPSTR lpParentBuf
);
Parameters
[in] szProduct
Null-terminated string specifying the product code of the product whose features are to be enumerated.
[in] iFeatureIndex
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.
[out] lpFeatureBuf
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.
[out] lpParentBuf
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
Value | Meaning |
---|---|
|
The configuration data is corrupt. |
|
An invalid parameter was passed to the function. |
|
A buffer is too small to hold the requested data. |
|
There are no features to return. |
|
A value was enumerated. |
|
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).
Note
The msi.h header defines MsiEnumFeatures as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | 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. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |