Crate ms_pdb_msf

Crate ms_pdb_msf 

Source
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-pdb repository: Many of the comments in this Rust crate reference C++ source files and header files from this microsoft-pdb repository. If a C++ file is referenced in a comment without more context, such as dbi.h, then check for it in the microsoft-pdb repository.

Structs§

CreateOptions
Options for creating a new PDB/MSF file.
Msf
Allows reading and writing the contents of a PDB/MSF file.
StreamReader
Allows reading a stream using the Read, Seek, and ReadAt traits.
StreamWriter
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§

PageSize
Specifies a page size used in an MSF file. This value is always a power of 2.