Share via


msiGetFeatureUsageA 函式 (msi.h)

MsiGetFeatureUsage函式會傳回產品功能的使用計量。

語法

UINT MsiGetFeatureUsageA(
  [in]  LPCSTR  szProduct,
  [in]  LPCSTR  szFeature,
  [out] LPDWORD pdwUseCount,
  [out] LPWORD  pwDateUsed
);

參數

[in] szProduct

指定包含此功能之產品的產品代碼。

[in] szFeature

指定要傳回計量之功能的功能程式碼。

[out] pdwUseCount

指出已使用此功能的次數。

[out] pwDateUsed

指定上次使用此功能的日期。 日期為 MS-DOS 日期格式,如下表所示。

Bits 意義
0 – 4
月份 (1-31) 日
5 – 8
Month (1 = January, 2 = February, and so on)
9 – 15
從 1980 年 (新增 1980 的年份位移,以取得實際年份)

傳回值

MsiGetFeatureUsage函式會傳回下列值。

意義
ERROR_BAD_CONFIGURATION
設定資料已損毀。
ERROR_INSTALL_FAILURE
沒有可用的使用資訊,或產品或功能無效。
ERROR_SUCCESS
語言函式已順利完成。

備註

注意

msi.h 標頭會將 MsiGetFeatureUsage 定義為別名,根據 UNICODE 預處理器常數的定義,自動選取此函式的 ANSI 或 Unicode 版本。 混合使用編碼中性別名與非編碼中性的程式碼,可能會導致編譯或執行時間錯誤不符。 如需詳細資訊,請參閱 函式原型的慣例

需求

   
最低支援的用戶端 Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer。 如需 Windows Installer 版本所需的最低 Windows Service Pack 相關資訊,請參閱 Windows Installer Run-Time 需求。
目標平台 Windows
標頭 msi.h
程式庫 Msi.lib
Dll Msi.dll

另請參閱

系統狀態函式