2025-11-28 00:35:46 +09:00

53 lines
1.6 KiB
C

// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
// This is a simple application which uses the Appx packaging APIs to read
// contents of an Appx package, and extract its contents to a folder on disk.
#pragma once
//
// Function to create a writable IStream over a file with the specified name
// under the specified path. This function will also create intermediate
// subdirectories if necessary. For simplicity, file names including path are
// assumed to be 200 characters or less. A real application should be able to
// handle longer names and allocate the necessary buffer dynamically.
//
HRESULT GetOutputStream(
_In_ LPCWSTR path,
_In_ LPCWSTR fileName,
_Outptr_ IStream** stream);
//
// Function to print some basic information about an IAppxFile, and write
// it to disk under the given path.
//
HRESULT ExtractFile(
_In_ IAppxFile* file,
_In_ LPCWSTR outputPath);
//
// Function to extract all footprint files from a package reader.
//
HRESULT ExtractFootprintFiles(
_In_ IAppxPackageReader* packageReader,
_In_ LPCWSTR outputPath);
//
// Function to extract all payload files from a package reader.
//
HRESULT ExtractPayloadFiles(
_In_ IAppxPackageReader* packageReader,
_In_ LPCWSTR outputPath);
//
// Function to create an Appx package reader given the input file name.
//
HRESULT GetPackageReader(
_In_ LPCWSTR inputFileName,
_Outptr_ IAppxPackageReader** reader);