Skip to content

Add md_get_pdb_id API for reading PDB identity from #Pdb stream#69

Merged
AaronRobinsonMSFT merged 1 commit intomasterfrom
feature/add-md-get-pdb-id
Mar 12, 2026
Merged

Add md_get_pdb_id API for reading PDB identity from #Pdb stream#69
AaronRobinsonMSFT merged 1 commit intomasterfrom
feature/add-md-get-pdb-id

Conversation

@AaronRobinsonMSFT
Copy link
Owner

Add a new public API, md_get_pdb_id(), guarded by DNMD_PORTABLE_PDB, that extracts the 20-byte PDB ID (GUID + stamp) from the #Pdb stream of a portable PDB file.

This enables consumers to validate that a PDB file matches a PE assembly by comparing the PDB ID against the CodeView debug directory entry in the PE.

API:

#ifdef DNMD_PORTABLE_PDB
bool md_get_pdb_id(mdhandle_t handle, size_t* pdb_id_len, uint8_t* pdb_id);
#endif

Parameters:

  • handle — metadata handle for a portable PDB
  • pdb_id_len — in/out buffer size (must be ≥ 20)
  • pdb_id — output buffer for the 20-byte PDB ID

Returns false if the handle does not contain a #Pdb stream.

Add a new public API, md_get_pdb_id(), guarded by DNMD_PORTABLE_PDB,
that extracts the 20-byte PDB ID (GUID + stamp) from the #Pdb stream
of a portable PDB file. This enables consumers to validate that a PDB
file matches a PE assembly by comparing the PDB ID against the
CodeView debug directory entry in the PE.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AaronRobinsonMSFT
Copy link
Owner Author

@jkoritzinsky I'm going to also push this through. Please let me know if you dislike the API shape. I'm fine changing it if you have another opinion on the data/shape.

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 1632e20 into master Mar 12, 2026
13 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the feature/add-md-get-pdb-id branch March 12, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant