[函式探索可用於需求一節中指定的作業系統。 後續版本可能會變更或無法使用。]
根據標識元取得指定的函式實例。
語法
HRESULT GetInstance(
[in] const WCHAR *pszFunctionInstanceIdentity,
[out] IFunctionInstance **ppIFunctionInstance
);
參數
[in] pszFunctionInstanceIdentity
函式實例的標識碼 (請參閱 GetID) 。
[out] ppIFunctionInstance
用來傳回介面之 IFunctionInstance 介面指標的指標。
傳回值
可能的傳回值包括但不限於下列各項。
| 傳回碼/值 | 描述 |
|---|---|
|
已成功完成命令。 |
|
pszFunctionInstanceIdentity 的值無效。 |
|
方法無法配置執行這項作業所需的記憶體。 |
|
指定的識別碼所代表的函式實例不存在於這部計算機上。 |
|
針對以異步方式傳回結果的提供者,執行呼叫。 |
備註
某些函式探索提供者會使用 IFunctionDiscoveryNotification 介面傳回其查詢結果。 GetInstance 找不到以這種方式傳回的函式實例,而且會因為E_PENDING而失敗。 建議用戶端使用 IFunctionDiscovery 介面的 CreateInstanceQuery 方法來尋找這類提供者的函式實例。
規格需求
| 需求 | 值 |
|---|---|
| 最低支援的用戶端 | Windows Vista [僅限傳統型應用程式] |
| 最低支援的伺服器 | Windows Server 2008 [僅限傳統型應用程式] |
| 目標平台 | Windows |
| 標頭 | functiondiscoveryapi.h |
| Dll | FunDisc.dll |