Skip to content

C++: Add missing ReadFileEx flow summary #19595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025

Conversation

MathiasVP
Copy link
Contributor

The hEvent field on OVERLAPPED remains unchanged when passed from ReadFileEx to the callback function. This PR adds a summary model that reflects this.

Thanks for noticing this funny behavior, @jketema!

@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 11:44
@MathiasVP MathiasVP requested a review from a team as a code owner May 27, 2025 11:44
@github-actions github-actions bot added the C++ label May 27, 2025
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label May 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds flow tests and a summary model for the hEvent field on OVERLAPPED when used with ReadFileEx, ensuring that the field is correctly propagated to completion routines.

  • Introduces two new completion routines (FileIOCompletionRoutine2, FileIOCompletionRoutine3) and corresponding ReadFileEx test cases in windows.cpp.
  • Updates expected test outputs (validatemodels.expected, sources.expected, flow.expected, nodes) to reflect the new dataflow.
  • Adds a new summary entry for ReadFileEx in Windows.model.yml.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cpp/ql/test/library-tests/dataflow/external-models/windows.cpp Added FileIOCompletionRoutine2/3 and two new ReadFileEx tests
cpp/ql/test/library-tests/dataflow/external-models/validatemodels.expected Added unrecognized spec warnings for new hEvent model entries
cpp/ql/test/library-tests/dataflow/external-models/sources.expected Updated source locations for new read/write flows
cpp/ql/test/library-tests/dataflow/external-models/flow.expected Expanded flow edges for the new summary parameters
cpp/ql/lib/ext/Windows.model.yml Inserted a new manual summary entry for ReadFileEx’s hEvent field

@MathiasVP
Copy link
Contributor Author

DCA was uneventful (as expected)

@MathiasVP MathiasVP merged commit e826b83 into github:main May 27, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants