msiQueryFeatureStateA 函式 (msi.h)

MsiQueryFeatureState 函式會傳回產品功能的已安裝狀態。

語法

INSTALLSTATE MsiQueryFeatureStateA(
  [in] LPCSTR szProduct,
  [in] LPCSTR szFeature
);

參數

[in] szProduct

指定包含感興趣功能之產品的產品代碼。

[in] szFeature

識別感興趣的功能。

傳回值

意義
INSTALLSTATE_ABSENT
未安裝此功能。
INSTALLSTATE_ADVERTISED
此功能已公告
INSTALLSTATE_LOCAL
此功能會安裝在本機。
INSTALLSTATE_SOURCE
此功能會安裝為從來源執行。
INSTALLSTATE_INVALIDARG
無效的參數已傳遞至 函式。
INSTALLSTATE_UNKNOWN
產品名稱或功能標識碼不明。
 
 

備註

MsiQueryFeatureState 函式不會驗證此功能是否可實際存取。

注意

msi.h 標頭會根據 UNICODE 預處理器常數的定義,將 MsiQueryFeatureState 定義為別名,自動選取此函式的 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

另請參閱

系統狀態函式