MsiGetFeatureInfoA function

The MsiGetFeatureInfo function returns descriptive information for a feature.

Syntax

UINT MsiGetFeatureInfoA(
  MSIHANDLE hProduct,
  LPCSTR    szFeature,
  LPDWORD   lpAttributes,
  LPSTR     lpTitleBuf,
  LPDWORD   pcchTitleBuf,
  LPSTR     lpHelpBuf,
  LPDWORD   pcchHelpBuf
);

Parameters

hProduct

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

szFeature

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

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.

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.

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.

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.

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.

Requirements

   
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