IAppxFactory3::CreateManifestReader2 method (appxpackaging.h)

Important

Some information relates to a prerelease 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.

Creates a read-only manifest object model from contents provided by an IStream, with an optional parameter for specifying the expected digest for the manifest.

Syntax

HRESULT CreateManifestReader2(
  [in]          IStream             *inputStream,
  [in,optional] LPCWSTR             expectedDigest,
  [out]         IAppxManifestReader **manifestReader
);

Parameters

[in] inputStream

The input stream that delivers the manifest XML for reading. The stream must support ISequentialStream::Read, IStream::Seek, and IStream::Stat. If these methods fail, their error codes may be passed to and returned by this method.

[in,optional] expectedDigest

An LPCWSTR containing the expected digest, a hashed representation of the manifest file.

[out] manifestReader

The created manifest reader.

Return value

If the method succeeds, it returns S_OK. Otherwise, it returns an error code that includes, but is not limited to, those in the following table.

Return code Description
APPX_E_INVALID_MANIFEST The inputStream does not contain syntactically valid XML for the manifest.
APPX_E_DIGEST_MISMATCH The digest for the object doesn't match the digest provided in expectedDigest.

Remarks

Use CreateManifestReader2 to read a manifest outside of an app package. This method validates the manifest XML. The manifestReader provides access to all data elements and attributes in the manifest XML. The manifest logs the location of manifest validation errors in the ETW event log for AppxPackaging.

Get the digest string for the expecteDigest parameter by calling IAppxDigestProvider::GetDigest.

Examples

For an example, see Quickstart: Read app package manifest info.

Requirements

Requirement Value
Header appxpackaging.h