Skip to content

Remove checked-in DLLs for key-generation tests from repo - #6057

Merged
max-charlamb merged 4 commits into
dotnet:mainfrom
rcj1:remove-dlls
Oct 6, 2026
Merged

max-charlamb merged 4 commits into
dotnet:mainfrom
rcj1:remove-dlls

Conversation

@rcj1

@rcj1 rcj1 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Replace the dummy DLLs that are checked-in for the purpose of testing key generation with in-memory dummy images.

Copilot AI lite review requested due to automatic review settings September 22, 2026 22:38
@rcj1
rcj1 requested a review from a team as a code owner September 22, 2026 22:38
@rcj1 rcj1 changed the title Remove checked-in DLLs from repo Remove checked-in DLLs for key-generation tests from repo Sep 22, 2026
@rcj1
rcj1 requested a review from mdh1418 September 22, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Review effort: Lite
Findings: None

What changed in this PR

Replaces checked-in PE test DLL dependencies with generated in-memory PE images for symbol key-generation tests.

Changes:

  • Adds a minimal PE image builder with version resources.
  • Updates parameterized tests to generate streams in memory.
File Description
src/​tests/​Microsoft.SymbolStore.UnitTests/​PEImageBuilder.cs Updated as part of this pull request.
src/​tests/​Microsoft.SymbolStore.UnitTests/​PEFileKeyGenerationTests.cs Updated as part of this pull request.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@rcj1
rcj1 requested a review from hoyosjs September 22, 2026 22:53
@hoyosjs

hoyosjs commented Sep 23, 2026

Copy link
Copy Markdown
Member

A few things on the PE creator: It fails a few things in https://learn.microsoft.com/en-us/windows/win32/debug/pe-format

  • The resource tree is missing the high bit marked for the first two levels. Only the leaf language node should be unmarked.
  • The writer writes only the Resource directory RVA. NumberOfRvaAndSizes is zero and the directory's Size is also zero. The spec requires to use NumberOfRvaAndSizes before probing a directory. The IMAGE_RESOURCE_DATA_ENTRY at offset 72 also has Size == 0, despite pointing to version data.
  • It skips the VS_VERSIONINFO header and writes only VS_FIXEDFILEINFO. Consequently, wLength, wValueLength, and szKey are all zero. https://learn.microsoft.com/windows/win32/menurc/vs-versioninfo requires szKey == L"VS_VERSION_INFO" and states that wValueLength == 0 means the Value member does not exist.
  • Technically the size is not aligned but that doesn't matter for mock data here.

@rcj1

rcj1 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

A few things on the PE creator: It fails a few things in https://learn.microsoft.com/en-us/windows/win32/debug/pe-format

  • The resource tree is missing the high bit marked for the first two levels. Only the leaf language node should be unmarked.
  • The writer writes only the Resource directory RVA. NumberOfRvaAndSizes is zero and the directory's Size is also zero. The spec requires to use NumberOfRvaAndSizes before probing a directory. The IMAGE_RESOURCE_DATA_ENTRY at offset 72 also has Size == 0, despite pointing to version data.
  • It skips the VS_VERSIONINFO header and writes only VS_FIXEDFILEINFO. Consequently, wLength, wValueLength, and szKey are all zero. https://learn.microsoft.com/windows/win32/menurc/vs-versioninfo requires szKey == L"VS_VERSION_INFO" and states that wValueLength == 0 means the Value member does not exist.
  • Technically the size is not aligned but that doesn't matter for mock data here.

Ok, I’ll add these back - I was trying to remove some data that didn’t matter for key generation but you are right that it should follow the spec

Comment thread .config/guardian/.gdnbaselines Resolved
Replace manual PE headers with PEBuilder, validate generated resources and alignment, and remove the obsolete Guardian baseline.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 3ea7d50c-b495-46fa-9f71-d36bf96e672e

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add the missing System.Reflection.Metadata.Ecma335 using directive to fix compilation.

Review effort: Lite
Findings: 1 High severity

Open (1)

@max-charlamb

Copy link
Copy Markdown
Member

/ba-g known test failure

@max-charlamb
max-charlamb merged commit ebfc9ce into dotnet:main Oct 6, 2026
22 of 24 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants