DismGetFeatureParent function

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Gets the parent features of a specified feature.

Syntax

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

Parameters

Session [in]
A valid DismSession. The DismSession must be associated with an image. You can associate a session with an image by using the DismOpenSession.

FeatureName [in]
The name of the feature that you want to find the parent of.

Identifier [in, optional]
Optional. Either an absolute path to a .cab file or the package name, depending on the PackageIdentifier parameter value.

PackageIdentifier [in, optional]
Optional. A valid DismPackageIdentifier enumeration value.

Value Meaning
PackageName

Use this value when you want to specify a package by using the package name.

PackagePath

Use this value when you want to specify a package by using an absolute path to a .cab file.

PackageNone

Not a valid value for this function.

Feature [out]
A pointer to the address of an array of DismFeature structures.

Count [out]
The number of DismFeature structures that were returned.

Return value

Returns S_OK on success.

Remarks

For a feature to be enabled, one or more of its parent features must be enabled. You can use this function to enumerate the parent features and determine which parent needs to be enabled.

Example

HRESULT hr = S_OK;
DismFeature* Feature;
UINT FeatureCount;
hr = DismGetFeatureParent(Session,"Xps-Foundation-Xps-Viewer", NULL, NULL, &Feature, &FeatureCount);

Requirements

Supported host platforms:

DISM API can be used on any operating system supported by the Windows® Assessment and Deployment Kit (Windows ADK). For more information, see the Windows ADK Technical Reference.

Supported image platforms:

Windows 7, Windows Server 2008 R2, Windows PE 3.0, Windows 8, Windows Server 2012, Windows Preinstallation Environment (Windows PE) 4.0, Windows 8.1, Windows Server 2012 R2, Windows 10, Windows Server 2016

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

DismAPI.h

Library

DismAPI.lib

DLL

DismAPI.dll

See also

DismEnableFeature

DismDisableFeature

DismGetFeatures

DismGetFeatureInfo

DismDelete