共用方式為


DismGetFeatures 函式

取得映射中的所有功能,不論功能是否已啟用或停用。

語法

HRESULT WINAPI DismGetFeatures(
  _In_     DismSession           Session,
  _In_opt_ PCWSTR                Identifier,
  _In_opt_ DismPackageIdentifier PackageIdentifier,
  _Out_    DismFeature           **Feature,
  _Out_    UINT                  *Count
);

參數

會話 [in]
有效的 DismSession。 DismSession 必須與映射相關聯。 您可以使用 DismOpenSession將會話與映射產生關聯。

識別碼 [in, 選擇性]
選擇性。 視 PackageIdentifier 參數值而定,.cab檔案或封裝名稱的絕對路徑。

PackageIdentifier [in, optional]
選擇性。 有效的 DismPackageIdentifier 列舉值。

描述
PackageName 當您想要使用套件名稱指定封裝時,請使用此值。
PackagePath 當您想要使用.cab檔案的絕對路徑來指定封裝時,請使用此值。
PackageNone 不是這個函式的有效值。

功能 [out]
DismFeature結構陣列位址的指標。

計數 [out]
傳回的 DismFeature 結構數目。

傳回值

傳回成功 時S_OK

範例

HRESULT hr = S_OK;
DismFeature* Feature;
UINT FeatureCount;
hr = DismGetFeatures(Session, NULL, NULL, &Feature, &FeatureCount);

規格需求

需求 描述
支援的主機平臺 DISM API 可用於 Windows 評定與部署套件所支援的任何作業系統, (Windows ADK) 。 如需詳細資訊,請參閱 Windows ADK 技術參考
支援的映射平臺 Windows 7、Windows Server 2008 R2、Windows PE 3.0、Windows 8、Windows Server 2012、Windows 預先安裝環境 (Windows PE) 4.0、Windows 8.1、Windows Server 2012 R2、Windows 10、Windows Server 2016
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
標頭 DismAPI.h
程式庫 DismAPI.lib
DLL DismAPI.dll

另請參閱

DismEnableFeature

DismDisableFeature

DismGetFeatureInfo

DismGetFeatureParent

DismDelete