Del via


DismGetPackageInfo function

Gets standard package properties as DismGetPackages, as well as more specific package information and custom properties.

Syntax

HRESULT WINAPI DismGetPackageInfo(
  _In_  DismSession           Session,
  _In_  PCWSTR                Identifier,
  _In_  DismPackageIdentifier PackageIdentifier,
  _Out_ DismPackageInfo       **PackageInfo
);

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.

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

PackageIdentifier [in]
A valid DismPackageIdentifier enumeration value.

Value Description
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 or to a folder containing an expanded package.
PackageNone Not a valid value for this function.

PackageInfo [out]
A pointer to the address of an array of DismPackageInfo structures.

Return value

Returns S_OK on success.

Remarks

You can use this function to determine whether a package is applicable to the specified image. The DismPackageInfo structure contains an Applicable field, which is a Boolean that returns TRUE if the package is applicable and FALSE if the package is not applicable to the specified image.

Example

HRESULT hr = S_OK;
DismPackageInfo PackageInfo;
hr = DismGetPackageInfo(Session, "C:\packages\calc.cab", PackagePath, &PackageInfo);

Requirements

Requirement Description
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
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

DismGetPackages

DismRemovePackage

DismAddPackage

DismDelete