Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

ArchiveInspection

Namespace OfficeIMO.Archives
Assembly OfficeIMO.Archives
Source revision a0f47aa4f111 with working tree changes
Implements
IDisposable
Modifiers sealed

An immutable passive inventory with serialized, bounded member reads. Dispose releases its input and decoder indexes.

Inheritance

  • Object
  • ArchiveInspection

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Methods

public Void Dispose() #
Returns: Void

Releases the input snapshot and indexes. Already returned member streams and immutable inventory metadata remain usable.

public Stream OpenRead(Int32 ordinal, CancellationToken cancellationToken = default) #
Returns: Stream

Returns a read-only stream containing one complete length-validated member. Every nonzero CAB frame checksum in its containing folder is checked; absent checksums do not establish authenticity. The source ordinal selects duplicate names independently. The entire containing CAB folder is decoded and charged before returning; no prefix or partial bytes escape. The returned stream is caller-owned and remains valid after this inspection is disposed.

Parameters

ordinal System.Int32 requiredposition: 0
cancellationToken System.Threading.CancellationToken = default optionalposition: 1

Exceptions

  • NotSupportedException – The entry's declared source or compression cannot be read.
  • OfficeInspectionResourceLimitException – A configured or fixed managed admission ceiling is exhausted.
  • InvalidDataException – Decoded content is corrupt.
public Stream OpenStorageStream(Int32 ordinal, CancellationToken cancellationToken = default) #
Returns: Stream

Returns all bytes of one inert raw MSI stream, without interpreting or executing its content. Per-member and cumulative read limits apply, and the returned caller-owned stream survives inspection disposal.

Parameters

ordinal System.Int32 requiredposition: 0
cancellationToken System.Threading.CancellationToken = default optionalposition: 1
public ArchiveReadBatch ReadMembers(IReadOnlyList<Int32> ordinals, Int64 maxSelectedBytes, CancellationToken cancellationToken = default) #
Returns: ArchiveReadBatch

Reads selected complete members in request order, decoding each selected cabinet folder once. Raw duplicate names and MSI aliases remain separate. Selected payload size, ordinals and source support are checked before decoding. A corruption, limit or cancellation failure returns no batch or partial member. The inspection's cumulative expansion and frame-processing work limits also apply. A batch owns its read-only streams independently of this inspection. Memory includes retained selected bytes, input and decoder buffers; limits are not a peak-RSS guarantee.

Parameters

ordinals System.Collections.Generic.IReadOnlyList<System.Int32> requiredposition: 0
Distinct source ordinals from Entries. Their order determines the returned member order.
maxSelectedBytes System.Int64 requiredposition: 1
Finite maximum aggregate selected payload bytes retained in this batch; zero permits only empty members.
cancellationToken System.Threading.CancellationToken = default optionalposition: 2
Cancellation for preflight, folder decoding and selected payload copies.

Exceptions

  • OfficeInspectionResourceLimitException – The selected payload or remaining expansion/work allowance is exhausted.
  • ArgumentException – An ordinal is repeated or the request exceeds the inventory count.
  • ArgumentOutOfRangeException – A size limit is negative or an ordinal is outside the inventory.
  • NotSupportedException – A selected source or compression cannot be read.
  • InvalidDataException – Selected payloads exceed their limit, decoded content is corrupt or a cumulative inspection limit is exceeded.

Properties

public ArchiveFormat Format { get; } #

The detected container format.

public Int64 InputLength { get; } #

Complete input snapshot size.

public IReadOnlyList<ArchiveInspectionEntry> Entries { get; } #

Authored CAB records or MSI File rows in source order, including aliases and unsupported source profiles.

public IReadOnlyList<ArchiveStorageStream> StorageStreams { get; private set; } #

Inert raw MSI storage streams in compound directory traversal order; empty for CAB.

public Int64 ReadBytes { get; } #

Cumulative charged expanded folder and raw stream bytes, including attempted reads that fail.

public Int64 DecompressionWorkBytes { get; } #

Cumulative CAB frame-processing work charged across member reads, including failed attempts after charging. Units bound frame setup and processing rather than exact CPU time or expanded payload size.