Update SetCredentialsAttributesW to match the native C API declaration - #131425
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
@dotnet-policy-service agree |
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
There was a problem hiding this comment.
Pull request overview
Updates the Windows SSPI interop for SetCredentialsAttributesW so its parameter widths match the native unsigned long (32-bit) declaration, preventing x86 stdcall name decoration mismatches during NativeAOT DirectPInvoke linking.
Changes:
- Changed
Interop.SspiCli.SetCredentialsAttributesWP/Invoke parameters fromlongtouint(4 bytes) to match nativeULONGon Windows. - Updated the
SslStreamPal.Windowscall site to passuintvalues for the attribute and buffer size.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs | Updates the call site to pass 32-bit uint arguments matching the corrected P/Invoke signature. |
| src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs | Fixes SetCredentialsAttributesW P/Invoke signature to use 32-bit uint parameters for x86 correctness. |
|
The documentation shows "unsigned long": https://learn.microsoft.com/en-us/windows/win32/api/sspi/nf-sspi-setcredentialsattributesw |
|
|
it sad the the compilation is not smart enough to know that but so be it... |
Change the P/Invoke declaration for
SetCredentialsAttributesWto use uint rather than long, since C unsigned long is 4 bytes on Windows.Fix #131416