MsiGetFeatureInfo Function

Windows Installer

MsiGetFeatureInfo Function

The MsiGetFeatureInfo function returns descriptive information for a feature.

Syntax

C++UINT MsiGetFeatureInfo(
  __in         MSIHANDLE hProduct,
  __in         LPCTSTR szFeature,
  __out_opt    LPDWORD lpAttributes,
  __out_opt    LPTSTR lpTitleBuf,
  __inout_opt  LPDWORD pcchTitleBuf,
  __out_opt    LPTSTR lpHelpBuf,
  __inout_opt  LPDWORD pcchHelpBuf
);

Parameters

hProduct [in]

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

szFeature [in]

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

lpAttributes [out, optional]

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

Flag Value

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 [out, optional]

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 [in, out, optional]

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 [out, optional]

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 [in, out, optional]

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

VersionWindows Installer 5.0 on 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, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiGetFeatureInfoW (Unicode) and MsiGetFeatureInfoA (ANSI)

See Also

Product Query Functions

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.