Skip to content

[build-ops] Remove CsWin32 enum workarounds for HTTP API types#37

Open
github-actions[bot] wants to merge 11 commits intomainfrom
main-82fbba9717ecb68b
Open

[build-ops] Remove CsWin32 enum workarounds for HTTP API types#37
github-actions[bot] wants to merge 11 commits intomainfrom
main-82fbba9717ecb68b

Conversation

@github-actions
Copy link
Copy Markdown

Summary

This PR removes hardcoded integer cast workarounds for HTTP API enum types that are now properly generated by CsWin32 0.3.269.

Changes

Replaced hardcoded integer casts with proper enum members in:

HttpSys Server

  • src/Servers/HttpSys/src/NativeInterop/HttpApi.cs

    • (HTTP_FEATURE_ID)11HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello
    • (HTTP_FEATURE_ID)15HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo
  • src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs

    • (HTTP_REQUEST_PROPERTY)14HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo
    • (HTTP_REQUEST_PROPERTY)11HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello

IIS Server

  • src/Servers/IIS/IIS/src/Core/IISHttpContext.cs
    • (HTTP_REQUEST_PROPERTY)14HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo

Verification

These enum values exist in the Windows metadata (microsoft/win32metadata) and are included in CsWin32's code generation:

  • HTTP_FEATURE_ID is already listed in src/Servers/HttpSys/src/NativeMethods.txt (line 17)
  • HTTP_REQUEST_PROPERTY is already listed in both HttpSys and IIS NativeMethods.txt files

The CsWin32 source generator produces these enum members from the Windows SDK metadata, making the workaround casts unnecessary.

Notes

  • CsWin32 version remains at 0.3.269 (already up to date with latest stable release)
  • No version bump needed - this is purely removing workarounds that are no longer necessary
  • Changes improve code clarity and type safety by using proper enum members instead of magic numbers

AI generated by Update CsWin32 Package Version and Remove Workarounds

DeagleGross and others added 11 commits February 24, 2026 12:04
…tworkflow

agentic-worklow on updating cswin32
…tworkflow

Add dotnet build capability to cswin32 agentic workflow
…tworkflow

Dmkorolev/cswin32 update agentworkflow
Replace hardcoded integer casts with proper enum members for:
- HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo
- HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsClientHello
- HTTP_FEATURE_ID.HttpFeatureCacheTlsClientHello
- HTTP_FEATURE_ID.HttpFeatureQueryCipherInfo

These enum values are now available in CsWin32 0.3.269 and
generated from the Windows metadata, eliminating the need for
workaround casts.

Affected files:
- src/Servers/HttpSys/src/NativeInterop/HttpApi.cs
- src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs
- src/Servers/IIS/IIS/src/Core/IISHttpContext.cs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant