Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Sep 3, 2023

The GetPropertyAsDword API was allocating a 4-byte array to convert it to an integer for p/invoke purposes.

This changes the int32 path to work similarly to the intptr path and just get the value directly from p/invoke.

Since the DWORD and HANDLE paths are exactly the same, use a generic implementation.

@ghost ghost assigned vcsjones Sep 3, 2023
@ghost ghost added the area-System.Security label Sep 3, 2023
@ghost
Copy link

ghost commented Sep 3, 2023

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

The GetPropertyAsDword API was allocating a 4-byte array to convert it to an integer for p/invoke purposes.

This changes the int32 path to work similarly to the intptr path and just get the value directly from p/invoke.

Since the DWORD and HANDLE paths are exactly the same, use a generic implementation.

Author: vcsjones
Assignees: vcsjones
Labels:

area-System.Security

Milestone: -

@vcsjones vcsjones merged commit fdb5b2a into dotnet:main Sep 5, 2023
@vcsjones vcsjones deleted the cng-int-no-alloc branch September 5, 2023 17:54
@ghost ghost locked as resolved and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants