Export (0) Print
Expand All

IAppxFactory::CreatePackageWriter method

Creates a write-only package object to which files can be added.

Syntax


HRESULT CreatePackageWriter(
  [in]           IStream *outputStream,
  [in]           APPX_PACKAGE_SETTINGS *settings,
  [out, retval]  IAppxPackageWriter **packageWriter
);

Parameters

outputStream [in]

Type: IStream*

The output stream that receives the serialized package data. The stream must support at least the Write method.

settings [in]

Type: APPX_PACKAGE_SETTINGS*

The settings for the production of this package.

packageWriter [out, retval]

Type: IAppxPackageWriter**

The package writer created by this method.

Return value

Type: HRESULT

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 codeDescription
E_INVALIDARG

The specified hashMethod member of the APPX_PACKAGE_SETTINGS structure is not a valid hash algorithm URI.

ERROR_INVALID_PARAMETER

The specified hashMethod member of the APPX_PACKAGE_SETTINGS structure is not a valid hash algorithm URI.

NTE_BAD_ALGID

The hash value is SHA1.

 

Remarks

The implementation of an IAppxPackageWriter is not guaranteed to write data to the output stream before the Close method is called on the writer object. No other thread should access outputStream until the writer returns from its Close method.

Examples

For an example, see How to create an app package.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

AppxPackaging.h

IDL

AppxPackaging.idl

IID

IID_IAppxFactory is defined as beb94909-e451-438b-b5a7-d79e767b75d8

See also

IAppxFactory

 

 

Show:
© 2014 Microsoft