Skip to content

C++: Add some more Windows specific memory copy models #20115

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 3 commits into from
Jul 23, 2025

Conversation

MathiasVP
Copy link
Contributor

A few more memcpy like things found in the wdm.h header for Windows driver development.

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 12:49
@MathiasVP MathiasVP requested a review from a team as a code owner July 23, 2025 12:49
@github-actions github-actions bot added the C++ label Jul 23, 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 Windows-specific memory copy function models to improve dataflow analysis for Windows driver development. The changes extend support for additional memory copy operations found in the Windows Driver Model (WDM) headers.

  • Adds external models for 8 new Windows memory functions (RtlCopy*, RtlMove*, RtlInitUnicodeString)
  • Includes comprehensive test coverage with dataflow verification for all new functions
  • Updates expected test results to reflect the new models

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
windows.cpp Adds function declarations and comprehensive tests for new Windows memory copy functions
Windows.model.yml Defines dataflow models for RtlCopy*, RtlMove*, and RtlInitUnicodeString functions
validatemodels.expected Updates expected validation results for new model specifications
flow.expected Updates expected dataflow analysis results with new function models
Comments suppressed due to low confidence (2)

cpp/ql/test/library-tests/dataflow/external-models/windows.cpp:496

  • The parameter uses SIZE_T type but it's not defined. Consider using the already defined size_t type for consistency with other functions, or add a typedef for SIZE_T.
  SIZE_T     Length

cpp/ql/test/library-tests/dataflow/external-models/windows.cpp:532

  • The NTSTATUS type is used but not defined. Consider adding a typedef for NTSTATUS or using a defined type.
NTSTATUS WdmlibRtlInitUnicodeStringEx(

@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Jul 23, 2025
@MathiasVP MathiasVP force-pushed the add-more-windows-memcpy-functions branch from 4c4090e to cbe5561 Compare July 23, 2025 13:06
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

LGTM.

@MathiasVP MathiasVP merged commit 5da7ae8 into github:main Jul 23, 2025
14 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