Skip to content

[package] Remove CsWin32 hardcoded integer enum casts in HttpSys#66248

Merged
DeagleGross merged 1 commit into
mainfrom
cswin32-enum-workaround-cleanup-9f4363be7ae480e0
Apr 10, 2026
Merged

[package] Remove CsWin32 hardcoded integer enum casts in HttpSys#66248
DeagleGross merged 1 commit into
mainfrom
cswin32-enum-workaround-cleanup-9f4363be7ae480e0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 9, 2026

Summary

CsWin32 0.3.269 (via win32metadata 69.0.7-preview) now generates the following enum members that were previously missing, requiring hardcoded integer casts as workarounds:

  • HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello
  • HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo
  • HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo
  • HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello

Changes

Workarounds fixed

File Old (workaround) New (clean)
src/Servers/HttpSys/src/NativeInterop/HttpApi.cs (HTTP_FEATURE_ID)11 /* HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello */ HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello
src/Servers/HttpSys/src/NativeInterop/HttpApi.cs (HTTP_FEATURE_ID)15 /* HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo */ HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo
src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs (HTTP_REQUEST_PROPERTY)14 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo */ HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo
src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs (HTTP_REQUEST_PROPERTY)11 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello */ HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello

Workarounds that remain

  • src/Shared/HttpSys/NativeInterop/SocketAddress.cs.AsReadOnlySpan() inline array workaround: The referenced issue microsoft/CsWin32#1086 ("Leverage .NET 8/C# 12 inline arrays") was closed as "not planned", so CsWin32 will not generate inline arrays. This workaround must remain.

Version check

No version bump was needed — 0.3.269 is already the latest stable CsWin32 release (confirmed via GitHub releases API).

Build output

Build succeeded.
    0 Warning(s)
    0 Error(s)

(dotnet build src/Servers/HttpSys/src/Microsoft.AspNetCore.Server.HttpSys.csproj)

Generated by Update CsWin32 Package · ● 1.7M ·

HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello,
HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo,
HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo, and
HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello are now
generated by CsWin32 0.3.269 (via win32metadata 69.0.7-preview).
Replace the integer-cast workarounds with the proper enum member names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Apr 9, 2026
@DeagleGross DeagleGross self-requested a review April 9, 2026 15:26
@DeagleGross DeagleGross merged commit addd331 into main Apr 10, 2026
24 checks passed
@DeagleGross DeagleGross deleted the cswin32-enum-workaround-cleanup-9f4363be7ae480e0 branch April 10, 2026 09:36
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview4 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant