msiGetFeatureStateA 函式 (msiquery.h)
MsiGetFeatureState函式會取得功能的要求狀態。
語法
UINT MsiGetFeatureStateA(
[in] MSIHANDLE hInstall,
[in] LPCSTR szFeature,
[out] INSTALLSTATE *piInstalled,
[out] INSTALLSTATE *piAction
);
參數
[in] hInstall
處理提供給 DLL 自訂動作的安裝,或透過 MsiOpenPackage、 MsiOpenPackageEx或 MsiOpenProduct取得。
[in] szFeature
指定產品內的功能名稱。
[out] piInstalled
指定傳回的目前已安裝狀態。 此參數不得為 null。 此參數可以是下列其中一個值。
[out] piAction
接收安裝會話期間所採取的動作。 此參數不得為 null。 如需傳回值,請參閱 piInstalled。
傳回值
MsiGetFeatureState函式會傳回下列值:
備註
請參閱 從程式呼叫資料庫函式。
如果函式失敗,您可以使用 MsiGetLastErrorRecord來取得擴充的錯誤資訊。
注意
msiquery.h 標頭會將 MsiGetFeatureState 定義為別名,根據 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 |
標頭 | msiquery.h |
程式庫 | Msi.lib |
Dll | Msi.dll |
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應