MsiGetFeatureInfoA function (msi.h)

The MsiGetFeatureInfo function returns descriptive information for a feature.

Syntax

UINT MsiGetFeatureInfoA(
  [in]                MSIHANDLE hProduct,
  [in]                LPCSTR    szFeature,
  [out, optional]     LPDWORD   lpAttributes,
  [out, optional]     LPSTR     lpTitleBuf,
  [in, out, optional] LPDWORD   pcchTitleBuf,
  [out, optional]     LPSTR     lpHelpBuf,
  [in, out, optional] LPDWORD   pcchHelpBuf
);

Parameters

[in] hProduct

Handle to the product that owns the feature. This handle is obtained from MsiOpenProduct.

[in] szFeature

Feature code for the feature about which information should be returned.

[out, optional] lpAttributes

Pointer to a location containing one or more of the following Attribute flags.

INSTALLFEATUREATTRIBUTE_FAVORLOCAL (1)

INSTALLFEATUREATTRIBUTE_FAVORSOURCE (2)

INSTALLFEATUREATTRIBUTE_FOLLOWPARENT (4)

INSTALLFEATUREATTRIBUTE_FAVORADVERTISE (8)

INSTALLFEATUREATTRIBUTE_DISALLOWADVERTISE (16)

INSTALLFEATUREATTRIBUTE_NOUNSUPPORTEDADVERTISE (32)

For more information, see
Feature Table. The values that MsiGetFeatureInfo returns are double the values in the Attributes column of the Feature Table.

[out, optional] lpTitleBuf

Pointer to a buffer to receive the localized name of the feature, which corresponds to the Title field in the Feature Table.

This parameter is optional and can be null.

[in, out, optional] pcchTitleBuf

As input, the size of lpTitleBuf. As output, the number of characters returned in lpTitleBuf. On input, this is the full size of the buffer, and includes a space for a terminating null character. If the buffer that is passed in is too small, the count returned does not include the terminating null character.

[out, optional] lpHelpBuf

Pointer to a buffer to receive the localized description of the feature, which corresponds to the Description field for the feature in the Feature table. This parameter is optional and can be null.

[in, out, optional] pcchHelpBuf

As input, the size of lpHelpBuf. As output, the number of characters returned in lpHelpBuf. On input, this is the full size of the buffer, and includes a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.

Return value

Return code Description
ERROR_INVALID_HANDLE
The product handle is invalid.
ERROR_INVALID_PARAMETER
One of the parameters is invalid.
ERROR_MORE_DATA
A buffer is too small to hold the requested data.
ERROR_SUCCESS
The function returns successfully.
ERROR_UNKNOWN_FEATURE
The feature is not known.

Remarks

The buffer sizes for the MsiGetFeatureInfo function should include an extra character for the terminating null character. If a buffer is too small, the returned string is truncated with null, and the buffer size contains the number of characters in the whole string, not including the terminating null character. For more information, see Calling Database Functions From Programs.

Note

The msi.h header defines MsiGetFeatureInfo as an alias that 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 is 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

See also

Product Query Functions