Expand description
Reads and writes Multi-Stream Files (MSF). MSF is the underlying container format used by Program Database (PDB) files.
MSF files contain a set of numbered streams. Each stream is like a file; a stream is a sequence of bytes.
The bytes stored within a single stream are usually not stored sequentially on disk. The organization of the disk file and the mapping from stream locations to MSF file locations is similar to a traditional file system; managing that mapping is the main purpose of the MSF file format.
MSF files are used as the container format for Program Database (PDB) files. PDB files are used by compilers, debuggers, and other tools when targeting Windows.
Most developers should not use this crate directly. This crate is a building block for tools that read and write PDBs. This crate does not provide any means for building or parsing the data structures of PDB files; it only handles storing files in the MSF container format.
The mspdb crate uses this crate for reading and writing PDB files. It provides an interface
for reading PDB data structures, and in some cases for creating or modifying them. Most
developers should use mspdb instead of using msf directly.
§References
- The MSF File Format
- The PDB File Format
microsoft-pdbrepository: Many of the comments in this Rust crate reference C++ source files and header files from thismicrosoft-pdbrepository. If a C++ file is referenced in a comment without more context, such asdbi.h, then check for it in themicrosoft-pdbrepository.
Structs§
- Create
Options - Options for creating a new PDB/MSF file.
- Msf
- Allows reading and writing the contents of a PDB/MSF file.
- Stream
Reader - Allows reading a stream using the
Read,Seek, andReadAttraits. - Stream
Writer - Provides read/write access for a stream within an MSF (PDB) file.
Enums§
- MsfKind
- Specifies the versions used for the MSF.
Constants§
- DEFAULT_
PAGE_ SIZE - The default page size.
- LARGE_
PAGE_ SIZE - A large page size. This is less than the largest supported page size.
- MAX_
PAGE_ SIZE - The largest supported page size.
- MAX_
STREAM - The maximum valid stream index.
- MIN_
FILE_ HEADER_ SIZE - The absolute minimum size of a slice that could contain a valid MSF file header, as tested by
is_file_header_msf. - MIN_
PAGE_ SIZE - The minimum page size.
- NIL_
STREAM_ SIZE - This size is used to mark a stream as “invalid”. An invalid stream is different from a stream with a length of zero bytes.
- STREAM_
DIR_ STREAM - The stream index of the Stream Directory stream. This is reserved and cannot be used by applications.
Functions§
- is_
file_ header_ msf - Checks whether the header of a file appears to be a valid MSF file.
- offset_
within_ page - Gets the byte offset within a page, for a given offset within a stream.
Type Aliases§
- Page
Size - Specifies a page size used in an MSF file. This value is always a power of 2.