MsiGetFeatureUsage Function

Windows Installer

MsiGetFeatureUsage Function

The MsiGetFeatureUsage function returns the usage metrics for a product feature.

Syntax

C++UINT MsiGetFeatureUsage(
  __in   LPCTSTR szProduct,
  __in   LPCTSTR szFeature,
  __out  DWORD *pdwUseCount,
  __out  WORD *pwDateUsed
);

Parameters

szProduct [in]

Specifies the product code for the product that contains the feature.

szFeature [in]

Specifies the feature code for the feature for which metrics are to be returned.

pdwUseCount [out]

Indicates the number of times the feature has been used.

pwDateUsed [out]

Specifies the date that the feature was last used. The date is in the MS-DOS date format, as shown in the following table.

Bits Meaning
0 – 4

Day of the month (1-31)

5 – 8

Month (1 = January, 2 = February, and so on)

9 – 15

Year offset from 1980 (add 1980 to get actual year)

 

Return Value

The MsiGetFeatureUsage function returns the following values.

Value Meaning
ERROR_BAD_CONFIGURATION

The configuration data is corrupt.

ERROR_INSTALL_FAILURE

No usage information is available or the product or feature is invalid.

ERROR_SUCCESS

The function completed successfully.

 

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 namesMsiGetFeatureUsageW (Unicode) and MsiGetFeatureUsageA (ANSI)

See Also

System Status Functions

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.