Skip to content

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

Merged
MathiasVP merged 3 commits intogithub:mainfrom
MathiasVP:add-more-windows-memcpy-functions
Jul 23, 2025
Merged

C++: Add some more Windows specific memory copy models#20115
MathiasVP merged 3 commits intogithub:mainfrom
MathiasVP:add-more-windows-memcpy-functions

Conversation

@MathiasVP
Copy link
Copy Markdown
Contributor

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

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
Copy Markdown
Contributor

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(

Comment thread cpp/ql/test/library-tests/dataflow/external-models/windows.cpp
@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
Copy Markdown
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.

3 participants