Compound file storage
lxCompoundFile reads and writes Compound File Binary containers through Pascal streams, including nested storage scopes, MiniFAT payloads and chained DIFAT sectors; native Classic BIFF8 workbook APIs use this backend on Linux and macOS
Use ordinary workbook Open and SaveAs calls for spreadsheet work; the lower-level APIs below are useful for inspecting nested streams, building containers and preserving storage metadata
Read or build a container
TlxCompoundFile.LoadFromStream(AStream, AOwnsStream) loads directory and allocation metadata; AOwnsStream defaults to False, and the backing stream must remain available while extracting its contents
CreateNew(AStream, AOwnsStream) prepares a new container, AddStorage and AddStream queue its contents, and Save selects version 3 or version 4 for the complete planned container, including any required DIFAT extension sectors
| Member | Behavior |
|---|---|
RootIndex | The root directory entry identity, used as the parent for top-level storage and streams |
AddStorage(Name, ParentIndex) | Queues a nested storage and returns its directory identity for adding children |
AddStream(Name, Data) | Queues a root-level byte stream |
AddStream(Name, Data, ParentIndex) | Queues a byte stream in the selected parent scope and returns its identity |
OpenStream(Name), OpenStream(Name, ParentIndex) | Extract a root or scoped stream into an owned TlxCfbStream; a missing stream returns nil |
OpenEntryStream(Index) | Extracts a directory stream by identity; an invalid or non-stream entry returns nil |
HasStream(Name), HasStream(Name, ParentIndex) | Test stream presence in the root or selected parent scope |
FindStorage(Name, ParentIndex) | Returns a storage identity in the selected parent, or -1 when no matching storage exists |
EntryCount, Entries(Index) | Inspect loaded directory entries; indexes are zero-based and must be valid |
SetEntryMetadata(Index, Entry) | Copies only class ID, state bits and timestamps into a valid queued entry or root; structural identities and payloads remain unchanged |
The TlxCfbEntry record exposes Name, EntryType, StartSector, Size, LeftSibling, RightSibling, Child and derived ParentIndex; directory links are indexes, and -1 indicates an absent identity
Its metadata fields are ClassID, StateBits, CreationTime and ModificationTime; timestamps retain raw FILETIME ticks from the 1601 UTC epoch rather than a locale-formatted date
TlxCfbEntryType includes cfbEmpty, cfbStorage, cfbStream and cfbRoot; TlxCfbStream exposes Name, Size, Data, Read, Seek and CopyTo
TlxCfbStream.Seek calculates a beginning-, current- or end-relative position and clamps the result to the inclusive range from zero through Size, the detached payload length; offsets at the Int64 limits are handled without arithmetic overflow, and an unrecognized seek origin leaves the current position unchanged
Extracted streams own detached bytes and must be freed by the caller; corruption, incomplete chains, invalid ownership and cyclic directory or allocation graphs reject instead of returning truncated payloads
lxCfbCompareNames(A, B) applies Compound File Binary length-first ordering with pinned simple BMP uppercase mapping; duplicate names are scoped to their parent, and identical names in separate nested storages remain distinct
Copy large streams in bounded chunks
CopyEntryToStream(Index, Destination): Int64 copies a complete directory stream, while CopyEntryRangeToStream(Index, Offset, Count, Destination): Int64 copies an explicit byte range; offsets, counts and return values are 64-bit
These synchronous methods use the loaded container's backing stream and issue payload reads and destination writes of at most 64 KiB each, without allocating an array for the complete user stream; keep the backing stream alive until the call returns and supply a distinct destination stream
Reader := TlxCompoundFile.Create;
Input := TFileStream.Create('source.cfb', fmOpenRead or fmShareDenyWrite);
Output := TFileStream.Create('payload.bin', fmCreate);
try
Reader.LoadFromStream(Input);
Copied := Reader.CopyEntryToStream(EntryIndex, Output);
finally
Output.Free;
Reader.Free;
Input.Free;
end;
The entire selected entry's allocation chain is validated before destination writes, including for a small range: cyclic, truncated, overlong and out-of-container chains reject with EStreamError; invalid identities, non-stream entries, negative ranges and ranges beyond the declared stream size also reject
A valid zero-length range returns zero without payload I/O; an offset equal to the stream size is valid only for a zero count, and the same source stream object cannot be used as the destination
The source position is restored after payload success or read/write failure; the destination is written at its current position and retains ordinary TStream I/O semantics, so a later I/O failure can leave bytes already written and does not roll back the caller's destination
Allocation tables, directory entries and the root mini-stream sector index remain loaded, while root payload bytes are read on demand; chain-validation memory grows with the allocation-table and entry-sector counts; the 64 KiB bound applies to payload transfer chunks, not total reader memory
Version-4 containers with 4096-byte sectors can expose streams beyond signed 32-bit sizes through these methods; a sparse 5 GiB plus 123-byte stream is qualified across the 2 GiB and 4 GiB boundaries on Win64 using the existing RAD Studio 37 installation and on native Linux
OpenEntryStream and the named OpenStream methods continue to return detached, fully materialized streams with their existing size limits; the native IStorage layer and bounded writer below support large container payloads separately, without establishing support for large BIFF workbook serialization
Native storage interfaces
On non-Windows targets, lxOLE supplies the storage interface implementation required by Classic workbook loading and saving; its IStorage, IStream and IEnumStatStg retain explicit interface ownership and detached native container state
| Factory or helper | Contract |
|---|---|
XlsOpenCompoundStorage(Source, Storage) | Loads a read-only container beginning at stream offset zero |
XlsOpenCompoundStorage(Source, Start, Storage) | Loads the container beginning at the explicit nonnegative offset |
XlsCreateCompoundStorage(Storage) | Creates writable native storage with nested scopes and streams |
XlsWriteCompoundStorage(Storage, Destination) | Serializes the native root storage to the supplied stream; foreign implementations and non-root storage reject |
XlsFreeCompoundStorageName(Name) | Frees native names returned by storage statistics or enumeration; nil is accepted |
The factories return HResult; test Succeeded(Result) before using the returned interface, and release interface references when finished
Read-only mutation fails, cloned stream cursors retain independent positions, and nested copies preserve parent identity and supported metadata; direct serialization does not provide the higher-level workbook destination transaction contract
Native payload storage and 64-bit cursors
Non-Windows storage factories retain detached payload ownership: after XlsOpenCompoundStorage succeeds, the caller can release its original input stream while storage, stream and cloned-stream interfaces remain usable
Each payload starts in memory and moves into its document's shared registered temporary file when it exceeds 1 MiB or the document's resident capacity budget; loading copies user streams directly in bounded chunks through the compound reader
Native IStream reads, writes, seeks, size changes and statistics retain 64-bit positions and sizes, including offsets beyond 2 GiB and 4 GiB; extension and write gaps read as zero, and clones share payload contents while keeping independent cursors
Input loading remains eager and each large payload needs temporary storage capacity for its complete bytes; the source position is preserved, and the temporary directory must be available for payload promotion to succeed
The shared payload file is released when the document's last storage, stream or enumerator interface is released, including load failures after promotion; deleted nodes retain their payload until this document lifetime ends
The 1 MiB per-payload threshold works alongside an 8 MiB document capacity budget; directory/allocation metadata, root mini-stream indexes and interface objects remain outside that resident payload allowance
Native Linux acceptance loads the independent 5 GiB plus 123-byte container entry, releases the original input and root storage before testing surviving stream clones, and independently exercises sparse 64-bit writable streams and failed temporary-file promotion
XlsWriteCompoundStorage queues document-owned streams as borrowed 64-bit ranges for synchronous output rather than cloning each payload into an array; large planned containers select version 4
These storage-interface checks do not establish support for a 5 GiB BIFF Workbook stream or large Classic workbook serialization; payload and allocation budgets remain explicit container-layer boundaries
Document payload capacity and shared spool
Native documents cap resident payload capacity at 8 MiB, with each memory stream allocated in 4 KiB blocks and a 1 MiB per-payload limit; the accounting uses actual TMemoryStream.Capacity and reserves the entire new allocation while the previous allocation may still be live
Budget pressure promotes a payload before allocating beyond the allowance; promotion failure preserves its prior bytes, logical size and independently visible stream cursor, and logical shrink can retain its existing charged capacity
All promoted payloads in one document share one registered temporary file and one file handle, with independent extents, logical sizes and positions; clones continue to share content while retaining separate cursors
The tail extent can grow in place; a non-tail extent moves only after its previous logical bytes have been copied successfully, and geometric capacity growth avoids copying the complete history for each alternating small append
Old extents remain owned until document release, with no compaction or reuse; disk usage can therefore grow with mutation history, and simultaneous documents each have their own resident allowance and possible spool handle
New filesystem extension may be sparse, while regrowth into previously used retained capacity explicitly clears truncated bytes; sparse logical size is distinct from dense input loading or output serialization
Internal promotion copies and zero-fill operations use at most 64 KiB buffers; allocation overflow and temporary-file failures reject, failed unpublished extents never replace visible payload state, and caller synchronization remains required for concurrent document access
Actual filesystem or output I/O failure may leave unreachable disk bytes or partial destination output; the document still owns cleanup, and these APIs do not provide a general filesystem transaction
Native Linux acceptance verifies all 5000 payloads and complete old/new container bytes, plus 96 large payloads under a 64-descriptor limit with one registered spool; test-only instrumentation checks both actual resident capacity and temporary old/new allocation reservations against 8 MiB
A separate sparse witness crosses 2, 4 and 6 GiB shared offsets while reporting logical and allocated bytes independently; the payload allowance excludes metadata, caller buffers and allocator overhead, so this is not a constant whole-process memory guarantee
Native node name lookup and mutation
Non-Windows native storage nodes use an embedded AVL name index for each parent, preserving the existing pinned CFB name comparison, node identities and insertion-order child lists
Load, creation, rename, recursive deletion and replacement maintain the index; enumeration and Save continue to use the original child lists, and case-only rename retains its existing identity
Creation reserves the existing lists before publishing a prepared node, and rename completes managed-name allocation before unlinking the old key; no additional key string or dynamic index array is introduced
Malformed containers with duplicate same-parent names now reject before exposing an ambiguous native document, with source-position restoration and partial-load cleanup; names in different parent scopes remain independent
The index adds four Integer fields, observed as a node-instance increase from 120 to 136 bytes under Linux FPC; metadata remains proportional to node count, and the native document does not expose a separate global node-object budget
The existing reader and writer 256 MiB metadata ceilings and writer 1000000-entry ceiling are unchanged; those allocation-table and queue limits do not describe the complete native object graph
In one 15000-entry measurement, CopyTo changed from 29428 to 252 ms, Load from 67 to 189 ms, Save remained 138 ms, and peak RSS changed from 40052 to 40968 KiB; these retain both construction cost and lookup benefit without a general performance guarantee
Independent parsing checks every path and complete payload for the 5000-entry and 15000-entry controls, and their complete copied containers plus the mutation control remain byte-identical to their respective baselines
Deleted node objects and child-list slots remain owned until document release; existing partial recursive deletion on pending-list allocation failure and replacement-before-creation failure semantics remain unchanged
Native node indexing remains specific to non-Windows storage; both native and Windows file-backed container publication are described below
Reserved range-lock sector in large containers
Version-4 writing reserves the complete 4096-byte sector containing file offsets 0x7FFFFF00 through 0x7FFFFFFF, as required when a compound file grows beyond 2 GiB by [MS-CFB] section 2.8
The reserved sector is zero-filled and marked ENDOFCHAIN; user streams, the root mini stream, MiniFAT, directory, FAT and DIFAT allocations skip it, and the header and allocation chains never refer to it
The complete layout calculation includes this sector before fixing FAT and DIFAT sizes, including cases where the reservation itself requires another FAT sector; payload transfers remain bounded to 64 KiB
Saved writer instances retain the actual physical mini-stream index, so immediate extraction and a subsequent Save use the same skipped-sector layout correctly; source cursors, caller ownership and ordinary partial-output behavior after an actual write failure remain unchanged
The reservation adds one physical sector to a layout that reaches that location, plus a fixed 4096-byte scratch buffer charged to the writer metadata limit; version-3 output and the representative small native container remain byte-identical to their prior output
Acceptance includes actual sparse containers with data, mini-stream, MiniFAT, directory and FAT chains across the reservation and DIFAT starting immediately after it, plus complete byte comparison and SHA-256 validation of a 5 GiB plus 123-byte payload and independent extraction of 1032 mini-stream payloads
The large acceptance file is sparse and does not establish dense-disk throughput or large BIFF Workbook, VBA or embedded-object behavior; Windows OLE32 reads its 2 GiB payload control through a read-only ILockBytes adapter, while direct WSL UNC opening retains the platform's separate failure
Qualification correction: the earlier 2.384.177 large-output payload hashes and byte checks remain valid observations, but that output used this reserved sector in its payload chain and therefore did not establish full CFB format conformance; 2.384.184 corrects the writer, with original evidence retained unchanged
Reading previously generated containers is unchanged, and this writer correction does not claim stricter range-lock validation during input loading
File-backed native container commit
On non-Windows targets, Classic workbook and VBA-project container commit stages the complete serialized container in a registered temporary file, removing the previous full-container memory stream
A file target uses a sibling temporary file, closes it after complete serialization and then calls the existing atomic file replacement helper; a stream target starts publication only after complete staging and copies at most 65536 bytes per write
Caller storage and destination streams remain borrowed; stream publication starts at the current cursor without truncating existing trailing bytes, while failure before publication preserves existing file bytes or stream bytes and position
An actual destination stream failure after publication starts can still leave partial bytes, and the complete staged container requires sufficient temporary disk capacity
The exact commit helper with actual native storage completes 256 MiB and 2 GiB plus 4097-byte payloads under a 128 MiB process address-space limit, with observed maximum RSS of 6740 KiB; the larger case emits a 2149609472-byte container using the corrected range-lock layout
The large sink measures completed byte counts and publication request sizes rather than a complete large-output hash; separate public Classic SaveAs, reopen, cancellation and retry checks retain byte-identical small output, and independent parsing verifies complete small payloads
This helper is specific to non-Windows targets; Windows file-backed staging is described below, while large BIFF Workbook, typed VBA and embedded-object acceptance remain separate work, so generic container sizes do not imply arbitrary large workbook authoring
Windows file-backed compound save
Windows Classic workbook and VBA-project saves build native OLE32 storage in a temporary file instead of a complete HGLOBAL memory buffer, retaining transactional publication and shared root lifetime
Ordinary small output keeps the platform-default version-3 container with 512-byte sectors; version 2.384.857 chooses wide geometry from the complete prepared output, including the root children described below
Storage, stream, cloned stream and enumerator wrappers retain all ancestor storage leases, allowing children to outlive workbook, root and intermediate storage references; native COM deletes its backing file after the final retained child releases its leases
The wrappers expose the existing IUnknown, IStorage, IStream and IEnumSTATSTG surfaces and their internal identities; unsupported QueryInterface requests return E_NOINTERFACE, while supported storage copying and moving unwrap native destinations before delegation
Serialization and commit complete before caller publication starts; file targets use registered sibling staging and atomic replacement, while stream targets publish at the existing cursor in chunks of at most 64 KiB without truncating trailing bytes
Preflight accepts the exact version3/512 or version4/4096 geometry and follows the declared allocation-pointer chain to the geometry-derived range-lock entry before publishing a large stage; while native storage references keep the256-byte window at 0x7FFFFF00 through 0x7FFFFFFF locked, publication emits zero only for that verified reserved window and copies all other bytes directly
The historical internal186 stage profile explicitly used version4: an actual2GiB plus4097-byte payload published a2149617664-byte container in32802 fixed chunks, with every nonreserved byte compared against the native backing file and observed peak Working Set15880192 bytes; that observation does not qualify the later default-version3 selection policy
Before-publication failures preserve caller bytes and position; later stream I/O failures retain ordinary partial-output semantics, and caller ownership, synchronization and external-file-alias responsibilities remain explicit
VBA-project file export uses the same staged publication without deleting the existing target first; a real legacy project is exported and reloaded as data, with all fifteen project streams compared independently and no macro execution or new signature-trust claim
Native COM metadata and transaction scratch remain backend-managed, and editable BIFF, VBA and embedded-object carriers retain separate limits; this container-stage change does not establish arbitrary large workbook or embedded-object support
Win64 native storage timestamp calls
The non-FPC Win64 declaration and Windows wrapper for IStorage.SetElementTimes pass the three TFileTime records with const [ref], matching native OLE32's FILETIME* parameters
The previous unmanaged-class declaration could pass each eight-byte record as a value and cause an access violation when native storage interpreted it as a pointer; the correction applies consistently to the declaration, override and implementation
Existing source calls with record variables and record-valued expressions retain their syntax, but consumers compiled against the old incorrect ABI must be rebuilt; compatibility with those existing binary call sites is not claimed
Actual controls verify typed calls to native storage, typed calls through the retained wrapper and standard native pointer calls through the wrapper, with exact nonzero creation and modification time readback
Native calls with null time pointers preserve the corresponding existing values; missing elements retain the same failure HRESULT as the raw backend, and the tested backend accepts an all-null call without changing its times
The conditional qualifier does not change the Win32 or FPC declarations, and no new execution matrix is claimed for those branches or other Delphi compiler versions
Detached Classic storage payloads
TXLSFileStorage and TXLSFileStream detach loaded payloads through two size-aware paths: ordinary payloads up to64KiB stay in a private resident Blob, while larger payloads use immutable ranges in one lazily created registered file per storage forest, with copy requests of at most65536 bytes
The native input storage can be released after loading; clones of large unmaterialized payloads share range ownership, while resident small payloads and explicitly materialized mutable TXLSBlob values are deep-copied for editing isolation
TXLSFileStream.DataSize64 reports the stored Int64 size, or the actual Data.DataLength after editable materialization; CopyToStream publishes the current payload at the caller's stream position without exposing the private backing file
The existing LongWord DataSize retains its stored-size meaning and refuses overflow; explicit Data access remains a complete editable-blob request and refuses stored sizes above MaxInt before allocation
A forest allows at most1048576 live items,128 nested storage frames and256MiB of conservatively charged metadata, including a fixed512-byte item allowance plus UTF-16 names; small payload residency is separate, while large retained payloads depend on available disk space and Int64 offsets
Failed stream or whole-folder loading preserves existing committed item state; a failed append does not publish its range and attempts to restore the previous file extent, while later destination I/O keeps ordinary partial-output semantics
Registered backing files are released with the last forest or clone reference; this removes automatic whole-stream payload allocation without making the explicit editable blob API a large-stream editor
Checked BIFF aggregate positions
Classic workbook and worksheet serialization keeps aggregate lengths, stream positions, SST pointer tracking and row-block positions as checked Int64 values
The actual BoundSheet, ExtSST and INDEX four-byte pointer fields check unsigned 32-bit values at serialization; DBCELL checks its relative four-byte distance while retaining the existing zero fallback for unavailable 16-bit row distances
A legal final SST pointer can remain representable even when later SST bytes extend beyond unsigned 32-bit positions; no blanket signed-2-GiB or unsigned-4-GiB Workbook size refusal replaces actual field checks
The legacy width-limited size and Store interfaces remain callable and refuse an unrepresentable result instead of truncating it; advanced callers use the separately named 64-bit helpers described in Classic size and row-block APIs
Ordinary BIFF8 Workbook and BIFF5 Book streams remain completely byte-identical to the baseline in the representative public round trips
Boundary offset controls use simulated logical counters, not a complete valid giant Workbook; separate test-only offset injection confirms that wire refusal protects existing file/stream destinations and supports subsequent reuse
Rebuild binary consumers after the class-layout changes; typed record/model memory remains proportional to represented data
Bounded Classic sheet-name discovery
The FileName overload of GetSheetNames now reuses the existing record-wise Stream reader rather than allocating the complete Workbook or Book stream just to return names
Existing ZIP dispatch remains in place, and Classic BOF, FILEPASS, BoundSheet decoding, EOF and caller stream ownership follow the existing stream-reader contract
A real 4194304-byte public fixture returns both names under an individual GetMem exclusion of one MiB or more: the old 4150205-byte request fails and the candidate's largest observed request is 8224 bytes
This experiment does not bound aggregate RSS, other allocator entry points or native mapped pages; drawing aggregate traversal has its separate qualified 64-bit range profile below
64-bit drawing aggregate ranges
Classic sheet drawing parsing keeps aggregate positions and node progress as Int64, so a complete generic record envelope no longer returns without events when its logical body crosses the signed 2 GiB boundary
Blob-list range reads and drawing header cursors can address bytes beyond the unsigned 4 GiB aggregate position; the actual Escher record-length field remains UInt32, with checked arithmetic for header and child progress
Existing narrow entry points remain callable for small inputs and explicitly reject lengths or progress that cannot fit their declared width; rebuild dependent binary packages and applications after the parser class layout change
Qualified large logical controls use real typed list entries sharing immutable 4 KiB chunks, with every entry length included in the aggregate; skipped leaf envelopes avoid allocating their large body
This earlier physical-read profile does not itself provide bounded retained leaves; the later PNG/JPEG source-backed authoring and import profiles below supply that capability for their represented image kinds
Small actual native-authored embedded workbooks retain shape inventory through public file/stream saving and reopening, with complete Obj and Drawing record bytes preserved
Global drawing read ranges
Classic global drawing parsing keeps aggregate positions and remaining container lengths as Int64 across the drawing group, picture store, FBSE, drawing-ID clusters and property records
Known child handlers retain full positions when a body or complex-property tail crosses the unsigned 4 GiB cursor boundary; record and retained-leaf lengths remain UInt32
Container extents are checked before dispatch, picture metadata stays inside its declared record, and drawing-ID clusters are decoded in at most 32 KiB chunks instead of copying the complete cluster body
Distinct Parse64 entry points and GetWideString64 accept Int64 starts; existing narrow parser methods remain callable and a narrow FBSE cursor refuses an unrepresentable advance before changing that cursor
Large logical controls use real typed entries sharing immutable 4 KiB chunks, including a full UInt32 picture-store extent and native PNG bytes read above 4 GiB; the native picture itself remains small
A complete small Excel-authored BIFF8 image workbook retains every PNG byte and its picture shape through public file/stream saving and reopening, and both outputs reopen in Excel
Global drawing writing, file-authored PNG/JPEG retention and embedded PNG/JPEG import follow the wide paths below; opaque transport, represented typed metadata and object interpretation keep their separately documented finite limits
Atomic drawing-property replacement
Reading an ordinary drawing-property record stages its entries and complex bodies privately, then replaces the existing property collection after every read succeeds
Malformed bounds, failed reads and allocation failures during prospective reads retain the previous property bytes and item ownership; repeated property identifiers, including aliases that differ only by flags, refuse admission because the keyed model cannot represent them without ambiguity
Valid ordinary and fragmented complex values retain their existing serialized representation, and an explicit empty replacement still clears the prior collection
This property-record guarantee does not imply complete Workbook load rollback, a source-backed path for every large known property or completion of the remaining mixed-container work
Bounded typed table field output
Classic typed table metadata writes its Feature11 fields directly through one 8228-byte scratch, avoiding both the complete feature-body temporary and a second complete expanded continuation-chain copy
The base record retains identity 0872 with up to 8224 payload bytes; later 0875 records retain their repeated 12-byte future header and up to 8212 data bytes, with no ordinary 003C or string-restart marker substituted
Field order, identifiers, table name, column names and captions remain exact, including cuts inside a UTF-16 word; the existing 256-column, 58-character-header profile reconstructs a 71802-byte body and a 71934-byte physical chain across nine records
The represented large plain additional save heap falls from 206688 to 102416 bytes, while the small case uses 102256 bytes and final RC4 uses 102400 bytes; the largest allocation is 65552 bytes from surrounding save machinery
Ten complete outputs retain thirty logical stream comparisons and table save/reopen; an actual staged append failure frees the scratch, preserves the target and source table, releases temporary owners and permits same-source retry
The scratch is borrowed synchronously by the output stage, released in finally and charged to worksheet offsets through the actual staged byte delta; source cells, column strings and metadata remain resident
This changes serialization of an existing typed table profile, with no new native table acceptance, arbitrary field-length support, generic continuation policy or unknown-container repair; other metadata families and mixed physical ownership use their own documented producers
Generated Pivot cache output staging
Generated inline and independent Classic Pivot cache outputs use the existing sequential staged output list; save-finally cleanup releases generated lists and their temporary files after all worksheet cache-view consumers finish, or when saving is abandoned
Source cache objects and retained raw buckets remain owned by the Workbook, and borrowed output routing stays available through worksheet SXView binding; existing two-pass order, stream identifier reservation, raw replay, record emitters and continuation policies remain unchanged
Inline cache bytes retain the Workbook cipher position, while every independent cache storage stream starts its own cipher at zero; plain, RC4 and retained CryptoAPI outputs preserve complete logical bytes under the declared random verifier normalization
On the represented 4096-row source, additional save heap falls from 203952 to 128888 bytes and the largest allocation remains 65552 bytes; the 128-row source uses 128728 bytes, so the measured residual growth is 160 bytes
Each stage contains a fixed 4048-byte pending array, with one inline stage even when empty and one stage per emitted independent cache; the small case pays fixed overhead and total stage overhead grows with cache count
Fifteen complete output files retain sixty logical stream comparisons, source/cache identities, physical row counts and worksheet offsets; cancellation and locked-target publication failure preserve the target and allow the same live source to retry after registered temporary output is released
Source cells, cache models and raw buckets remain resident; this changes generated output lifetime rather than adding a cache calculation feature, native refresh qualification, arbitrary large field support or unknown-container streaming
Bounded printer and background record output
Classic printer-driver data and the existing bitmap background profile now write bounded source slices directly into staged output, without constructing a complete framed record and a second complete continuation chain
The first physical record keeps its original identity and later fragments use ordinary Continue bodies with no added payload prefix; offsets include each actual physical header, and the existing empty-source, printer-size and Excel97-only background rules remain unchanged
The original Version 2.384.337 output qualification used a two-Worksheet source with either 20 KB printer data and a 64-pixel bitmap or 1 MiB printer data and a 1024-pixel bitmap and measured 120536 bytes of additional requested Pascal output heap; the largest request remains 65552 bytes, compared with an old large peak of 6368712 bytes and a complete-chain request of 3147308 bytes
The bitmap inputs are structurally complete 24-bit BMP/DIB files, while the larger opaque printer inputs qualify byte transport only; seven actual short native printer records retain exact DEVMODE bytes, without implying that arbitrary large data is a usable printer driver
Plain output, public RC4 reopening/plain reserialization, same-source retry, physical offsets and 36 complete logical streams retain their qualified behavior; BIFF5 keeps its 2080-byte continuation limit and omits the source background without clearing it
Printer data now follows the shared immutable source contract below, while explicitly requested complete printer arrays and background resources still materialize their full bytes; imported backgrounds can use the owned-source path below, and temporary disk plus native/OS allocations remain outside the incremental heap counter
Future-record framing and field builders retain family-specific contracts; staged Pivot cache output and bounded field producers are described separately rather than implied by this local increment
Complete printer-setting continuation output
Version 2.384.517 restores complete saving of represented Classic printer settings that span more than one physical BIFF record, within the existing per-setting size allowance
The first printer record and its ordinary continuation bodies reconstruct the complete original bytes, with no added payload prefix; the existing small-record, size, cancellation and staged-destination rules remain in force
The represented ordinary save, reopen and source-free worksheet-copy paths retain the complete printer data; complete public byte getters remain detached values
The large opaque controls qualify transport and continuation structure, not native driver validity, printing behavior or a different maximum printer-setting size
Shared printer-setting sources and format conversion
Version 2.384.518 retains ordinary Classic worksheet printer-driver data and XLSX worksheet printer-settings parts in shared immutable sources, so represented worksheet copies retain complete bytes after the source workbook or input stream is released without duplicating the complete payload in every copy
Reading PrinterDriverData still returns a detached complete byte array, and assigning it snapshots the caller's complete bytes; replacing or clearing one worksheet's data leaves other copies unchanged, and complete byte snapshots retain their existing payload representation
Classic PLS data includes its original two-byte prefix, while an XLSX printer-settings part stores the body without that prefix; recognized Windows bodies convert by removing the Classic prefix or adding a new zero prefix, while typed page-setup values remain authoritative
Cross-format recognition covers ANSI public DEVMODE layouts of 124, 148, and 156 bytes and Unicode layouts of 188, 212, and 220 bytes, with a terminated device name and an exact public-size plus driver-extra extent; a nonzero modern Classic reserved word is ignored after the body is independently recognized
Same-format transport preserves unknown, Mac, and otherwise unmatched application-defined bodies and the original Classic prefix byte for byte; an unmatched body is explicitly unsupported for cross-format conversion, and a prefix-only Classic payload does not supply a convertible body
The per-setting limit remains 1 MiB, including the two-byte prefix for Classic data; converting a 1 MiB XLSX body to Classic refuses because the required prefix would exceed that limit, and unsupported-body or size preflight refuses before destination publication
Ordinary Classic worksheet loading checks each physical printer-record continuation against the allowance before retaining another body, avoiding complete aggregation of an oversized chain; empty continuation bodies preserve the complete logical payload, while a first printer body shorter than its required prefix refuses
XLSX adoption completes CRC, declared-size, actual-extra, and size-stability checks before publishing a retained source; positive partial reads are accepted, and invalid input does not prevent a subsequent valid open on the same workbook object
| Observed Win64 operation | Before | Shared-source implementation |
|---|---|---|
| Eight Classic worksheet copies with 1 MiB printer data, incremental requested Pascal heap peak | 8466712 bytes | 78056 bytes |
| Eight XLSX worksheet copies with 1 MiB printer data, incremental requested Pascal heap peak | 8441936 bytes | 53584 bytes |
| Explicit complete getter for 1 MiB data, requested Pascal heap peak | 1048592 bytes | 1048592 bytes |
| Rejecting a 16 MiB printer chain from a raw BIFF stream, source bytes read | 16787396 bytes | 1055162 bytes |
| The same oversized Classic input, incremental requested Pascal heap peak | 17099504 bytes | 1257744 bytes |
These are focused incremental allocation and source-read observations, not total process RAM or total I/O limits; Windows compound-container reads remained 20096520 bytes before and after, and the existing XLSX declared-size prelimit already rejected oversized parts
Seven historical native Classic printer occurrences and the corresponding XLSX evidence contain one distinct Windows driver body with a 220-byte public layout and 1044 driver-extra bytes; the other layouts and nonzero-prefix controls are structurally derived controls, and this work adds no native printing or driver-execution qualification
The represented cross-workbook overlap control saves and reopens after source release with a destination opened from the same native workbook context; the ordinary control with a header image retains its existing copy refusal; the separately reproduced Classic copied-sheet save failure was traced to local print-name ownership and is corrected by the destination print-area and title binding repair in version 2.384.519
These printer changes do not establish unrestricted worksheet copying, support for chart or custom-view raw printer records, arbitrary cross-format application-defined settings, or additional platform qualification
Rebuild dependent binary packages and applications together against the same HotXLS version
Source-backed Classic worksheet backgrounds
Version 2.384.515 retains imported BIFF8 worksheet backgrounds in shared immutable sources, moving larger logical bodies from bounded input retention to a managed temporary file instead of keeping a complete background array in each worksheet
Same-workbook and cross-workbook worksheet copies share that source without reading its complete payload, and the source remains valid after the original workbook or input stream is released
Replacing or clearing a background releases only that worksheet's reference; source-size checks, positive partial reads and failed-adoption ownership retain the current source on refusal
Supported backgrounds save as the original background record followed by ordinary continuation bodies, with one bounded reusable output buffer and complete physical-header accounting; the existing BIFF8-only output condition and raw-format boundaries remain unchanged
BackgroundImageData and BackgroundImageResource remain explicit requests for a complete materialized resource, retaining the current bitmap-header, raw-format and signed-size behavior without advancing the background generation
For the measured 3,145,776-byte logical bitmap body, additional requested Pascal import peak falls from 22,227,520 to 1,245,848 bytes, and the largest request falls from 3,145,800 to 65,552 bytes; pre-existing caller input, native allocations and operating-system memory are excluded
The combined same-workbook and cross-workbook copy phase reduces its measured additional Pascal peak from 6,418,208 to 126,624 bytes; temporary source and output files still scale with payload size
Public import, source-free copies, complete saving and reopening are qualified for the finite bitmap and retained raw-metadata controls, including failed reads, cancellation and healthy retry; existing single-record control streams remain byte-identical
A virtual source above MaxInt qualifies only envelope and metadata access, source sharing and lifetime without reading the large payload; no complete public import/save/reopen above MaxInt, giant-image decoding, native rendering or bounded total-workbook heap is claimed
Bounded sequential worksheet output
Complete Classic saving stages ordinary Worksheet preheader, header and footer records in private lazy temporary files; their producers append complete records sequentially, and existing Index, BoundSheet and retained Pivot cache-ordinal fixups occur before publication
Drawing, comment, body and worksheet record order remains unchanged, and the existing persistent cipher traverses the staged output at the same physical positions
Two worksheets with 128 and 4096 hyperlinks both use 120568 bytes of additional requested Pascal heap during output, compared with baseline peaks of 234592 and 5226368 bytes; the largest individual request remains 65552 bytes
The three added lists contribute 12144 fixed inline pending bytes per ordinary Worksheet, totaling 20240 across five staged lists, plus object overhead; this overhead grows with Worksheet count, while temporary disk grows with output and the source model remains resident
Final checks compare 26 complete logical compound streams and decode actual hyperlink, QuickTip, BOF and DBCell targets; retained Pivot views keep their worksheet definition and separate cache storage
Cancellation preserves the destination and permits same-source retry; a separate transport fault profile uses a real partial temporary-file write and checks failed-input caller ownership and stage cleanup
This historical increment did not change every local producer; later table-field builders, raw-family admission and retained Pivot cache output use the separately described bounded producers and lifecycle rules
The counter excludes source construction, native/OS allocation and total process RSS; public RC4 reopening/plain reserialization is separate from randomized ciphertext identity and independent raw decryption
Lossless bounded header/footer picture output
Classic saving preserves short physical HFPicture records exactly and emits oversized logical drawing bodies as repeated HFPicture records with the original 14-byte FrtHeader and the continuation flag set on later fragments
Legacy generic Continue bodies retain every byte; a repeated header is removed only when its exact identity and the complete owned OfficeArt length prove that framing, preventing silent loss of 14 bytes per unframed continuation
The writer reuses one bounded record buffer and appends synchronously into staged output; source pictures remained resident in the historical333 profile, while854 adds the retained worksheet picture sources; split logical entries may reopen as multiple physical entries and temporary disk capacity still grows with output
Final public checks cover six logical sizes from 8224 bytes to 12 MiB, cipher reopening, cancellation cleanup and same-source retry; the 2 MiB and 12 MiB inputs both use 85032 bytes of additional requested Pascal heap, with a largest request of 65552 bytes, compared with previous peaks of 4243852 and 25220472 bytes
Large derived inputs enlarge valid OfficeArt name metadata and parent extents; they qualify transport and memory behavior, while native large-image rendering remains outside this profile
Four genuine native inputs retain exact physical picture records; nine actual native checks cover ordinary header/footer text, picture geometry, normal opening, native saving and reopening, with final output bound to that native input by all logical compound-file streams
The heap counter starts after source-model construction and excludes native/OS allocations and total process RSS; public RC4 reopening followed by plain saving is not an independent raw decryption oracle
Staged Pivot cache output, bounded local field builders and opaque source transport have their own finite profiles; this record family does not establish arbitrary metadata interpretation or universal continuation
Bounded ordinary comment output
Complete Classic Workbook saving also stages the ordinary drawing, OBJ/TXO and Note transport in a private lazy temporary file instead of retaining a second complete serialized copy in memory
Record order, borrowed source blobs and the existing persistent cipher position remain unchanged; source comments remain part of the resident model, and temporary disk capacity grows with serialized output
Each ordinary Worksheet uses a fixed 4048-byte pending buffer even when its comment transport is empty, while its temporary file is created only when needed; publication uses the existing chunks of at most 64 KiB
The focused 4096-comment public save writes a 9702537-byte Workbook stream with 85280 bytes of incremental requested Pascal heap, compared with 9927712 bytes before this change; a 128-comment source uses 85056 bytes and the largest individual allocation remains 65552 bytes
The counter begins after model construction and measures Pascal heap only; it excludes total process RSS, native OLE allocations, operating-system cache, stack and temporary disk usage
Plain output, public RC4 password reopening and complete plain reserialization retain equivalent logical CFB streams; randomized cipher bytes are not equated and the resave comparison is not an independent raw decryption oracle
Cancellation after the first worksheet's serialization preserves an existing destination, releases all stage owners and permits saving and reopening the same source on retry
The current staged cache, bounded local-producer and opaque-transport profiles are separate from this increment; no bounded total Workbook memory or repeated giant-file/platform matrix is claimed
Bounded Classic shared-string input staging
Ordinary Classic Open retains up to 262144 SST/CONTINUE body bytes and 64 physical records in its existing pool, then moves the group into one registered temporary file with each physical body length and its original bytes
After this transition, input staging retains the first dispatch body and one current read buffer without a per-record index; aggregate byte counts, record counts and parser cursors use checked Int64 values, while each physical body keeps its unsigned 16-bit wire boundary
Character continuations preserve their compressed/wide flags and embedded NUL characters; rich-run and phonetic tails remain raw bytes, and availability checks do not replace or invalidate the active body buffer
RC4 and CryptoAPI input reaches this stage after the existing decryption path; metadata-only and custom-view routing remain unchanged, and temporary storage is released after successful parsing or rejection
Two growth inputs saved through the public Classic writer contain 4096 and 16384 distinct 512-character strings, each genuinely referenced by a cell; their row blocks, DBCell offsets, INDEX pointers and complete shared-string reference counts pass independent structural checks
For those 2400679-byte and 9596348-byte inputs, the focused Win64 observation at the first header read after the SST group changes live wire-stage allocation from 2331496 and 9123752 bytes to 76528 bytes for either input
Retained opened-model allocation remains 9957392 and 39474408 bytes in both versions, and complete Open process peaks still grow with the model; the observation concerns avoidable encoded input retention, not constant whole-workbook memory
Temporary disk use grows with physical body bytes and two-byte length headers; the temporary directory must remain available, and failure to create or write that stage reports the existing load failure
Focused wire controls separately cover compressed/wide changes, rich and phonetic boundaries, malformed tails and encrypted copy/save/reopen; custom low-level and trailing-padding inputs are parser controls rather than native whole-workbook conformance claims
A separate extracted internal staging check walks 64 MiB of body data and 131072 empty records; it qualifies the internal cursor and staging resources only, without extending public workbook-size or platform guarantees
Bounded ordinary BIFF output staging
Complete Classic Workbook saves stage ordinary worksheet body records and the main Workbook globals, including encoded SST and CONTINUE records, in private temporary files instead of retaining the complete encoded record lists in memory
The output stage retains one fixed 4048-byte pending buffer and publishes in chunks of at most 64 KiB; Int64 aggregate totals, BoundSheet offsets, INDEX and ExtSST locations retain their original calculation and serialization order
Staged lists participate at the same positions in the existing persistent BIFF cipher traversal, preserving plain BIFF8, RC4, CryptoAPI, BIFF5 plain and XOR output behavior without restarting encryption at a staging boundary
Successful append retains the original input-ownership rule, while a failed append leaves its input caller owned even after a real partial temporary-file write; a failed stage cannot publish an apparent empty success
Whole-save cleanup releases temporary owners after success, failure or cancellation, and the same Workbook remains reusable with fresh stages; the existing container transaction publishes the completed target, with HRESULT and short-write checks on the output stream
A qualified source containing 12000 independent strings of about 1 KiB saves and reopens with a measured incremental Pascal heap peak of 79944 bytes and a largest request of 65552 bytes under the unchanged 4 MiB gate; its complete logical streams equal the former buffered writer output
The measurement begins after the source model is authored and excludes native allocations, process RSS, stack storage and operating-system file cache; resident cells and shared strings remain part of the normal model, while temporary disk capacity grows with encoded output
The internal stage adds no public storage class; the existing append and write methods gain virtual dispatch, so dependent compiled units and runtime packages must be rebuilt together
Staged cache output, bounded local field builders and physical SST input staging are documented separately; none of these transport profiles makes an unrepresented object semantic editable or renderable
Unknown wrappers and mixed physical drawing tails
Classic worksheet drawing input retains unknown wrapper containers together with supported flat typed descendants, using incremental checked eight-byte headers and separate owned files for logical bodies and physical OBJ, TXO and chart tails
ClientData and ClientTextbox markers require a real structural shape owner, zero flags and body length, and exactly one complete matching physical tail; child extents, text/run counts and chart boundaries are checked before the staged drawing model is finalized
Unknown leaf contents remain opaque even when they contain bytes resembling host markers; source-backed wrappers keep their order without a complete wrapper or aggregate payload allocation
Current supported comments, controls, picture properties and charts regenerate their typed tails on saving; deletion and destruction invalidate retained associations before address reuse, while copied unknown ranges keep the source alive independently
Partial drawing output resumes after each physical tail with the correct EC framing, including an exact 8224-byte boundary; current connector-rule collections emit once, with checked opaque solver metadata ownership and explicit refusal for concealed typed descendants
The finite domain has one root drawing, one directly owned root shape group, at most one directly owned solver, 65536 indexed nodes and tails and depth 64; NOTE metadata is limited to 65536 entries and 16 MiB of author strings
Actual Win64 final-source checks cover malformed and truncated input, legal depth 64, supported owner edits, source-free two-picture copying, cancellation, a real late write failure, unchanged-target publication and successful retry
For the actual 4 MiB opaque metadata payload, incremental Pascal heap peaks are 243224 bytes for Open, 198552 for Save and 133752 for copied Save, with a largest request of 65552 bytes; resident model baselines, metadata limits, native allocations, OS cache and stack remain separate
Ordinary native Open, SaveAs and reopen qualify the edited five-owner plain output and the source-free two-picture plain output without synthetic metadata; the derived arbitrary F7D metadata output fails native Open and is qualified for library byte transport only, with no native rendering or acceptance claim
The drawing staging does not make complete Workbook Open transactional, and a failed direct stream write can retain a prefix; file publication keeps its existing checked-target contract
The finite typed nested-group profile imports, edits and saves admitted axis-aligned groups with regenerated counts and IDs; finite whole-worksheet grouped copying also maps supported images and fonts, and finite selected-group insertion adds represented subtrees to existing drawings or parents; wider catalog identities and general solver or unknown-reference remapping remain outside those finite fidelity profiles
Large unknown worksheet drawing leaves
Ordinary BIFF8 worksheet drawing input retains unknown non-folder OfficeArt bodies in owned file-backed storage, and complete Workbook output streams them without a complete leaf or aggregate drawing allocation
| API | Contract |
|---|---|
TMsoFbtUnknown.Size64 | Complete record size, including its eight-byte OfficeArt header, as Int64 |
AssignStream(Header, Source) | Consumes exactly Header.Length body bytes from the current position into independently owned storage, leaving the caller stream alive and retaining the previous leaf on failure |
Clone | Copies header and buffered bytes, or shares immutable retained storage with independent lifetime |
SaveToStream | Writes the complete header and body to a borrowed destination; a failed write can leave a prefix |
TMsoDrawing.Size64 | Checked wide drawing aggregate, with corresponding wide sizes on shapes, shape lists and connector rules |
TMsoDrawing.StoreToStream | Writes physical worksheet BIFF drawing segments and existing typed object tails in their represented order |
The header must describe a leaf with a complete available body; a header-only zero-length leaf is valid, while legacy Size, GetData and AddData keep their checked signed contiguous limits
Root Dg and Spgr leaves retain their logical parent and before/after-group or shape ordinal slot; their positions may be canonicalized relative to an adjacent typed object tail without changing that logical ownership
Drawing segments retain the relative order of OBJ, TXO, checkbox and embedded-chart tails; checked UInt32 OfficeArt body lengths and wide aggregate planning precede output, and retained data moves in chunks of at most 64 KiB
Whole-Workbook output stages the worksheet drawing in a temporary file before target creation, preserving wide BoundSheet/INDEX offsets and the original continuous plain, RC4 or CryptoAPI traversal; temporary sources and stages release after success or failure
Direct streaming borrows the source model and destination, so destination callbacks must not mutate the model; reentrant output of the same drawing refuses and leaves it reusable, while whole-Workbook source leases protect attached replacement before I/O
A real 2147483776-byte unknown body completes assignment, source-stream closure, cross-Workbook copying, original Workbook destruction, whole save, public reopen and whole resave; both physical CFB files are 2150666240 bytes with independently verified raw SHA256/MD4, complete BIFF records and unsigned offsets
The actual giant allocation gate remains 8 MiB; its largest Pascal request is 65552 bytes and the conservative request-inclusive envelope is 69632 bytes, excluding native allocations, operating-system cache and fixed stack buffers
The sampled pre-allocation live value is not a complete peak-memory or process-RSS measurement; reimport adds the same 132 bytes of default worksheet footer records as the old small-file control, so complete giant Workbook byte equality is not claimed
Unknown appearance remains unmodeled for semantic or rendering capture, and arbitrary giant OfficeArt interpretation by Excel is not claimed; source transport and deliberate model/materialization boundaries are summarized below
Retained metafile identity and large source ranges
Imported EMF and WMF pictures retain the complete original BSE prefix, optional UTF16 name, embedded blip header, one or two UIDs and the 34-byte metafile processing header while keeping large stored payloads in bounded owned sources
The retained prefix is at most 372 bytes; output updates container lengths, stored payload length and current reference count while preserving native compression, geometry and UID metadata
OfficeArt metafile UIDs identify uncompressed content, so they are not replaced by a digest of the compressed stored bytes; the existing HashKey still identifies stored raw content
Copies also compare their complete retained profile, excluding source reference count, so identical stored bytes with different geometry, names or UIDs remain distinct; a new destination entry begins with one reference and subsequent matching copies increment that target count
DataSize64, Size64, SaveToStream, wide drawing output and complete Workbook saves use these retained sources without a complete image allocation; legacy contiguous getters retain their checked signed bounds
For compressed metafiles, raw SaveToStream returns the stored compressed payload; it does not decode that payload into an ordinary uncompressed EMF/WMF file
Prospective parsing and copy ownership preserve the previous picture on failure and permit source Workbook destruction before copied raw or complete output; replacing a picture with PNG/JPEG or BMP clears stale metafile metadata
Both native EMF/WMF BSE records remain byte-exact through public save, copy, Linux save and native Excel reopen/resave; dual-UID framing and different-profile copies retain separate focused controls
A real 2147483712-byte uncompressed EMF completes parsing, whole Workbook save, copy, raw output and public giant Workbook reopen under an 8 MiB incremental Pascal heap gate, with 85592 bytes of observed growth and 65552 largest request
Independent verification consumes the entire 2150678528-byte CFB and 2148541653-byte Workbook stream, all BIFF records, the unsigned sheet BOF offset and raw SHA256/MD4 identities; this establishes storage without claiming that Excel or GDI renders a vector object above 2 GiB
The represented PICT one/two-UID framing follows the same primary format contract but has no native PICT witness; the shared DIB range branch gains bounded storage without new codec or giant native-rendering claims
This finite producer profile does not establish editing, rendering or native acceptance for additional opaque object semantics; current transport and materialization boundaries are summarized below
Bounded import of large embedded PNG and JPEG pictures
Normal workbook-global MSODRAWINGGROUP and continuation bodies use a private file-backed range source instead of retaining the complete group as an array of physical payload Blobs
The source keeps the first small body for existing dispatch and tracks complete logical bytes as Int64, within the UInt32 OfficeArt root length plus its eight-byte header
PNG/JPEG leaves above 1 MiB are copied through bounded range reads into their own immutable retained source, with incremental MD4; input group storage is released after parsing, while the picture remains independent of the reader, input filename and caller stream
This uses bounded disk staging with separate transient group and retained leaf files, rather than zero-copy disk import; caller input streams may be closed immediately after successful loading
TMSOPicture.Parse64 adopts a complete prospective picture only after successful parsing, retires the old retained owner on success, and preserves the previous picture on malformed input or allocation failure
TXLSBlobList.CopyData64 is now virtual for the private drawing range source; its existing append semantics and checked source-range contract remain in force
Malformed picture records propagate failure instead of silently disappearing from a drawing group that reports success; reader exception cleanup also releases the unowned lookahead body already read for the next BIFF record
The complete Workbook retains its existing reset/load behavior on failed Open; the per-picture prospective replacement contract does not establish a new transaction for the whole Workbook model
An actual 2150666240-byte Workbook imports its 2147483665-byte image under the unchanged 8 MiB incremental Pascal heap gate, with 193232 bytes of observed growth and a largest request of 65552 bytes
The imported image survives cross-Workbook copy and original reader/Workbook destruction, then completes raw export and whole Workbook output with identical raw SHA256 and MD4; independent verification consumes all 2148529833 Workbook bytes and 261207 BIFF records, including UInt32 sheet offset 2148529478 at its exact BOF
The measured gate excludes native OLE memory and OS file cache; the finite transport qualification does not establish editing, rendering or native acceptance for additional opaque object semantics, and the current storage boundaries are summarized below
Retained known OfficeArt properties
Known complex OfficeArt property bodies above 1 MiB use privately owned immutable file sources prepared with reads of at most 64 KiB before the prospective property table is published; the caller's input buffers may be destroyed after successful parsing
Worksheet property leaves enter the range reader before whole-leaf allocation, while large leaves without a modeled shape owner refuse before that allocation; global and worksheet writers both emit bounded chunks
Property items and tables carry checked Int64 size accounting through their parents; every UInt32 record-body limit and the 4,095-property wire limit remains enforced, and Integer materializers retain their narrower boundary
Complete frame-local property clones share immutable bodies and retain their lifetime after source destruction; the embedded picture ID is remapped against an occupied destination picture store
Source-side copy preflight rejects unsupported additional simple picture references and retained global defaults across workbooks before changing destination sheets or pictures; direct retained-frame copying also follows the destination write lease
A retained property table refuses unsafe raw item edits, deletion, replacement and reparsing; materialized read snapshots do not discard the retained owner or restore mutable access
Actual 2 MiB and 12 MiB workbooks qualify parsing, copying, source destruction and save/reopen; a separate controlled Int64 offset witness exercises a real small payload above unsigned-32 address space, without claiming a physical multi-GiB input
The 6 MiB retained-parse production witness adds 53,248 private bytes after caller-input creation; native fixture property-table checks retain their original producer domain, and arbitrary drawing copies, global-default repair, authored property strings, a universal raw-property owner chain and other typed metadata remain outside that finite transport profile
Large file-authored PNG and JPEG pictures
TMSOPicture.LoadFromFile retains PNG and JPEG bytes in library-owned storage and computes their MD4 incrementally before replacing the previous image; after success, changing or deleting the original path cannot change the retained image
Raw images through 1 MiB keep their contiguous representation, while larger images use an owned temporary file and a persistent handle with independent read-view positions
DataSize64 reports the actual raw image byte count without materialization, and SaveToStream(Stream) writes those raw bytes with bounded buffers and returns 1 on success
Picture.LoadFromFile('large-image.png');
Output := TFileStream.Create('raw-image.png', fmCreate);
try
Picture.SaveToStream(Output);
finally
Output.Free;
end;
The stream remains caller-owned and writes begin at its current position; nil destinations and failed writes raise, and a failed nontransactional raw stream write can leave a prefix
SaveAs(FileName) uses a sibling-file transaction for raw image output and returns -1 for stage, write or commit failures; a failed replacement retains the previous destination
AddCopy shares immutable file-backed bytes with independent lifetime, so the copy remains usable after the original picture or Workbook is destroyed; active file-backed raw output also retains its own source owner during reentrant picture replacement
The legacy mutable Data getter materializes and detaches a private complete Blob within High(Integer); above that raw length it raises before materialization, while DataSize64 and SaveToStream remain available
Legacy framed GetData and signed Size keep their checked signed limits; a failed materialization leaves the immutable source available for raw streaming
OfficeArt bodies retain UInt32 wire lengths, with 61 bytes of fixed embedded-image overhead reserved before raw input is accepted; an optional BSE name adds its separate validated cost
Image bytes are retained without decoding or transcoding, consistent with the existing extension-selected raw PNG/JPEG contract; read-view seek/read locking does not make the mutable picture model generally thread-safe
A valid 2147483665-byte PNG with independently checked chunk CRCs completes load, cross-Workbook copy, original Workbook destruction, raw export and a 2150666240-byte complete CFB save; all raw bytes and embedded MD4 identities agree
The giant run observes a largest Pascal allocation request of 65552 bytes under a 32 MiB single-allocation gate; this is not total process RSS and excludes OS cache, native CFB internals and fixed stack buffers
Embedded PNG/JPEG import and direct source-backed picture replacement follow the bounded profile above; the finite transport qualification does not establish editing, rendering or native acceptance for additional opaque object semantics, and the current storage boundaries are summarized below
Bounded drawing staging in complete Workbook saves
Classic SaveAs stages the global drawing through a registered private file instead of retaining a second complete physical drawing sequence in the late-global Blob list
Preceding globals, drawing bytes and following globals keep their exact output order; checked Int64 extents include all three segments before UInt32 BoundSheet offsets are written
The persistent BIFF cipher processes the same ordered segments, and drawing encryption and final native IStream copying use fixed 64 KiB buffers
Stage ownership is released on success, allocation failure and cancellation; the existing compound-file transaction preserves caller bytes and position on failure and permits retry with the same Workbook
A current-composition 32 MiB drawing save creates a real 33652736-byte CFB file under an 8 MiB incremental Pascal heap gate, with a largest allocation of 65552 bytes; this metric excludes the source model, native OLE allocation and OS file cache
A separately retained complete physical witness contains 2150817792 bytes, a 2148682151-byte Workbook stream and 261470 BIFF records; its UInt32 sheet offset 2148681408 reaches the exact worksheet BOF beyond signed 32-bit
The large scene borrows 2048 references to one actually allocated 1 MiB leaf and detaches duplicates before destruction; full physical hashing and independent stream-chain checks establish serialization without claiming native Excel acceptance of a giant Workbook
Plain BIFF8, RC4, RC4 CryptoAPI, BIFF5 XOR and plain BIFF5 retain repeat-save and reopen behavior; deterministic outputs and fully decrypted streams preserve baseline bytes, while randomized encrypted containers have separate ciphertext
TXLSBlob.Write uses bounded signed-safe IStream calls, initializes each reported count and rejects failed HRESULT or partial completion without retrying an unknown target side effect; an empty Blob succeeds without a foreign zero-count call
The low-level Blob sink remains borrowed and nontransactional, so a failed write can retain a prefix; complete Workbook saves obtain destination protection from their outer staged-storage lifecycle
Large file-authored PNG/JPEG retention follows the owned-source path above; the finite transport qualification does not establish editing, rendering or native acceptance for additional opaque object semantics, and the current storage boundaries are summarized below
Wide global drawing stream output
TMSOPicture.Size64, TMSOPictureList.Size64 and TMSODrawingGroup.Size64 report complete OfficeArt envelope lengths as Int64, with checked aggregate arithmetic; the existing Integer Size properties raise ERangeError outside their signed domain
OfficeArt body lengths retain their UInt32 wire domain, and the BStore record instance permits at most 4095 entries; wide internal accounting does not enlarge either format field
TMSODrawingGroup.StoreToStream(Stream, BiffRecSize) writes an MSODRAWINGGROUP and its CONTINUE records directly to the caller's stream, retaining one physical record buffer and small picture/name headers while borrowing existing picture bytes without a complete output-picture copy
BiffRecSize is the physical record payload limit in bytes, from 1 through 65535; callers must select the limit appropriate to their BIFF version, such as 8224 for BIFF8
Output := TFileStream.Create('drawing-group.biff', fmCreate);
try
Workbook.DrawingGroup.StoreToStream(Output, 8224);
finally
Output.Free;
end;
This example writes raw global drawing BIFF records, while ordinary workbook SaveAs creates a complete spreadsheet container
The synchronous call returns 1 on success and propagates range, allocation and stream exceptions; the caller keeps both drawing model and stream alive and unchanged, and the low-level object has no workbook read-lease context to acquire
The stream remains borrowed and is not freed, rewound, truncated or rolled back; a failed write can leave a written prefix, so transactional callers must stage or restore their destination separately
The existing Store(DataList, BiffRecSize) uses the same encoding and preserves ordinary output bytes, but still retains the complete physical sequence in its owning Blob list
A normal-build verifying sink consumes and compares all 2147625008 logical bytes, every physical header and all 2148669576 emitted bytes across 261142 BIFF records; its largest writer allocation is 8228 bytes
The boundary scene borrows 2048 references to one real allocated 1 MiB PNG payload and detaches duplicate references before destruction; it does not falsify source lengths or represent a complete giant native Workbook file
Maximum UInt32 root-body planning and next-byte refusal retain their separate wire-boundary scope; ordinary native-PNG Workbook file and stream output preserves every internal CFB stream byte, with only root-directory modified time allowed to differ
Named embedded pictures use the OfficeArtFBSE name format: an even UTF16LE byte count including the terminating NUL, at most 254 bytes or 126 nonterminating code units
Reading, deep copy, contiguous output and stream output preserve absent names separately from explicitly present empty names; malformed lengths, missing termination and interior NUL reject, and FBSE.Size counts the BLIP envelope without the name
Complete Workbook drawing staging and file-authored PNG/JPEG retention follow the bounded paths above; the finite transport qualification does not establish editing, rendering or native acceptance for additional opaque object semantics, and the current storage boundaries are summarized below
Physical BIFF read positions
Classic record reading now keeps its physical cursor and absolute seek position as Int64, including record reads across 4 GiB and a caller-owned stream prefix above MaxInt
Actual reported partial-read counts advance the logical position; impossible counts and Int64 addition overflow refuse, and failed body processing releases its body buffer
Absolute seeks check caller-prefix addition and the backend's returned position before publishing the new logical position; backend errors can still move its own cursor, so this does not promise I/O rollback
Native compound-stream positions and sizes retain their exact integer bit representation; format-defined four-byte FilePointer and BoundSheet fields remain unsigned 32-bit values
Built-in RC4, CryptoAPI and XOR decrypters use the same Int64 position path; their key derivation, FILEPASS, header/plaintext rules and independent Pivot-cache initialization retain their existing behavior
The representative Windows and native Linux checks each cover 20 physical-position and 58 decryption controls, plus four caller-prefix controls; 32 ordinary public encrypted file/stream/cache/embedding regressions pass with the existing Windows compiler
Boundary record checks use a deterministic virtual 5 GiB source, not a complete valid multi-GiB Workbook or a native Excel opening result; the large metadata-only size control was already exact in the baseline
Rebuild all binary consumers because concrete reader/decrypter layouts and the virtual decrypter table change; see 64-bit decrypter compatibility for external subclasses and algorithm limits
Sheet-name extraction and writer aggregate/fixup widths follow the bounded discovery and checked aggregate profiles above; physical read support does not imply unrestricted large Workbook grammar or output
Stream retained semantic payloads
Canonical VBA storage and Classic security-complete Ctls bytes stream directly from retained file ranges instead of implicitly requesting the editable Data Blob
The existing bytes-record framing keeps its unsigned 64-bit length, payload order and semantic wire version 3; ordinary supported snapshots and their SHA-256 identities remain byte-for-byte unchanged
Payload output uses at most 65536 bytes per write, follows the current mutable Blob length when explicitly materialized and preserves the private backing cursor
The canonical writer exposes WriteFileStream(ATag: Word; ASource: TXLSFileStream) for existing bytes fields; the caller retains ownership, nil input or invalid state refuses, and a positive unavailable payload cannot produce a successful record
Output is synchronous and follows the existing partial-output contract: a destination error propagates, the source remains reusable, and a failed writer must be discarded before retrying with a fresh writer
A complete 2147483771-byte retained test payload produces 2147483811 canonical bytes, verified by independently hashing its exact header, unsigned length, all payload bytes and document terminator; the maximum actual destination write is 65536 bytes
The large source is the earlier explicitly test-authored nested MBD stream and establishes no new large VBA-project or native Excel acceptance claim
Public typed VBA load and snapshot retain three actual modules under the representative individual GetMem exclusion; the old 8388701-byte snapshot request fails while the new combined load/snapshot path has a largest observed request of 4176 bytes
The allocation experiment excludes individual GetMem requests of one MiB or more only during the selected operations, without bounding ReallocMem, AllocMem, process RSS, caller-owned destination storage or native OLE32 mappings
See semantic payload streaming for identity and retry behavior; physical BIFF positions and unsupported embedding fields remain separate scope
Typed VBA source ranges
Typed module extraction skips the implementation-specific performance-cache prefix and reads compressed source through fixed 4096-byte windows, retaining one decoded chunk plus geometrically grown actual source text
MODULEOFFSET.TextOffset is unsigned 32-bit and remains Int64 internally, including offsets above MaxInt; the existing Integer module constructor remains available beside its Int64 overload
The project header reads at most seven bytes without materializing the complete _VBA_PROJECT stream; decoded source retains the signed-32-bit editable Blob/string boundary, and no arbitrarily large source text contract is added
TXLSFileStream.ReadRange(Offset: Int64; Buffer: Pointer; Count: Integer) reads a checked range into caller-owned memory; CopyRangeToStream(Offset, Count: Int64; Destination: TStream): Int64 validates its complete source range before output and copies in at most 65536-byte requests
Payload range reads preserve the private source cursor; destination I/O failure may leave partial output and does not restore an external destination
Unmaterialized source edits append the preserved prefix and compressed replacement suffix to the shared registered spool, publishing a new slice only after successful preparation; earlier slices remain valid for surviving clones
Repeated edits may grow temporary disk extents because obsolete slices are not reclaimed; explicitly materialized editable Blobs retain their object identity and explicit allocation boundary
Invalid editable lengths beyond allocated Blob capacity reject before copying or stream creation; synchronized snapshots retain live pending edits and share unchanged immutable ranges
Typed adoption propagates allocation and payload I/O/range failures instead of silently reporting success with a missing typed project, preserving the previous graph and caller ownership; the separate opaque-project fallback for other unsupported parser cases remains available
An actual derived legacy project with an 8 MiB ignored prefix retains all three source modules through public load, editing, saving and reopening without a whole-prefix GetMem request; complete prefix and unaffected-stream hashes remain identical
The historical internal196 profile used a second derived offset2147483665 to expose an earlier successful load that omitted one module and then retained all three modules through public edit/save/reopen; its large CFB inputs and outputs used the then-explicit version4 stage and were dense, although the source prefix file was sparse
Individual GetMem exclusions do not bound ReallocMem, AllocMem, total resident memory or native OLE32 mappings; no macro is executed and no new signature trust or native-authored large-project acceptance is claimed
The module prefix and unsigned field follow MS-OVBA Module Stream and MODULEOFFSET; semantic opaque snapshots and physical BIFF positions retain separate boundaries
Retained BIFF8 embedded objects
Public Classic workbook import binds supported ordinary BIFF8 type-8 object references to their actual MBD storage identities, retaining all nested stream payloads and writing the referenced storages during saving to the original BIFF8 format
The bounded identity decoder accepts an existing picture formula with a five-byte PtgTbl object identity and an MBD name followed by eight hexadecimal digits; DDE, camera and stream-based control identities remain outside this profile
Original object and drawing records remain intact, with storage CLSID, state bits and valid nonzero storage creation/modification times retained; CFB stream creation/modification times must be zero and invalid inputs reject before replacing payload state
Missing referenced storages fail import, and unproved source bindings or duplicate references refuse compound saving; no embedded object or VBA macro is activated or executed
Deleting a retained object omits its storage from that output without discarding the source forest, so restoring the original object can reuse its retained payload
Other compound-format conversions refuse before changing target bytes or stream position; explicit CSV, text, HTML and RTF exports remain available and retain the source forest for a subsequent supported workbook save
Security-complete semantic snapshots refuse retained embedding payloads absent from their current schema; default content snapshots keep their existing policy, and no OOXML embedding conversion or editable nested-server workbook API is added
The historical internal191 profile retained all four embedded streams of a real native macro-free Excel.Sheet.8 source through public saving and native readonly reopening; a derived fixture added a2147483771-byte nested payload, with all five streams, complete payload hash, three markers and storage metadata independently preserved under the then-explicit version4 stage
The added large stream was explicitly test-authored, and large-file native Excel opening is not claimed; the measured payload had a sparse file flag but fully allocated extents, and output was dense
The actual public large import/save profile reaches a 28020736-byte peak working set and 15458304-byte private commitment, while a separate direct native StgOpenStorage clone profile reaches a 2159751168-byte working set from mapped input pages despite only 8343552 bytes of private commitment
The 128 MiB owned job limit bounds private commitment, not native mapped-page residency; these observations do not claim constant total memory for arbitrary caller-owned COM backends
Incremental Classic record encryption
Classic password-protected saving visits existing generated record blobs in final output order with a persistent BIFF cipher, without allocating another complete Workbook stream or an array of blob references
Each independent Pivot cache starts with a fresh cipher at stream position zero; standard RC4, RC4 CryptoAPI and XOR key derivation, FILEPASS bytes, record plaintext exceptions and bypass semantics remain unchanged
The caller supplies at most 65536 bytes per request, while state retains a four-byte partial header and fixed cipher scratch; headers and plaintext prefixes advance the same keystream positions, including record splits and 1024-byte RC4 rekeys
The absolute cipher position is Int64, with the RC4 block index checked against its actual unsigned wire width; XOR retains each complete record length across chunk boundaries
Generated typed record lists remain resident under their existing contract, and password-dependent derivation can still allocate in proportion to password length; this change removes an avoidable second payload copy without claiming constant total process memory
A representative 4000-long-text public save rejects the old 11064174-byte GetMem flattening allocation while preserving its target; the incremental path saves and decrypts the final cell with a largest observed GetMem request of 65552 bytes and no excluded request
That experiment excludes individual GetMem calls of one MiB or more only during SaveAs, and does not bound ReallocMem, AllocMem, native COM allocations or total resident memory
Temporary generated lists are discarded on encryption failure before normal staged publication; caller stream I/O, file replacement, cancellation and source ownership retain their existing contracts, and independent MBD storage payloads remain unchanged by outer Workbook encryption
See the incremental transformer contract for direct buffer processing and completion requirements
Borrowed streams and bounded container writing
EntryIndex := Writer.AddStreamFromStream('Payload', Source, Offset, Count, ParentIndex);
Writer.Save;
AddStreamFromStream(Name, Source, Offset, Count, ParentIndex=0): Integer borrows an explicit source range without reading or cloning its payload when queued; offsets and counts are 64-bit, the caller retains ownership, and every source must remain alive and unchanged until synchronous Save returns
Queuing, preflight and payload reads restore each source position, including shared sources with multiple queued ranges; the same stream object cannot be both source and destination, and distinct handles that alias the same backing file are prohibited by the caller contract
Small output retains the existing version-3 layout; a complete planned layout beyond the version-3 container bound selects version 4 with 4096-byte sectors, complete 64-bit directory stream sizes and the version-4 directory-sector count
Normal payload reads and writes use at most 64 KiB per request; positive short reads accumulate, while premature EOF and short destination writes raise stream errors
MaxWriterMetadataBytes defaults to 256 MiB and MaxWriterEntries defaults to 1,000,000; queue and allocation representability remain checked, and the legacy AddStream byte-array API still makes its documented payload copy outside that metadata budget
Invalid ranges, direct self-alias, unrepresentable layouts, metadata-limit failures and failed small-payload preparation reject before destination mutation; once actual output begins, an I/O failure may leave partial bytes and a changed destination position
Native XlsWriteCompoundStorage retains the document while its owned payloads are borrowed and reports exceptions as a failing HResult; it does not add transactional rollback to the caller's destination
Independent native Linux acceptance loads and writes an actual 5 GiB plus 123-byte payload, releases the original input before saving, preserves independently visible stream cursors and verifies the complete input/output payload hash through an independent parser
Writer queue identity and reserved capacity
Writer queues use an AVL index keyed by parent storage and the existing pinned CFB name comparison; duplicate lookup and insertion have logarithmic depth while public directory identities retain their original insertion order
The comparison remains independent of locale, retains UTF-16 length-first ordering and the 31-code-unit name limit, and preserves separate name scopes for different parents without an input-controlled hash-collision path
Four queue arrays reserve geometric capacity separately from their logical count; unused slots cannot become entries, and managed records and arrays are staged completely before publication
The metadata allowance includes reserved slots, old and new arrays alive together, names and transient copies, retained allocation metadata and directory planning; the unchanged 1000000-entry and 256 MiB limits are ceilings and some combinations can refuse earlier
Quota refusal and staged allocation failure leave committed names, payloads and insertion identities intact; legacy byte-array insertion retains its one owned payload copy, while borrowed ranges remain unread until output
Save traverses the same index in linear name order before the established directory-tree construction, preserving complete container bytes for the qualified ascending, descending and permuted mixed queues
The representative 15000-entry permuted queue changed from 14046 ms to 129 ms in one measured Linux run; the actual 15002-node index had height 16 and eleven growth operations, which are observations rather than a general timing guarantee
Independent parsing verifies all 70000 entries across old and new controls; Windows and Linux permuted outputs are byte-identical, and a separate private instrumented copy checks AVL invariants and staged allocation failures
Native document child lookup uses the index described above; native and Windows container commit use the file-backed staging described above; this queue change does not claim constant whole-process memory, million-entry execution qualification or rollback after actual output I/O failure
Stream mini payloads without an aggregate buffer
Small entries are written in mini-sector allocation order through the fixed payload buffer, with each entry padded to 64 bytes and the root padded to the selected container sector size; no complete mini-stream payload array is retained
Each borrowed small entry is read twice during Save: bounded preflight preserves destination bytes on preparation failure, then output reads the same immutable source again; a later read or write failure retains ordinary partial-output semantics and restores source positions
The unchanged 256 MiB writer metadata budget covers retained and temporary allocation metadata and queue allowances without charging an aggregate payload array that no longer exists; legacy byte-array copies keep their existing ownership contract
A representative 5000-entry fixture with 4095 payload bytes per entry produces the exact same 22,578,688-byte container, including the 20,480,000-byte padded root mini-stream; independent parsing verifies every entry, while measured native Linux peak RSS falls from 27,196 KiB to 7,132 KiB
That fixture reads small source bytes twice and its measured save time changes from 67 ms to 100 ms; it does not establish output qualification for a mini-stream aggregate larger than 2 GiB or for a million entries
Allocation metadata remains resident; writer queues use the balanced index described below, while native document loading remains eager with its separate document payload capacity and shared-spool policy
Indexed root mini-stream reading
Loading validates the complete root mini-stream FAT chain and retains its sector index and 64-bit logical size, without allocating or reading the complete root payload
Selected mini-entry ranges map their logical 64-byte sectors through this index to physical container sectors, including fragmented root chains and logical offsets above 2 GiB; detached OpenEntryStream uses the same complete selected-chain preflight before materializing only that entry
Subsequent mini-entry copies reuse the validated root backing boundary instead of scanning the complete root chain for each entry; later backing-container truncation still rejects before destination writes
MaxReaderMetadataBytes defaults to 256 MiB and checks allocation tables, directories, root indexes and temporary validation storage before allocation; detached entry payload arrays are separate, and the backing stream must remain readable while extraction runs
LoadFromStream preserves the caller's position on success and rejection; incomplete, cyclic, overlong or out-of-container root and MiniFAT chains reject, and selected mini-entry failures preserve the usual preflight destination contract
The representative default-budget fixture has a 3 GiB logical root mini-stream and a complete 192 MiB MiniFAT; loading reads zero root payload bytes, native extraction reads only the two actual mini entries, and reported resident memory includes the size-dependent metadata
A larger root requiring a complete 320 MiB MiniFAT rejects under the unchanged default reader budget before that table is allocated or read; this refusal is not counted as successful large-root support
Container limits and sector conventions follow [MS-CFB] section 2.9; these container APIs do not extend the BIFF record model or its workbook-size guarantees
Classic checkbox, radio and button captions
Version 2.384.446 extends bounded TXO text and formatting output to the concrete Classic TXLSWorkbook worksheet Shapes.AddCheckBox, AddRadioButton and AddButton owner family
Loading consumes all declared text and formatting portions, including mixed compressed and wide Unicode text, before installing the owner's fields; saving preserves the supported header flags, rotation, control information and empty-text font identity
Unchanged captions retain their rich formatting runs and the fonts referenced only by those runs; changing Text updates the stored caption and resets the previously preserved run formatting, while assigning the same text retains it; a retained text formula remains separately bound
Supported TXO object formulas use owned compiled references so changes to represented names and their saved indexes do not leave stale raw identifiers; linked-cell and macro formula metadata retain their existing concrete Classic behavior
Counts outside the representable fields and unsupported formula forms refuse before this owner emits its drawing records; the surrounding save retains its own partial-output and memory contracts
These concrete Classic owners have a separate lifecycle from the seven-family OOXML and ODS form-control model; existing unsupported grouped and selected-copy roles retain their explicit guards
Long Classic comment text and formatting
Version 2.384.445 splits supported Classic comment and textbox text into physical continuation records that stay within the BIFF8 record limit, preserving text and rich formatting through repeated file save, source release and reopen
Unicode text segments retain their encoding marker and complete character units, while formatting segments preserve complete run boundaries and keep the terminal run in the last segment
The text count and formatting-byte count remain unsigned sixteen-bit fields; an owner that cannot be represented is rejected before its drawing records are emitted, and the live text and formatting remain available for correction and retry
This owner-local check does not promise rollback of bytes already emitted by the surrounding workbook save, bounded whole-save memory or acceptance of every native drawing topology
Supporting-link record output
The finite Classic supporting-link output profile writes the base and its owned external-name and cached-value records separately after collection framing and checked-size preflight, without constructing a complete aggregate child-record blob
Resident source records and typed caches retain their existing size-dependent memory; the separate XTI tuple serializer, narrow format fields, large base construction and broader wide-storage work remain outside this increment
Typed external-sheet reference continuations
The finite XTI continuation profile writes existing reference tuples through a fixed physical buffer, checks the unsigned sixteen-bit count before narrowing and reads all admitted segments on normal reopen
Actual counts through 65535 retain typed references and 3D formulas; source models, owner keys and worksheet staging remain resident, so the output buffer does not establish bounded whole-save memory
Generated Pivot line preparation
Classic Pivot line output derives combinations and record-local prefix compression on demand, preserving complete logical streams while removing complete expanded-line arrays
Actual public save measurements remain separate from resident source models, native allocations and other wide metadata families
Canonical workbook identifiers
XlsIdentifierKeyText(const A: WideString): WideString in lxStandard returns the UTF-16 text representation of the existing pinned Unicode identifier key, allowing Classic defined-name storage to share canonical equality with other workbook engines
This key representation is for identity and lookup rather than displayed spelling; authored names remain unchanged, and the CFB directory comparator retains its separate format-mandated ordering
See Free Pascal support for native build requirements and the verified BIFF8 workbook contract, and Classic encryption for supported encryption and plaintext property-stream behavior
Nested property-like records remain opaque
Version 2.384.465 distinguishes a shape's directly owned property table from a property-like record inside an unknown nested wrapper
The nested record remains part of the unknown payload and cannot replace the surrounding picture properties merely because its record kind resembles a supported property table
A wrapper with no represented structural descendants keeps its complete owned source range; if actual structural descendants require an open wrapper, a non-direct property leaf remains opaque
Ordinary file saving, source destruction, reopening and the qualified source-free picture copy preserve both the complete unknown records and the original direct picture properties
The existing physical host-marker, continuation and chart-tail rules remain active; the qualified mixed wrapper and split input retains its complete output streams, chart records and picture payloads against the existing library baseline
The unknown metadata witness is explicitly format-derived and qualifies library transport only; it adds no native acceptance for arbitrary metadata, general resource remapping or unrestricted grouped topology
Embedded chart whole-sheet copy
Version 2.384.470 copies an ordinary standalone embedded chart frame together with its worksheet through the public whole-sheet copy path, in the same workbook or across workbooks
The chart record stream is cloned in full, its local formula references are rebound to the copied worksheet and its font references are migrated by font value into the destination catalog, so the copy retains no pointer to the source worksheet or its calculator
A copied frame keeps only the shape properties it stores itself, so an ordinary scalar document default that the frame inherits and the destination drawing group does not declare is materialized into the copied frame with its exact source value
An inherited default that is opaque or image-bearing cannot be remapped and is refused, as is a declared destination default whose value differs from the source one
Chart colors are stored as palette indexes rather than absolute colors and migrate verbatim, so a cross-workbook copy is refused before any target worksheet, font, cell or generation is published when the destination indexed-color palette resolves any index differently
Grouped chart topology, source Metro dependencies, general chart formula graphs and external references, populated chart-cache synchronization and native copy-consumer acceptance remain outside this scope
Storage scope and qualification
Bounded source transport and wide storage positions do not make an opaque drawing record editable or renderable; each represented producer keeps its own grammar, owner and native acceptance limits
Encoded ordinary output, physical SST staging and the described retained cache producers have bounded source or output paths; cell/shared-string models, decoded source text and explicitly requested contiguous data remain separate resident or materialization contracts
The earlier internal856 Windows geometry decision covered the prepared Workbook stream and retained inline cache only; version 2.384.857 extends that decision to all emitted root children as described below
The historical191 and196 large-forest profiles used explicit version4 staging; their payload and lifetime evidence is retained, but it must not be treated as execution of the changed default-version3 geometry decision
Wide public worksheet copying on Windows
Internal version 2.384.855 keeps the ordinary version-3 Windows compound container and explicitly requests version 4 when the completed Workbook stream plan, including retained inline cache data, exceeds 2 GiB
The decision uses the current save plan before any child stream is written; replacing the empty stage preserves transactional output, shared root lifetime and publication failure handling
Reserved range-lock allocation is checked against the actual sector geometry through the declared DIFAT chain before publication, with bounded sector reads and rejection of incomplete, cyclic or invalid allocation pointers
The finite public Sheets.AddCopy witness attaches one ordinary unknown record to an existing picture frame, copies the worksheet across workbooks, releases the source workbook and removes both original inputs before saving, reopening and saving again
The retained payload is 2,147,483,776 bytes and both complete physical outputs are 2,150,666,240 bytes; independent full-content hashes and same-worksheet BoundSheet and INDEX targets are checked, including the later worksheet marker beyond the signed 32-bit boundary
The small-file control remains version 3 with 512-byte sectors, while the actual wide outputs use version 4 with 4096-byte sectors; successful source cleanup occurs before process exit
This witness covers library transport for an ordinary retained picture-frame leaf, with native and operating-system memory outside its Pascal allocation gate; it does not establish native application acceptance, giant header/footer pictures, arbitrary metadata graphs or geometry selection from unrelated embedded and VBA streams
Complete Windows root geometry planning
Before writing the first child, Classic workbook saves account for the current prepared Workbook, drawings and worksheet output, inline and independent cache streams, final VBA and control storage, selected live embedded-object trees and document properties
The decision includes directory entries, ordinary sectors, the mini-stream, miniFAT and the FAT/DIFAT fixed point; a property size bound crossing the 4096-byte mini-stream cutoff accounts for both allocation alternatives, and an unknown virtual writer conservatively requests version 4
Deleted embedding shapes do not contribute their retained source trees; an empty version-3 stage is replaced with version 4 before its first child is created when the complete plan requires wide geometry
Standalone SaveVBAProjectToFile uses the same complete-forest decision; pending VBA changes settle once before measuring the final forest, so an eventual storage or publication failure can occur after that internal settlement, while the intended edited source remains available for retry
Three focused Win64 scenarios qualify metadata decisions, a small edited VBA failure/retry lifecycle and an actual 2,147,483,771-byte embedded payload inside a small native-derived scaffold; source inputs are deleted before output, deletion selects version 3, and restoration followed by source-free save, reopen and resave selects version 4
Both large outputs contain a 20,133-byte Workbook stream and occupy 2,149,658,624 bytes; independent full-content verification checks the five embedded streams, allocation chains, meaningful source metadata and worksheet values
The small VBA scenario covers both workbook saving and standalone export with version-3 output; independent caches, controls and property alternatives have planner and source-review coverage, without a separate new giant run for each serializer
This is planned CFB geometry rather than an upper bound on the OLE32 allocator's high-water mark; the observed process peak Working Set of 28,938,240 bytes and peak pagefile usage of 16,609,280 bytes describe one run, without a universal memory guarantee or giant native-application acceptance claim