Skip to content

Conversation

@davidwrighton
Copy link
Member

  • The Atts and Template parameters are actually pointers, and the existing prototypes were only passing 32bit integers

…alling CreateFile

- The Atts and Template parameters are actually pointers, and the existing prototypes were only passing 32bit integers
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Copy link
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 fixes incorrect P/Invoke declarations for the Windows CreateFile API in three bindhandle test files. The 4th and 7th parameters (security attributes and template file handle) are pointer types in the native API and must be declared as pointer-sized types in the managed signature.

Changes:

  • Updated CreateFile P/Invoke declarations to use nint instead of int for pointer parameters
  • Ensures proper interop behavior on 64-bit systems where pointers are 64 bits

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tests/baseservices/threading/threadpool/bindhandle/bindhandleinvalid6.cs Fixed CreateFile P/Invoke signature to use nint for Atts and Template parameters
src/tests/baseservices/threading/threadpool/bindhandle/bindhandleinvalid3.cs Fixed CreateFile P/Invoke signature to use nint for Atts and Template parameters
src/tests/baseservices/threading/threadpool/bindhandle/bindhandle1.cs Fixed CreateFile P/Invoke signature to use nint for Atts and Template parameters

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

Boo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants